Author: fmeschbe
Date: Thu Aug 12 18:25:17 2010
New Revision: 984898

URL: http://svn.apache.org/viewvc?rev=984898&view=rev
Log:
SLING-1645 Apply patch by Clemens Wyss (thanks alot)

Modified:
    
sling/trunk/contrib/explorers/jquery/src/main/resources/libs/sling/explorer/js/explorer.js

Modified: 
sling/trunk/contrib/explorers/jquery/src/main/resources/libs/sling/explorer/js/explorer.js
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/explorers/jquery/src/main/resources/libs/sling/explorer/js/explorer.js?rev=984898&r1=984897&r2=984898&view=diff
==============================================================================
--- 
sling/trunk/contrib/explorers/jquery/src/main/resources/libs/sling/explorer/js/explorer.js
 (original)
+++ 
sling/trunk/contrib/explorers/jquery/src/main/resources/libs/sling/explorer/js/explorer.js
 Thu Aug 12 18:25:17 2010
@@ -62,19 +62,21 @@ explorer_toggle = function(path){
 }
 
 load_branch = function(path){
-  var id= path.replace(/\//g, "_"); // replacing / with _
-  
-  $('p#'+id+">a").removeAttr('href');  // remove onclick
-  
-  // fetch children
-  $.get("/"+path + ".explorer.item.html", function(data){
-    if (data.length > 0) {
-      $('p#'+id).parent().addClass('branch'); // add css class
-      $('p#'+id).after(data); // add data
-      $('p#'+id+">a").attr('href', "#");  // reactivate onclick
-      $('p#'+id+">a").addClass('open');  // open
-    } 
-  });
+  if (path != '')
+  {
+     var id= path.replace(/\//g, "_"); // replacing / with _
+        $('p#'+id+">a").removeAttr('href');  // remove onclick
+         
+         // fetch children
+         $.get("/"+path + ".explorer.item.html", function(data){
+               if (data.length > 0) {
+                 $('p#'+id).parent().addClass('branch'); // add css class
+                 $('p#'+id).after(data); // add data
+                 $('p#'+id+">a").attr('href', "#");  // reactivate onclick
+                 $('p#'+id+">a").addClass('open');  // open
+               } 
+         });
+  }
 }
 
 load_props = function(path) {


Reply via email to