Changeset 4795


Ignore:
Timestamp:
Mar 2, 2009, 11:34:25 AM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #1245: Add support for lazy loading of nodes in JoustTree?

Removed debug test case. Seems to work good for the directory tree (see #1241).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/admin/extensions/tree.jsp

    r4793 r4795  
    171171    JoustMenu.menuItems[byExtPoint].isOpen = true;
    172172    JoustMenu.menuItems[byFile].isOpen = true;
    173     // TEST CODE FOR LAZY LOADING - REMOVE BEFORE RELEASE
    174     var lazyTest = JoustMenu.addMenuItem(-1, 'Root', 'LazyTest');
    175     var lazyTest = JoustMenu.addLazyChildItem(lazyTest, 'Home', 'LazyTest', "alert('onclick')", 'tip', 'lazy0', "lazyLoad('lazy0')");
    176     // END TEST CODE FOR LAZY LOADING - REMOVE BEFORE RELEASE
    177173    JoustMenu.draw('joust');
    178174    isInitialised = true;
    179175  }
    180176
    181   // TEST CODE FOR LAZY LOADING - REMOVE BEFORE RELEASE
    182   var lazyCount = 0;
    183   function lazyLoad(id)
    184   {
    185     lazyCount++;
    186     var x = lazyCount > 1 ? Math.random() * 4 : 4;
    187     var menuItem = JoustMenu.menuItems[id];
    188     if (x > 1) JoustMenu.addLazyChildItem(menuItem.index, 'Folder', 'Lazy A#'+lazyCount, "alert('childclick')", 'childtip', 'lazy_a'+lazyCount, "lazyLoad('lazy_a" + lazyCount + "')");
    189     if (x > 2) JoustMenu.addLazyChildItem(menuItem.index, 'Folder', 'Lazy B#'+lazyCount, "alert('childclick')", 'childtip', 'lazy_b'+lazyCount, "lazyLoad('lazy_b" + lazyCount + "')");
    190     if (x > 3) JoustMenu.addLazyChildItem(menuItem.index, 'Folder', 'Lazy C#'+lazyCount, "alert('childclick')", 'childtip', 'lazy_c'+lazyCount, "lazyLoad('lazy_c" + lazyCount + "')");
    191     //alert(menuItem);
    192     return x > 1;
    193   }
    194 
    195   function openLazy()
    196   {
    197     var menuItem = JoustMenu.menuItems['lazy0'];
    198     JoustMenu.open(menuItem.index);
    199   }
    200   // END TEST CODE FOR LAZY LOADING - REMOVE BEFORE RELEASE
    201  
    202177  function openAll()
    203178  {
     
    291266      </div>
    292267    </div>
    293 <a href="javascript:openLazy()">Open lazy</a>,<a href="javascript:openAll()">all</a>
    294268    </base:body>
    295269  </base:page>
Note: See TracChangeset for help on using the changeset viewer.