Skip to content

Commit

Permalink
Add support for "Opened Tabs List" menu from Tab Mix Plus
Browse files Browse the repository at this point in the history
(Tab Mix Plus options - Menu - Main Context Menu - [v] Opened Tabs List)
(#113)
  • Loading branch information
Infocatcher committed Dec 27, 2013
1 parent b635d1c commit 87b6c6b
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ var windowsObserver = {
this.initAppMenu(window, popup);
else if(id == "contentAreaContextMenu")
this.updatePageContext(window);
else if(id == "alltabs-popup")
else if(id == "alltabs-popup" || id == "tm-tabsList-menu")
this.updateListAllTabs(window, popup);
else if(id == "tabContextMenu")
this.updateTabContext(window);
Expand Down Expand Up @@ -2341,17 +2341,21 @@ var windowsObserver = {
|| document.getAnonymousElementByAttribute(window.gBrowser.tabContainer, "anonid", "alltabs-popup"); // SeaMonkey
},
setupListAllTabs: function(window, init) {
// Note: we can't add listener to <menupopup> for button in palette
var popup = this.getListAllTabsPopup(window, !init);
if(!popup) {
_log("setupListAllTabs(" + init + "): List all tabs popup not found");
return;
}
_log("setupListAllTabs(" + init + ")");
if(init)
popup.addEventListener("popupshowing", this, false);
else
popup.removeEventListener("popupshowing", this, false);
// Note: we can't add listener to <menupopup> for button in palette, so we should
// also call setupListAllTabs() after "aftercustomization" event
[
this.getListAllTabsPopup(window, !init),
window.document.getElementById("tm-tabsList-menu") // Tab Mix Plus
].forEach(function(popup) {
if(!popup)
return;
_log("setupListAllTabs(" + init + "): #" + (popup.id || popup.getAttribute("anonid")));
if(init)
popup.addEventListener("popupshowing", this, false);
else
popup.removeEventListener("popupshowing", this, false);
}, this);
},
updateListAllTabs: function(window, popup) {
_log("updateListAllTabs()");
Expand Down

0 comments on commit 87b6c6b

Please sign in to comment.