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>

View file

@ -24,3 +24,7 @@ tabs.closeWarningTitle=Confirm close
tabs.closeWarningMultipleTabs=You are about to close %S tabs. Are you sure you want to continue?
tabs.closeButtonMultiple=Close tabs
tabs.closeWarningPromptMe=Warn me when I attempt to close multiple tabs
tabs.muteAudio.tooltip=Mute tab
tabs.unmuteAudio.tooltip=Unmute tab
tabs.unblockAudio.tooltip=Play tab