[empathy: 17/28] Toggle the expander on row double click



commit 14ccd126b65741b4e5f9575cc0ddd6d371d40b9d
Author: Danielle Madeley <danielle madeley collabora co uk>
Date:   Tue Aug 9 14:32:30 2011 +1000

    Toggle the expander on row double click

 data/empathy-log-window.html |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/data/empathy-log-window.html b/data/empathy-log-window.html
index 034c930..987c07a 100644
--- a/data/empathy-log-window.html
+++ b/data/empathy-log-window.html
@@ -71,7 +71,7 @@ function getToggle(node)
   return filterNodes(node, 'SPAN')[0];
 }
 
-function toggleExpander(node, open)
+function setExpander(node, open)
 {
   var toggle = getToggle(node);
   var display;
@@ -102,7 +102,7 @@ function expandAll()
 
       for (var i = 0; i < nodes.length; i++)
         {
-          toggleExpander(nodes[i], true);
+          setExpander(nodes[i], true);
 
           expandAllRecurse(nodes[i]);
         }
@@ -158,17 +158,20 @@ function insertRow (path, text, icon, date_)
   toggle.setAttribute('class', 'closed');
   toggle.style.display = 'none';
 
-  toggle.onclick = function (e)
+  var contents = document.createElement('p');
+  newnode.appendChild(contents);
+  setContent(contents, text, icon, date_);
+
+  function toggleExpander (e)
     {
       if (toggle.getAttribute('class') == 'closed')
-        toggleExpander(newnode, true);
+        setExpander(newnode, true);
       else
-        toggleExpander(newnode, false);
+        setExpander(newnode, false);
     };
   
-  var contents = document.createElement('p');
-  newnode.appendChild(contents);
-  setContent(contents, text, icon, date_);
+  toggle.onclick = toggleExpander;
+  contents.ondblclick = toggleExpander;
 
   // if the node is not a top-level node, hide it
   if (parentnode != treeview)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]