added default action of toggle for new nodes
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Sep 2006 16:34:55 +0000 (16:34 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Sep 2006 16:34:55 +0000 (16:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6140 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/slimtree.js

index c119916..e1fff89 100644 (file)
@@ -44,12 +44,16 @@ SlimTree.prototype.addNode = function( id, pid, name, action, title ) {
                return;
        }
 
+       if(!action)
+               action='javascript:'+this.handle+'.toggle("'+id+'");';
+
        var div                 = elem('div',{id:id});
        var topdiv              = elem('div',{style:'vertical-align:middle'});
        var link                        = elem('a', {id:'stlink_' + id}); 
        var actionref   = elem('a',{href:action}, name);
        var contdiv             = elem('div',{id:'stcont_' + id});
-       if(action) actionref.setAttribute('href',action);
+
+       actionref.setAttribute('href',action);
        if(title) actionref.setAttribute('title',title);
        else actionref.setAttribute('title',name);