From 1c75a5876abd7845e61a6ce86b1edaf0822ee281 Mon Sep 17 00:00:00 2001 From: Liam Best Date: Tue, 24 Sep 2019 16:03:04 +1000 Subject: [PATCH 1/3] Add inactive event for the tab being made inactive --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 7a81246..0ba2357 100644 --- a/index.js +++ b/index.js @@ -284,6 +284,7 @@ class Tab extends EventEmitter { if (activeTab) { activeTab.tab.classList.remove("active"); activeTab.webview.classList.remove("visible"); + activeTab.emit("inactive", activeTab); } TabGroupPrivate.setActiveTab.bind(this.tabGroup)(this); this.tab.classList.add("active"); From 75b215b2636c71ed6b7dd814fbf1ace8aa796ae8 Mon Sep 17 00:00:00 2001 From: Liam Best Date: Tue, 24 Sep 2019 16:09:53 +1000 Subject: [PATCH 2/3] Also update README for new event --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 93c2fd5..4d9b0e4 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,7 @@ The following events are available: * `tab.on("title-changed", (title, tab) => { ... });` * `tab.on("icon-changed", (icon, tab) => { ... });` * `tab.on("active", (tab) => { ... });` +* `tab.on("inactive", (tab) => { ... });` * `tab.on("visible", (tab) => { ... });` * `tab.on("hidden", (tab) => { ... });` * `tab.on("flash", (tab) => { ... });` From 57e3bf6f9208e3fd4b67a4cba7adb1477b378dab Mon Sep 17 00:00:00 2001 From: Liam Best Date: Thu, 26 Sep 2019 15:51:50 +1000 Subject: [PATCH 3/3] Add a title to the span for hover --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 0ba2357..8d088cf 100644 --- a/index.js +++ b/index.js @@ -181,6 +181,7 @@ class Tab extends EventEmitter { if (this.isClosed) return; let span = this.tabElements.title; span.innerHTML = title; + span.title = title; this.title = title; this.emit("title-changed", title, this); return this; @@ -418,3 +419,4 @@ const TabPrivate = { }; module.exports = TabGroup; +