Ignore:
Timestamp:
Mar 26, 2009, 9:07:28 AM (14 years ago)
Author:
Martin Svensson
Message:

References #1240. Do not use lazy-icons in the item-tree when a node's children are already loaded.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.11-stable/www/common/overview/tree.jsp

    r4840 r4847  
    111111    int numChildren = child.getChildren() == null ?
    112112      0 : child.getChildren().size();
    113     sb.append("var node").append(child.hashCode()).append(" = JoustMenu.addLazyChildItem(").append("node"+startNode.hashCode());
    114     sb.append(",'").append(folderIcon).append("'");
    115     sb.append(",'").append(HTML.javaScriptEncode(child.getTitle()));
    116     sb.append(child.getNodeType() == Node.Type.FOLDER ? " (" + numChildren + ")" : "").append("',");
    117     sb.append("'showInfo(\"").append(child.getId()).append("\")','").append(HTML.javaScriptEncode(tooltip)).append("', '").append(child.getId()).append("',");
    118     sb.append("'lazyInitSubNode(\"").append(child.getId()).append("\")')\n");
     113    if (!child.isChildrenLoaded())
     114    {
     115      sb.append("var node").append(child.hashCode()).append(" = JoustMenu.addLazyChildItem(").append("node"+startNode.hashCode());
     116      sb.append(",'").append(folderIcon).append("'");
     117      sb.append(",'").append(HTML.javaScriptEncode(child.getTitle()));
     118      sb.append(child.getNodeType() == Node.Type.FOLDER ? " (" + numChildren + ")" : "").append("',");
     119      sb.append("'showInfo(\"").append(child.getId()).append("\")','").append(HTML.javaScriptEncode(tooltip)).append("', '").append(child.getId()).append("',");
     120      sb.append("'lazyInitSubNode(\"").append(child.getId()).append("\")')\n");
     121    }
     122    else
     123    {
     124       sb.append("var node").append(child.hashCode()).append(" = JoustMenu.addChildItem(").append("node"+startNode.hashCode());
     125             sb.append(",'").append(folderIcon).append("'");
     126             sb.append(",'").append(HTML.javaScriptEncode(child.getTitle()));
     127             sb.append(child.getNodeType() == Node.Type.FOLDER ? " (" + numChildren + ")" : "").append("',");
     128             sb.append("'showInfo(\"").append(child.getId()).append("\")','").append(HTML.javaScriptEncode(tooltip)).append("', '").append(child.getId()).append("')\n");
     129    }
    119130    sb.append(generateSubTree(child, ID, showFailures));
    120131  }
Note: See TracChangeset for help on using the changeset viewer.