diff --git a/modules/base.js b/modules/base.js index fff7d4e4..856fab3d 100644 --- a/modules/base.js +++ b/modules/base.js @@ -335,7 +335,8 @@ var TreeStyleTabBase = inherit(TreeStyleTabConstants, { ); if (button < 0) - button = 1; + return this.kGROUP_BOOKMARK_CANCEL; + var behaviors = [ this.kGROUP_BOOKMARK_SUBTREE | dummyTabFlag, this.kGROUP_BOOKMARK_SEPARATE diff --git a/modules/bookmark.js b/modules/bookmark.js index 7883cb02..d3ad98e8 100644 --- a/modules/bookmark.js +++ b/modules/bookmark.js @@ -297,7 +297,8 @@ var TreeStyleTabBookmarksService = inherit(TreeStyleTabConstants, { var TST = aBrowserWindow.TreeStyleTabService; result.behavior = TST.openGroupBookmarkBehavior(); - if (result.behavior & this.kGROUP_BOOKMARK_SUBTREE) { + if (result.behavior != this.kGROUP_BOOKMARK_CANCEL && + result.behavior & this.kGROUP_BOOKMARK_SUBTREE) { log('handleTabsOpenProcess: open as a group'); let treeStructure = result.behavior & this.kGROUP_BOOKMARK_DONT_RESTORE_TREE_STRUCTURE ? null : @@ -429,6 +430,9 @@ PlacesUIUtils._openTabset = function(aItemsToOpen, aEvent, aWindow, ...aArgs) { var result = BS.handleTabsOpenProcess(where, aEvent, w, ids, uris, aItemsToOpen, this.__treestyletab__folderName); log(' result: ', result); + if (result.behavior == this.kGROUP_BOOKMARK_CANCEL) + return; + var tabs = TST.doAndGetNewTabs((function() { this.__treestyletab__openTabset(aItemsToOpen, aEvent, aWindow, ...aArgs); }).bind(this), w.gBrowser); diff --git a/modules/constants.js b/modules/constants.js index a5e565a0..3b8945ec 100644 --- a/modules/constants.js +++ b/modules/constants.js @@ -235,6 +235,7 @@ var TreeStyleTabConstants = Object.freeze({ kGROUP_BOOKMARK_USE_DUMMY_FORCE : 1024, kGROUP_BOOKMARK_DONT_RESTORE_TREE_STRUCTURE : 512, kGROUP_BOOKMARK_EXPAND_ALL_TREE : 2048, + kGROUP_BOOKMARK_CANCEL : -1, CONTENT_SCRIPT : 'chrome://treestyletab/content/content-utils.js',