Merge b8b97cfd15
into bbfa70f54a
This commit is contained in:
commit
821bdbb2d0
1 changed files with 25 additions and 1 deletions
26
index.js
26
index.js
|
@ -101,6 +101,7 @@ const ContainerService = {
|
||||||
++this._identitiesState[userContextId].openTabs;
|
++this._identitiesState[userContextId].openTabs;
|
||||||
}
|
}
|
||||||
this._hideAllPanels();
|
this._hideAllPanels();
|
||||||
|
this._restyleTab(tab);
|
||||||
});
|
});
|
||||||
|
|
||||||
tabs.on("close", tab => {
|
tabs.on("close", tab => {
|
||||||
|
@ -579,6 +580,21 @@ const ContainerService = {
|
||||||
indicator.style.listStyleImage = "";
|
indicator.style.listStyleImage = "";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_restyleTab(tab) {
|
||||||
|
if (!tab) {
|
||||||
|
return Promise.resolve(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
const userContextId = ContainerService._getUserContextIdFromTab(tab);
|
||||||
|
return ContainerService.getIdentity({userContextId}).then(identity => {
|
||||||
|
if (!identity) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: here the magic :)
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -604,9 +620,9 @@ ContainerWindow.prototype = {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
this._configurePlusButtonMenu(),
|
this._configurePlusButtonMenu(),
|
||||||
this._configureActiveTab(),
|
this._configureActiveTab(),
|
||||||
|
this._configureTabs(),
|
||||||
this._configureFileMenu(),
|
this._configureFileMenu(),
|
||||||
this._configureContextMenu(),
|
this._configureContextMenu(),
|
||||||
// TODO: this should change the decoration of the tab.
|
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -692,6 +708,14 @@ ContainerWindow.prototype = {
|
||||||
return ContainerService._restyleActiveTab(tab);
|
return ContainerService._restyleActiveTab(tab);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_configureTabs() {
|
||||||
|
let promises = [];
|
||||||
|
for (let tab of modelFor(this._window).tabs) { // eslint-disable-line prefer-const
|
||||||
|
promises.push(ContainerService._restyleTab(tab));
|
||||||
|
}
|
||||||
|
return Promise.all(promises);
|
||||||
|
},
|
||||||
|
|
||||||
_configureFileMenu() {
|
_configureFileMenu() {
|
||||||
return this._configureMenu("menu_newUserContext", null, e => {
|
return this._configureMenu("menu_newUserContext", null, e => {
|
||||||
const userContextId = parseInt(e.target.getAttribute("data-usercontextid"), 10);
|
const userContextId = parseInt(e.target.getAttribute("data-usercontextid"), 10);
|
||||||
|
|
Loading…
Add table
Reference in a new issue