[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 33/483: Working around warning when cloning radio buttons

David Prévot taffit at moszumanska.debian.org
Thu Jan 22 21:41:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus-element-hiding-helper.

commit 109d3457ddfef88849d8b57380ca7bb66e0e8257
Author: Wladimir Palant <trev at gtchat.de>
Date:   Mon Jan 15 22:46:36 2007 +0000

    Working around warning when cloning radio buttons
    
    --HG--
    extra : convert_revision : svn%3Ad8bf93c1-8190-44a8-bb31-1ea94378a4df/trunk%40633
---
 chrome/content/composer.js  | 22 +++++++++++++++-------
 chrome/content/composer.xul |  4 +---
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/chrome/content/composer.js b/chrome/content/composer.js
index b115525..5047c8f 100644
--- a/chrome/content/composer.js
+++ b/chrome/content/composer.js
@@ -327,9 +327,19 @@ function updateExpression() {
 }
 
 function fillDomains(domainData) {
-  var template = document.getElementById("domain-template");
+  var list = document.getElementById("domainGroup");
+
+  var commandHandler = function() {
+    changeDomain(this);
+  }
+
+  var node = document.createElement("radio");
+  node.setAttribute("label", list.getAttribute("_labelnone"))
+  node.setAttribute("value", "");
+  node.addEventListener("command", commandHandler, false);
   if (domainData.selected == "")
     template.setAttribute("selected", "true");
+  list.appendChild(node);
 
   var parts = domainData.value.split(".");
   if (parts[0] == "")
@@ -338,15 +348,13 @@ function fillDomains(domainData) {
   for (var i = 1; i <= parts.length; i++) {
     var curDomain = parts.slice(parts.length - i).join(".");
 
-    var node = template.cloneNode(true);
-    node.removeAttribute("id");
-    node.setAttribute("label", curDomain);
+    var node = document.createElement("radio");
+    node.setAttribute("label", curDomain)
     node.setAttribute("value", curDomain);
-
+    node.addEventListener("command", commandHandler, false);
     if (domainData.selected == curDomain)
       node.setAttribute("selected", "true");
-
-    template.parentNode.appendChild(node);
+    list.appendChild(node);
   }
 }
 
diff --git a/chrome/content/composer.xul b/chrome/content/composer.xul
index c6496e1..5459dfe 100644
--- a/chrome/content/composer.xul
+++ b/chrome/content/composer.xul
@@ -60,9 +60,7 @@
     <groupbox id="domain" orient="vertical">
       <caption label="&domain.label;"/>
       <scrollbox flex="1" orient="vertical">
-        <radiogroup id="domainGroup">
-          <radio id="domain-template" label="&domain.none.label;" value="" oncommand="changeDomain(this)"/>
-        </radiogroup>
+        <radiogroup id="domainGroup" _labelnone="&domain.none.label;"/>
       </scrollbox>
     </groupbox>
     <groupbox id="attributes" flex="2">

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus-element-hiding-helper.git



More information about the Pkg-mozext-commits mailing list