From 214a83deda02732f9aee7237898e9f521741a439 Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Thu, 22 Jun 2017 12:09:32 +0100 Subject: [PATCH] Adding tooltips. Fixes #615. Fixes #609. Fixes #112 --- .gitignore | 1 + index.js | 1 + webextension/js/popup.js | 10 ++++++---- webextension/popup.html | 6 +++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 6ff00a9..5e16ffe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +package-lock.json node_modules README.html *.xpi diff --git a/index.js b/index.js index da9cf8d..4ebce44 100644 --- a/index.js +++ b/index.js @@ -1213,6 +1213,7 @@ ContainerWindow.prototype = { const menuItemElement = this._window.document.createElementNS(XUL_NS, "menuitem"); this._panelElement.appendChild(menuItemElement); menuItemElement.className = "menuitem-iconic"; + menuItemElement.setAttribute("tooltiptext", identity.name); menuItemElement.setAttribute("label", identity.name); menuItemElement.setAttribute("data-usercontextid", identity.userContextId); menuItemElement.setAttribute("data-identity-icon", identity.icon); diff --git a/webextension/js/popup.js b/webextension/js/popup.js index 51c6cd6..6ec07ad 100644 --- a/webextension/js/popup.js +++ b/webextension/js/popup.js @@ -520,7 +520,9 @@ Logic.registerPanel(P_CONTAINERS_LIST, { context.classList.add("userContext-wrapper", "open-newtab", "clickable"); manage.classList.add("show-tabs", "pop-button"); + manage.title = escaped`View ${identity.name} container`; context.setAttribute("tabindex", "0"); + context.title = escaped`Create ${identity.name} tab`; context.innerHTML = escaped`
- ${tab.title}`; + ${tab.title}`; tr.querySelector("td").appendChild(Utils.createFavIconElement(tab.favicon)); // On click, we activate this tab. But only if this tab is active. @@ -741,15 +743,15 @@ Logic.registerPanel(P_CONTAINERS_EDIT, { src="/img/container-edit.svg" class="pop-button-image" /> - + `; tr.querySelector(".container-name").textContent = identity.name; - tr.querySelector(".edit-container .pop-button-image").setAttribute("title", `Edit ${identity.name} container`); - tr.querySelector(".remove-container .pop-button-image").setAttribute("title", `Edit ${identity.name} container`); + tr.querySelector(".edit-container").setAttribute("title", `Edit ${identity.name} container`); + tr.querySelector(".remove-container").setAttribute("title", `Delete ${identity.name} container`); Logic.addEnterHandler(tr, e => { diff --git a/webextension/popup.html b/webextension/popup.html index 40e52e1..bfca0ec 100644 --- a/webextension/popup.html +++ b/webextension/popup.html @@ -73,7 +73,7 @@
@@ -84,8 +84,8 @@ - - Create new container icon + + Create new container icon