[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 149/483: Make use of horizontal scrolling in trees (Gecko 1.9+), show id and class columns by default

David Prévot taffit at moszumanska.debian.org
Thu Jan 22 21:41:35 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 3171c3435b2dfc78d76fe6a5a6322f0ed52298f8
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Mon Dec 15 12:46:34 2008 +0100

    Make use of horizontal scrolling in trees (Gecko 1.9+), show id and class columns by default
---
 chrome/content/composer.js  | 26 ++++++++++++++++++++++++++
 chrome/content/composer.xul | 11 ++++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/chrome/content/composer.js b/chrome/content/composer.js
index ca0e3ba..d5f7e20 100644
--- a/chrome/content/composer.js
+++ b/chrome/content/composer.js
@@ -150,6 +150,32 @@ function init() {
   doc = element.ownerDocument;
   var wnd = doc.defaultView;
 
+  var geckoVersion = "0.0";
+  if ("nsIXULAppInfo" in  Components.interfaces)
+      geckoVersion = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo).platformVersion;
+  var versionComparator = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
+                                    .createInstance(Components.interfaces.nsIVersionComparator);
+  if (versionComparator.compare(geckoVersion, "1.9") < 0)
+  {
+    // Gecko 1.8 does not support horizontal scrolling for trees,
+    // change width attribute into flex for tree columns.
+    var nodeCol = document.getElementById("nodes-tree-node");
+    nodeCol.setAttribute("flex", "2");
+    nodeCol.nextSibling.removeAttribute("resizeafter");
+
+    var idCol = document.getElementById("nodes-tree-id");
+    idCol.setAttribute("flex", "1");
+    if (!idCol.hasAttribute("hidden"))
+      idCol.setAttribute("hidden", "true");
+    idCol.nextSibling.removeAttribute("resizeafter");
+
+    var classCol = document.getElementById("nodes-tree-class");
+    classCol.setAttribute("flex", "1");
+    if (!classCol.hasAttribute("hidden"))
+      classCol.setAttribute("hidden", "true");
+    classCol.parentNode.removeChild(classCol.nextSibling);
+  }
+
   nodeData = new NodeData(element);
   nodeData.tagName.checked = true;
   if (nodeData.attributes.length > 0) {
diff --git a/chrome/content/composer.xul b/chrome/content/composer.xul
index e5f3587..73de266 100644
--- a/chrome/content/composer.xul
+++ b/chrome/content/composer.xul
@@ -68,11 +68,12 @@
       <hbox flex="1">
         <tree id="nodes-tree" width="200" seltype="single" enableColumnDrag="true" onselect="updateNodeSelection()" persist="width">
           <treecols>
-            <treecol id="nodes-tree-node" label="&nodes-tree.node.label;" primary="true" flex="2" persist="width ordinal hidden"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="nodes-tree-id" label="&nodes-tree.id.label;" flex="1" hidden="true" persist="width ordinal hidden"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="nodes-tree-class" label="&nodes-tree.class.label;" flex="1" hidden="true" persist="width ordinal hidden"/>
+            <treecol id="nodes-tree-node" label="&nodes-tree.node.label;" primary="true" width="200" persist="width ordinal hidden"/>
+            <splitter class="tree-splitter" resizeafter="grow"/>
+            <treecol id="nodes-tree-id" label="&nodes-tree.id.label;" width="80" persist="width ordinal hidden"/>
+            <splitter class="tree-splitter" resizeafter="grow"/>
+            <treecol id="nodes-tree-class" label="&nodes-tree.class.label;" width="80" persist="width ordinal hidden"/>
+            <splitter class="tree-splitter" resizeafter="grow"/>
           </treecols>
           <treechildren id="nodes-tree-children"/>
         </tree>

-- 
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