Skip to content

Commit

Permalink
Implement very basic support for tab hidding (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
Croydon committed Apr 28, 2018
1 parent 1f9a120 commit 75d2aa2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ var VerticalTabsReloaded = class VerticalTabsReloaded
this.update_tab(id, "mutedInfo", tab.mutedInfo);
this.update_tab(id, "audible", tab.audible);
this.update_tab(id, "discarded", tab.discarded);
this.update_tab(id, "hidden", tab.hidden);

document.getElementById(`tab-close-button-${id}`).addEventListener("click", (e) => { utils.tabs.close(id); e.stopPropagation(); });
document.getElementById(`tab-sound-button-${id}`).addEventListener("click", (e) => { utils.tabs.mute(id); e.stopPropagation(); });
Expand Down Expand Up @@ -453,6 +454,16 @@ var VerticalTabsReloaded = class VerticalTabsReloaded
}
break;

case "hidden":
if(value == true)
{
tabElement.style.display = "none";
}
else
{
tabElement.style.display = "block";
}
break;
// case "index":
// tabElement.setAttribute("data-index", value);
// break;
Expand Down Expand Up @@ -794,6 +805,11 @@ var VerticalTabsReloaded = class VerticalTabsReloaded
{
this.update_tab(tabID, "discarded", changeInfo["discarded"]);
}

if (changeInfo.hasOwnProperty("hidden"))
{
this.update_tab(tabID, "hidden", changeInfo["hidden"]);
}
});

browser.tabs.onMoved.addListener((tabID, moveInfo) =>
Expand Down

0 comments on commit 75d2aa2

Please sign in to comment.