The context menu must be recreated each time we change tab - issue #289

This commit is contained in:
baku 2017-02-28 18:39:34 +01:00
parent d66c3b8576
commit 9806087e98

View file

@ -228,15 +228,16 @@ const ContainerService = {
tabs.on("activate", tab => {
this._hideAllPanels();
this._restyleActiveTab(tab).catch(() => {});
this._configureActiveWindows();
this._remapTab(tab);
});
// Modify CSS and other stuff for each window.
this.configureWindows().catch(() => {});
this._configureWindows().catch(() => {});
windows.browserWindows.on("open", window => {
this.configureWindow(viewFor(window)).catch(() => {});
this._configureWindow(viewFor(window)).catch(() => {});
});
windows.browserWindows.on("close", window => {
@ -934,18 +935,30 @@ const ContainerService = {
// Styling the window
configureWindows() {
_configureWindows() {
const promises = [];
for (let window of windows.browserWindows) { // eslint-disable-line prefer-const
promises.push(this.configureWindow(viewFor(window)));
promises.push(this._configureWindow(viewFor(window)));
}
return Promise.all(promises);
},
configureWindow(window) {
_configureWindow(window) {
return this._getOrCreateContainerWindow(window).configure();
},
_configureActiveWindows() {
const promises = [];
for (let window of windows.browserWindows) { // eslint-disable-line prefer-const
promises.push(this._configureActiveWindow(viewFor(window)));
}
return Promise.all(promises);
},
_configureActiveWindow(window) {
return this._getOrCreateContainerWindow(window).configureActive();
},
closeWindow(window) {
this._windowMap.delete(window);
},
@ -1136,11 +1149,15 @@ ContainerWindow.prototype = {
this._configureActiveTab(),
this._configureFileMenu(),
this._configureAllTabsMenu(),
this._configureContextMenu(),
this._configureTabStyle(),
this.configureActive(),
]);
},
configureActive() {
return this._configureContextMenu();
},
handleEvent(e) {
let el = e.target;
switch (e.type) {