Issue #102 - Remove/Create/Update propagation in the '+' menu (no color/name in the awesomebar yet)
This commit is contained in:
parent
e4b6b6cb7f
commit
3db007a3ea
1 changed files with 26 additions and 9 deletions
35
index.js
35
index.js
|
@ -98,9 +98,7 @@ const ContainerService = {
|
||||||
|
|
||||||
// Modify CSS and other stuff for each window.
|
// Modify CSS and other stuff for each window.
|
||||||
|
|
||||||
for (let window of windows.browserWindows) { // eslint-disable-line prefer-const
|
this.configureWindows();
|
||||||
this.configureWindow(viewFor(window));
|
|
||||||
}
|
|
||||||
|
|
||||||
windows.browserWindows.on("open", window => {
|
windows.browserWindows.on("open", window => {
|
||||||
this.configureWindow(viewFor(window));
|
this.configureWindow(viewFor(window));
|
||||||
|
@ -441,6 +439,8 @@ const ContainerService = {
|
||||||
openTabs: 0
|
openTabs: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this._refreshNeeded();
|
||||||
|
|
||||||
return Promise.resolve(this._convert(identity));
|
return Promise.resolve(this._convert(identity));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -457,11 +457,14 @@ const ContainerService = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: icon and color conversion based on FF version.
|
// FIXME: icon and color conversion based on FF version.
|
||||||
// FIXME: color/name update propagation
|
|
||||||
return Promise.resolve(ContextualIdentityService.update(args.userContextId,
|
const updated = ContextualIdentityService.update(args.userContextId,
|
||||||
identity.name,
|
identity.name,
|
||||||
identity.icon,
|
identity.icon,
|
||||||
identity.color));
|
identity.color);
|
||||||
|
|
||||||
|
this._refreshNeeded();
|
||||||
|
return Promise.resolve(updated);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeIdentity(args) {
|
removeIdentity(args) {
|
||||||
|
@ -473,11 +476,20 @@ const ContainerService = {
|
||||||
tab.close();
|
tab.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.resolve(ContextualIdentityService.remove(args.userContextId));
|
const removed = ContextualIdentityService.remove(args.userContextId);
|
||||||
|
|
||||||
|
this._refreshNeeded();
|
||||||
|
return Promise.resolve(removed);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Styling the window
|
// Styling the window
|
||||||
|
|
||||||
|
configureWindows() {
|
||||||
|
for (let window of windows.browserWindows) { // eslint-disable-line prefer-const
|
||||||
|
this.configureWindow(viewFor(window));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
configureWindow(window) {
|
configureWindow(window) {
|
||||||
const id = windowUtils.getInnerId(window);
|
const id = windowUtils.getInnerId(window);
|
||||||
if (!(id in this._windowMap)) {
|
if (!(id in this._windowMap)) {
|
||||||
|
@ -492,6 +504,11 @@ const ContainerService = {
|
||||||
delete this._windowMap[id];
|
delete this._windowMap[id];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_refreshNeeded() {
|
||||||
|
// FIXME: color/name propagation
|
||||||
|
this.configureWindows();
|
||||||
|
},
|
||||||
|
|
||||||
_hideAllPanels() {
|
_hideAllPanels() {
|
||||||
for (let id in this._windowMap) { // eslint-disable-line prefer-const
|
for (let id in this._windowMap) { // eslint-disable-line prefer-const
|
||||||
this._windowMap[id].hidePanel();
|
this._windowMap[id].hidePanel();
|
||||||
|
|
Loading…
Add table
Reference in a new issue