fix source.js change_jstree_position

This commit is contained in:
wrmswindmill 2018-10-08 14:14:04 +08:00
parent 26bdb5f4e7
commit 8fe3c117cf
2 changed files with 21 additions and 8 deletions

BIN
dump.rdb

Binary file not shown.

View File

@ -1188,18 +1188,31 @@ function get_path_link_and_archor(path){
return [path,null] return [path,null]
} }
function correct_jstreeid(path_after){
var node_id = tree_nodes[path_after]
if($("#"+node_id).length==0){
tmp_node_id= node_id.replace("j1","j2")
$('#jstree').jstree("select_node",tmp_node_id);
return tmp_node_id
}else{
return node_id
}
}
function change_jstree_position(path_after){ function change_jstree_position(path_after){
if(jstree_load_complete){ try{
console.log(1111)
$('#jstree').jstree("deselect_all", true); $('#jstree').jstree("deselect_all", true);
$('#jstree').jstree("select_node", tree_nodes[path_after]); $('#jstree').jstree("select_node", tree_nodes[path_after]);
// setTimeout(function timer() { node_id=correct_jstreeid(path_after)
// var offsettop=$("#"+tree_nodes[path_after]).position().top; setTimeout(function timer() {
// $("#filelist-content").scrollTop(offsettop); var offsettop=$("#"+tree_nodes[path_after]).position().top;
// },500) tree_nodes[path_after] = node_id
$("#filelist-content").scrollTop(offsettop);
},500)
}catch(error){
console.log("jstree hasnt load complete now!")
} }
// var offsettop=$("#"+tree_nodes[path_after]).position().top;
// $("#filelist-content").scrollTop(offsettop);
} }