Issue #11 - Showing all the hidden tabs before opening a new one

This commit is contained in:
baku 2017-01-09 09:36:58 +01:00
parent 4b92b775b4
commit f87eece6cc

View file

@ -31,6 +31,7 @@ function hideContainerTabs(userContextId) {
} }
function showContainerTabs(userContextId) { function showContainerTabs(userContextId) {
return new Promise((resolve, reject) => {
const hideorshowIcon = document.querySelector(`#uci-${userContextId}-hideorshow-icon`); const hideorshowIcon = document.querySelector(`#uci-${userContextId}-hideorshow-icon`);
browser.runtime.sendMessage({ browser.runtime.sendMessage({
@ -46,6 +47,7 @@ function showContainerTabs(userContextId) {
}); });
}).then(() => { }).then(() => {
hideorshowIcon.src = CONTAINER_HIDE_SRC; hideorshowIcon.src = CONTAINER_HIDE_SRC;
}).then(resolve);
}); });
} }
@ -130,12 +132,14 @@ browser.runtime.sendMessage({method: 'queryIdentities'}).then(identities=> {
} }
}); });
} else if (e.target.matches('.newtab-icon')) { } else if (e.target.matches('.newtab-icon')) {
showContainerTabs(userContextId).then(() => {
browser.runtime.sendMessage({ browser.runtime.sendMessage({
method: 'openTab', method: 'openTab',
userContextId: userContextId}) userContextId: userContextId})
.then(() => { .then(() => {
window.close(); window.close();
}); });
});
} }
}); });
}); });