newtab icon to open new container tab from pop-up

This commit is contained in:
groovecoder 2017-01-03 10:43:21 -06:00
parent 50419d6bb1
commit 44b85c6818
3 changed files with 18 additions and 16 deletions

View file

@ -17,7 +17,7 @@ table {
padding: 0;
}
.header-icon {
.icon {
max-width: 16px;
height: 16px;
margin: 4px;
@ -39,12 +39,6 @@ table.unstriped tbody tr {
height: 32px;
}
.hideorshow-icon {
max-width: 16px;
height: 16px;
margin: 4px;
}
.edit-identities {
background: #DCDBDC;
}

View file

@ -51,16 +51,21 @@ browser.runtime.sendMessage({method: 'query'}).then(identities=> {
}
const identityRow = `
<tr data-identity-cookie-store-id="${identity.cookieStoreId}" >
<td><div class="userContext-icon"
data-identity-icon="${identity.icon}"
data-identity-color="${identity.color}"
></div></td>
<td>
<div class="userContext-icon"
data-identity-icon="${identity.icon}"
data-identity-color="${identity.color}">
</div>
</td>
<td>${identity.name}</td>
<td class="newtab">
<img src="/img/container-add.svg" class="icon newtab-icon" />
</td>
<td class="hideorshow" >
<img
data-identity-cookie-store-id="${identity.cookieStoreId}"
id="${identity.cookieStoreId}-hideorshow-icon"
class="hideorshow-icon"
class="icon hideorshow-icon"
src="${hideOrShowIconSrc}"
/>
</td>
@ -74,9 +79,9 @@ browser.runtime.sendMessage({method: 'query'}).then(identities=> {
rows.forEach(row=> {
row.addEventListener('click', e=> {
if (e.target.matches('.hideorshow-icon')) {
const containerId = e.target.dataset.identityCookieStoreId;
const containerId = e.target.parentElement.parentElement.dataset.identityCookieStoreId;
if (e.target.matches('.hideorshow-icon')) {
browser.runtime.sendMessage({method: 'getIdentitiesState'}).then(identitiesState=> {
if (identitiesState[containerId].hiddenTabUrls.length) {
showContainerTabs(containerId);
@ -84,6 +89,9 @@ browser.runtime.sendMessage({method: 'query'}).then(identities=> {
hideContainerTabs(containerId);
}
});
} else if (e.target.matches('.newtab-icon')) {
browser.tabs.create({cookieStoreId: containerId});
window.close();
}
});
});

View file

@ -8,13 +8,13 @@
<body>
<div class="row popup-bumper">
<div class="small-2 columns header-column">
<img alt="Containers icon" class="header-icon" src="/img/container-site-d-24.png">
<img alt="Containers icon" class="icon" src="/img/container-site-d-24.png">
</div>
<div class="small-8 columns">
<h4>Containers</h4>
</div>
<div class="small-2 columns header-column">
<a id="sort-containers-link"><img alt="Sort Containers" class="header-icon" src="/img/container-sort.svg"></a>
<a id="sort-containers-link"><img alt="Sort Containers" class="icon" src="/img/container-sort.svg"></a>
</div>
</div>
<table class="unstriped hover">