myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r487898 - /myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tree.js
Date Sat, 16 Dec 2006 21:38:16 GMT
Author: lofwyr
Date: Sat Dec 16 13:38:15 2006
New Revision: 487898

URL: http://svn.apache.org/viewvc?view=rev&rev=487898
Log:
fixes in menu mode of the tree: 
1. toggle-icon not toggling
2. toggle-icon too low in tree depth > 2

Modified:
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tree.js

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tree.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tree.js?view=diff&rev=487898&r1=487897&r2=487898
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tree.js
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tree.js
Sat Dec 16 13:38:15 2006
@@ -15,12 +15,13 @@
  * limitations under the License.
  */
 
-function toggle(node, treeHiddenId, openFolderIcon, folderIcon) {
-//  LOG.debug("toggle("+node+", "+treeHiddenId+", " + openFolderIcon + ", "+ folderIcon +")");
+function toggle(node, treeHiddenId, openFolderIcon, folderIcon, openMenuIcon, closeMenuIcon)
{
+  LOG.debug("toggle("+node+", "+treeHiddenId+", " + openFolderIcon + ", " + folderIcon +
", " + openMenuIcon + ", " + closeMenuIcon + ")");
   var content = document.getElementById(node.id + "-cont");
   if (content) {
     var selectState = document.getElementById(treeHiddenId + '-selectState');
     var icon = document.getElementById(node.id + '-icon');
+    var menuIcon = document.getElementById(node.id + '-menuIcon');
     var junction = document.getElementById(node.id + '-junction');
     var hidden = document.getElementById(treeHiddenId);
     if (content.style.display == 'none') {
@@ -28,6 +29,9 @@
       if (icon) {
         icon.src = openFolderIcon;
       }
+      if (menuIcon) {
+        menuIcon.src = openMenuIcon;
+      }
       if (junction) {
         junction.src = junction.src.replace(/plus\./, "minus.");
       }
@@ -37,6 +41,9 @@
       if (icon) {
         icon.src = folderIcon;
       }
+      if (menuIcon) {
+        menuIcon.src = closeMenuIcon;
+      }
       if (junction) {
         junction.src = junction.src.replace(/minus\./, "plus.");
       }
@@ -358,19 +365,19 @@
       }
       str += '<div id="' + this.id + '" class="' + treeItemClasses + '" '
           + 'style="width: ' + this.width + ';">';// fixme null pointer
-      str += this.indent(depth, last);
       if (this.mode == "menu") {
         if (this.isFolder) {
           // FIXME: change the icons when klick on the icon
-          str += '<img class="tobago-tree-menu-icon" '
+          str += '<img class="tobago-tree-menu-icon" id="' + this.id + '-menuIcon"'
               + 'src="' + (this.expanded ? this.treeResources.getImage("treeMenuOpen.gif")
: this.treeResources.getImage("treeMenuClose.gif")) + ' " '
               + 'onclick="toggle(this.parentNode, \'' + this.treeHiddenId
-              + '\', \'' + this.treeResources.getImage("treeMenuOpen.gif")
+              + '\', null, null, \'' + this.treeResources.getImage("treeMenuOpen.gif")
               + '\', \'' + this.treeResources.getImage("treeMenuClose.gif")
               + '\')"'
               + ' alt="">';
         }
       }
+      str += this.indent(depth, last);
       if (!(   this.hideJunctions
             || this.hideRootJunction && depth == 0
             || this.hideRootJunction && this.hideRoot && depth == 1)) {



Mime
View raw message