Commit dbe061e3 authored by Mohd Umar Alam's avatar Mohd Umar Alam
Browse files

Bug 1533533-Add a label to hide synced tabs sidebar when it is shown r=sfoster,jaws,flod

Differential Revision: https://phabricator.services.mozilla.com/D28177

--HG--
extra : moz-landing-system : lando
parent 8ac88db4
......@@ -24,6 +24,7 @@ var SidebarUI = {
url: "chrome://browser/content/places/historySidebar.xul",
menuId: "menu_historySidebar",
buttonId: "sidebar-switcher-history",
triggerButtonId: "appMenuViewHistorySidebar",
}],
["viewTabsSidebar", {
title: document.getElementById("sidebar-switcher-tabs")
......@@ -31,6 +32,7 @@ var SidebarUI = {
url: "chrome://browser/content/syncedtabs/sidebar.xhtml",
menuId: "menu_tabsSidebar",
buttonId: "sidebar-switcher-tabs",
triggerButtonId: "PanelUI-remotetabs-view-sidebar",
}],
]);
},
......@@ -528,15 +530,24 @@ var SidebarUI = {
* none if the argument is an empty string.
*/
selectMenuItem(commandID) {
for (let [id, {menuId, buttonId}] of this.sidebars) {
for (let [id, {menuId, buttonId, triggerButtonId}] of this.sidebars) {
let menu = document.getElementById(menuId);
let button = document.getElementById(buttonId);
let triggerbutton = triggerButtonId && document.getElementById(triggerButtonId);
if (id == commandID) {
menu.setAttribute("checked", "true");
button.setAttribute("checked", "true");
if (triggerbutton) {
triggerbutton.setAttribute("checked", "true");
updateToggleControlLabel(triggerbutton);
}
} else {
menu.removeAttribute("checked");
button.removeAttribute("checked");
if (triggerbutton) {
triggerbutton.removeAttribute("checked");
updateToggleControlLabel(triggerbutton);
}
}
}
},
......
......@@ -403,7 +403,8 @@
<panelview id="PanelUI-history" flex="1">
<vbox class="panel-subview-body">
<toolbarbutton id="appMenuViewHistorySidebar"
label="&appMenuHistory.viewSidebar.label;"
label-checked="&appMenuHistory.hideSidebar.label;"
label-unchecked="&appMenuHistory.viewSidebar.label;"
type="checkbox"
class="subviewbutton subviewbutton-iconic"
key="key_gotoHistory"
......@@ -454,8 +455,9 @@
<vbox id="PanelUI-remotetabs-buttons">
<toolbarbutton id="PanelUI-remotetabs-view-sidebar"
class="subviewbutton subviewbutton-iconic"
label="&appMenuRemoteTabs.sidebar.label;"
oncommand="SidebarUI.toggle('viewTabsSidebar');"/>
label-checked="&appMenuRemoteTabs.hidesidebar.label;"
label-unchecked="&appMenuRemoteTabs.sidebar.label;"
oncommand="SidebarUI.toggle('viewTabsSidebar',this);"/>
<toolbarbutton id="PanelUI-remotetabs-view-managedevices"
class="subviewbutton subviewbutton-iconic"
label="&appMenuRemoteTabs.managedevices.label;"
......
......@@ -377,6 +377,7 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY appMenuHistory.clearRecent.label "Clear Recent History…">
<!ENTITY appMenuHistory.restoreSession.label "Restore Previous Session">
<!ENTITY appMenuHistory.viewSidebar.label "View History Sidebar">
<!ENTITY appMenuHistory.hideSidebar.label "Hide History Sidebar">
<!ENTITY appMenuHistory.recentHistory.label "Recent History">
<!ENTITY appMenuHelp.label "Help">
......@@ -405,6 +406,7 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY appMenuRemoteTabs.signin.label "Sign in to Sync">
<!ENTITY appMenuRemoteTabs.managedevices.label "Manage Devices…">
<!ENTITY appMenuRemoteTabs.sidebar.label "View Synced Tabs Sidebar">
<!ENTITY appMenuRemoteTabs.hidesidebar.label "Hide Synced Tabs Sidebar">
<!ENTITY appMenuRemoteTabs.connectdevice.label "Connect Another Device">
<!ENTITY appMenuRecentHighlights.label "Recent Highlights">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment