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 a9481a2d94

View file

@ -905,6 +905,7 @@ ContainerWindow.prototype = {
this._configurePlusButtonMenu(), this._configurePlusButtonMenu(),
this._configureActiveTab(), this._configureActiveTab(),
this._configureFileMenu(), this._configureFileMenu(),
this._configureAllTabsMenu(),
this._configureContextMenu(), this._configureContextMenu(),
this._configureTabStyle(), 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() { _configureContextMenu() {
return this._configureMenu("context-openlinkinusercontext-menu", return this._configureMenu("context-openlinkinusercontext-menu",
() => { () => {
@ -1054,7 +1065,6 @@ ContainerWindow.prototype = {
// Generic menu configuration. // Generic menu configuration.
_configureMenu(menuId, excludedContainerCb, clickCb) { _configureMenu(menuId, excludedContainerCb, clickCb) {
const menu = this._window.document.getElementById(menuId); const menu = this._window.document.getElementById(menuId);
this._disableElement(menu);
if (!this._disableElement(menu)) { if (!this._disableElement(menu)) {
// Delete stale menu that isn't native elements // Delete stale menu that isn't native elements
while (menu.firstChild) { while (menu.firstChild) {
@ -1148,6 +1158,7 @@ ContainerWindow.prototype = {
this._shutdownPlusButtonMenu(); this._shutdownPlusButtonMenu();
this._shutdownFileMenu(); this._shutdownFileMenu();
this._shutdownAllTabsMenu();
this._shutdownContextMenu(); this._shutdownContextMenu();
}, },
@ -1169,6 +1180,10 @@ ContainerWindow.prototype = {
this._shutdownMenu("menu_newUserContext"); this._shutdownMenu("menu_newUserContext");
}, },
_shutdownAllTabsMenu() {
this._shutdownMenu("alltabs_containersTab");
},
_shutdownContextMenu() { _shutdownContextMenu() {
this._shutdownMenu("context-openlinkinusercontext-menu"); this._shutdownMenu("context-openlinkinusercontext-menu");
}, },