Issue #102 - Remove/Create/Update propagation in the '+' menu (no color/name in the awesomebar yet)

This commit is contained in:
baku 2017-01-21 22:11:35 +01:00
parent e4b6b6cb7f
commit 3db007a3ea

View file

@ -98,9 +98,7 @@ const ContainerService = {
// Modify CSS and other stuff for each window.
for (let window of windows.browserWindows) { // eslint-disable-line prefer-const
this.configureWindow(viewFor(window));
}
this.configureWindows();
windows.browserWindows.on("open", window => {
this.configureWindow(viewFor(window));
@ -441,6 +439,8 @@ const ContainerService = {
openTabs: 0
};
this._refreshNeeded();
return Promise.resolve(this._convert(identity));
},
@ -457,11 +457,14 @@ const ContainerService = {
}
// 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.icon,
identity.color));
identity.color);
this._refreshNeeded();
return Promise.resolve(updated);
},
removeIdentity(args) {
@ -473,11 +476,20 @@ const ContainerService = {
tab.close();
});
return Promise.resolve(ContextualIdentityService.remove(args.userContextId));
const removed = ContextualIdentityService.remove(args.userContextId);
this._refreshNeeded();
return Promise.resolve(removed);
},
// Styling the window
configureWindows() {
for (let window of windows.browserWindows) { // eslint-disable-line prefer-const
this.configureWindow(viewFor(window));
}
},
configureWindow(window) {
const id = windowUtils.getInnerId(window);
if (!(id in this._windowMap)) {
@ -492,6 +504,11 @@ const ContainerService = {
delete this._windowMap[id];
},
_refreshNeeded() {
// FIXME: color/name propagation
this.configureWindows();
},
_hideAllPanels() {
for (let id in this._windowMap) { // eslint-disable-line prefer-const
this._windowMap[id].hidePanel();