Skip to content

Commit

Permalink
Highlight closed private tabs in Australis menu (History button)
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Aug 14, 2014
1 parent 324eea2 commit 115c780
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ var privateTab = {
case "dragend": this.dragEndHandler(e); break;
case "drop": this.dropHandler(e); break;
case "popupshowing": this.popupShowingHandler(e); break;
case "ViewShowing": this.viewShowingHandler(e); break;
case "command": this.commandHandler(e); break;
case "click": this.clickHandler(e); break;
case "keydown":
Expand Down Expand Up @@ -1851,6 +1852,10 @@ var privateTab = {
)
this.updateTabTooltip(window);
},
viewShowingHandler: function(e) {
if(e.target.id == "PanelUI-history")
this.updateUndoCloseTabs(e.target);
},
updatePageContext: function(window) {
_log("updatePageContext()");
var document = window.document;
Expand Down Expand Up @@ -2885,16 +2890,24 @@ var privateTab = {
if(init) {
if(undoPopup)
undoPopup.addEventListener("popupshowing", this, false);
if(this.isAustralis)
window.addEventListener("ViewShowing", this, false);
}
else {
if(undoPopup)
undoPopup.removeEventListener("popupshowing", this, false);
if(this.isAustralis)
window.removeEventListener("ViewShowing", this, false);
}
},
updateUndoCloseTabs: function(popup) {
_log("updateUndoCloseTabs()");
var window = popup.ownerDocument.defaultView;
var items = popup.getElementsByTagName("menuitem");
var items = popup.getElementsByTagName(
popup.localName == "menupopup"
? "menuitem"
: "toolbarbutton" // History list in Australis menu
);
var undoTabItems = JSON.parse(this.ss.getClosedTabData(window));
Array.forEach(items, function(item) {
var indx = item.getAttribute("value");
Expand Down Expand Up @@ -3885,7 +3898,8 @@ var privateTab = {
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");\n\
@-moz-document url("' + document.documentURI + '") {\n\
.tabbrowser-tab[' + this.privateAttr + '],\n\
.menuitem-iconic[' + this.privateAttr + '] {\n\
.menuitem-iconic[' + this.privateAttr + '],\n\
.subviewbutton[' + this.privateAttr + '] {\n\
text-decoration: underline' + important + ';\n\
' + prefix + 'text-decoration-color: -moz-nativehyperlinktext' + important + ';\n\
' + prefix + 'text-decoration-style: dashed' + important + ';\n\
Expand Down

0 comments on commit 115c780

Please sign in to comment.