This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
Incam_SGD/plugins/WemagTreeBrowsePlugin/js/tree.js

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);
} );
}
}