Merge pull request #203 from bakulf/allTabs

Styling all-tabs menu #181
This commit is contained in:
Andrea Marchesini 2017-02-18 15:43:57 +01:00 committed by GitHub
commit ec36c06f2e

View file

@ -905,6 +905,7 @@ ContainerWindow.prototype = {
this._configurePlusButtonMenu(),
this._configureActiveTab(),
this._configureFileMenu(),
this._configureAllTabsMenu(),
this._configureContextMenu(),
this._configureTabStyle(),
]);
@ -1036,6 +1037,16 @@ ContainerWindow.prototype = {
});
},
_configureAllTabsMenu() {
return this._configureMenu("alltabs_containersTab", null, e => {
const userContextId = parseInt(e.target.getAttribute("data-usercontextid"), 10);
ContainerService.openTab({
userContextId: userContextId,
source: "alltabs-menu"
});
});
},
_configureContextMenu() {
return this._configureMenu("context-openlinkinusercontext-menu",
() => {
@ -1054,7 +1065,6 @@ ContainerWindow.prototype = {
// Generic menu configuration.
_configureMenu(menuId, excludedContainerCb, clickCb) {
const menu = this._window.document.getElementById(menuId);
this._disableElement(menu);
if (!this._disableElement(menu)) {
// Delete stale menu that isn't native elements
while (menu.firstChild) {
@ -1148,6 +1158,7 @@ ContainerWindow.prototype = {
this._shutdownPlusButtonMenu();
this._shutdownFileMenu();
this._shutdownAllTabsMenu();
this._shutdownContextMenu();
},
@ -1169,6 +1180,10 @@ ContainerWindow.prototype = {
this._shutdownMenu("menu_newUserContext");
},
_shutdownAllTabsMenu() {
this._shutdownMenu("alltabs_containersTab");
},
_shutdownContextMenu() {
this._shutdownMenu("context-openlinkinusercontext-menu");
},