Issue #638 - Part 2: Add tooltip to mute/unmute buttons

This commit is contained in:
FranklinDM 2018-11-16 21:40:17 +08:00 • committed by Roy Tam
commit d6e21c05d3
2 changed files with 23 additions and 3 deletions

View file

@ -3084,9 +3084,25 @@
event.preventDefault();
return;
}
event.target.setAttribute("label", tab.mOverCloseButton ?
tab.getAttribute("closetabtext") :
tab.getAttribute("label"));
var stringID, label;
if (tab.mOverCloseButton) {
stringID = "tabs.closeTab";
} else if (tab._overPlayingIcon) {
if (tab.linkedBrowser.audioBlocked) {
stringID = "tabs.unblockAudio.tooltip";
} else {
stringID = tab.linkedBrowser.audioMuted ?
"tabs.unmuteAudio.tooltip" :
"tabs.muteAudio.tooltip";
}
} else {
label = tab.getAttribute("label");
}
if (stringID && !label) {
label = this.mStringBundle.getString(stringID);
}
event.target.setAttribute("label", label);
]]></body>
</method>