The context menu must be recreated each time we change tab - issue #289
This commit is contained in:
parent
d66c3b8576
commit
9806087e98
1 changed files with 23 additions and 6 deletions
29
index.js
29
index.js
|
@ -228,15 +228,16 @@ const ContainerService = {
|
||||||
tabs.on("activate", tab => {
|
tabs.on("activate", tab => {
|
||||||
this._hideAllPanels();
|
this._hideAllPanels();
|
||||||
this._restyleActiveTab(tab).catch(() => {});
|
this._restyleActiveTab(tab).catch(() => {});
|
||||||
|
this._configureActiveWindows();
|
||||||
this._remapTab(tab);
|
this._remapTab(tab);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Modify CSS and other stuff for each window.
|
// Modify CSS and other stuff for each window.
|
||||||
|
|
||||||
this.configureWindows().catch(() => {});
|
this._configureWindows().catch(() => {});
|
||||||
|
|
||||||
windows.browserWindows.on("open", window => {
|
windows.browserWindows.on("open", window => {
|
||||||
this.configureWindow(viewFor(window)).catch(() => {});
|
this._configureWindow(viewFor(window)).catch(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
windows.browserWindows.on("close", window => {
|
windows.browserWindows.on("close", window => {
|
||||||
|
@ -934,18 +935,30 @@ const ContainerService = {
|
||||||
|
|
||||||
// Styling the window
|
// Styling the window
|
||||||
|
|
||||||
configureWindows() {
|
_configureWindows() {
|
||||||
const promises = [];
|
const promises = [];
|
||||||
for (let window of windows.browserWindows) { // eslint-disable-line prefer-const
|
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);
|
return Promise.all(promises);
|
||||||
},
|
},
|
||||||
|
|
||||||
configureWindow(window) {
|
_configureWindow(window) {
|
||||||
return this._getOrCreateContainerWindow(window).configure();
|
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) {
|
closeWindow(window) {
|
||||||
this._windowMap.delete(window);
|
this._windowMap.delete(window);
|
||||||
},
|
},
|
||||||
|
@ -1136,11 +1149,15 @@ ContainerWindow.prototype = {
|
||||||
this._configureActiveTab(),
|
this._configureActiveTab(),
|
||||||
this._configureFileMenu(),
|
this._configureFileMenu(),
|
||||||
this._configureAllTabsMenu(),
|
this._configureAllTabsMenu(),
|
||||||
this._configureContextMenu(),
|
|
||||||
this._configureTabStyle(),
|
this._configureTabStyle(),
|
||||||
|
this.configureActive(),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
configureActive() {
|
||||||
|
return this._configureContextMenu();
|
||||||
|
},
|
||||||
|
|
||||||
handleEvent(e) {
|
handleEvent(e) {
|
||||||
let el = e.target;
|
let el = e.target;
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue