From bd83d65da6e07aa3ab94a7267eda4b44a8552754 Mon Sep 17 00:00:00 2001 From: Jason Barnabe Date: Tue, 17 Feb 2015 13:01:15 -0600 Subject: [PATCH] Add enable/disable links back as hidden #17 --- popup.html | 4 ++++ popup.js | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/popup.html b/popup.html index 062a8fcd..a66d0de4 100644 --- a/popup.html +++ b/popup.html @@ -35,6 +35,10 @@ #unavailable { display: none; } + /* Never shown, but can be enabled with a style */ + .enable, .disable { + display: none; + } diff --git a/popup.js b/popup.js index e278788e..3d71e765 100644 --- a/popup.js +++ b/popup.js @@ -1,5 +1,5 @@ var styleTemplate = document.createElement("div"); -styleTemplate.innerHTML = "
" + t('editStyleLabel') + " " + t('deleteStyleLabel') + "
"; +styleTemplate.innerHTML = "
" + t('enableStyleLabel') + " " + t('disableStyleLabel') + " " + t('editStyleLabel') + " " + t('deleteStyleLabel') + "
"; var writeStyleTemplate = document.createElement("a"); writeStyleTemplate.className = "write-style-link"; @@ -78,6 +78,8 @@ function createStyleElement(style) { styleName.addEventListener("click", function() { enable(event, !event.target.previousSibling.checked); }, false); // clicking the checkbox will toggle it, and this will run after that happens checkbox.addEventListener("click", function() { enable(event, event.target.checked); }, false); + e.querySelector(".enable").addEventListener("click", function() { enable(event, true); }, false); + e.querySelector(".disable").addEventListener("click", function() { enable(event, false); }, false); e.querySelector(".delete").addEventListener("click", function() { doDelete(event, false); }, false); return e;