Skip to content

Commit

Permalink
Handle clicks on tabs toolbar only if our button after last tab is vi…
Browse files Browse the repository at this point in the history
…sible

(#137)
  • Loading branch information
Infocatcher committed Apr 8, 2014
1 parent e00f79e commit c4ee6e3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2174,8 +2174,6 @@ var windowsObserver = {
this.initNodeEvents(tb2);
newTabBtn.parentNode.insertBefore(tb2, newTabBtn.nextSibling);
window.addEventListener("aftercustomization", this, false);
if(this.isAustralis) // Make buttons clickable with our binding
window.gBrowser.tabContainer.addEventListener("click", this, true);
}

if(this.isAustralis) try {
Expand Down Expand Up @@ -2256,15 +2254,20 @@ var windowsObserver = {
updateShowAfterTabs: function(tbb, document) {
if(this.showAfterTabs(tbb)) {
tbb.parentNode.setAttribute(this.showAfterTabsAttr, "true");
if(this.isAustralis)
if(this.isAustralis) {
tbb.parentNode.setAttribute(this.fixAfterTabsA11yAttr, "true");
// Make buttons clickable with our binding
document.defaultView.gBrowser.tabContainer.addEventListener("click", this, true);
}
}
else {
var tabsToolbar = document.getElementById("TabsToolbar");
if(tabsToolbar) {
tabsToolbar.removeAttribute(this.showAfterTabsAttr);
if(this.isAustralis)
if(this.isAustralis) {
tabsToolbar.removeAttribute(this.fixAfterTabsA11yAttr);
document.defaultView.gBrowser.tabContainer.removeEventListener("click", this, true);
}
}
}
},
Expand Down

0 comments on commit c4ee6e3

Please sign in to comment.