17 lines
812 B
JavaScript
17 lines
812 B
JavaScript
|
|
function nodeClick(context){
|
||
|
|
var prevClass = context.parentNode.className;
|
||
|
|
toggleElementClass('active', context.parentNode);
|
||
|
|
toggleElementClass('inactive', context.parentNode);
|
||
|
|
if(context.parentNode.innerHTML.toLowerCase().indexOf("<li>") == -1 && prevClass == 'treenode inactive'){
|
||
|
|
//we need to load the children
|
||
|
|
folderId = context.id
|
||
|
|
context.parentNode.innerHTML += "<img id='loading"+folderId+"' src='plugins/WemagTreeBrowsePlugin/images/loading.gif'></img>";
|
||
|
|
$.get("action.php?kt_path_info=demo.WemagTreeBrowsePlugin.actions.folder.tree&subtree=1&fFolderId="+context.id,function(data){
|
||
|
|
$("img#loading"+folderId).remove();
|
||
|
|
$("li#"+folderId).append(data);
|
||
|
|
|
||
|
|
} );
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|