OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
52
app/Domain/Wiki/Js/wikiController.js
Normal file
52
app/Domain/Wiki/Js/wikiController.js
Normal file
@@ -0,0 +1,52 @@
|
||||
leantime.wikiController = (function () {
|
||||
|
||||
//Functions
|
||||
var initTree = function (id, selectedId) {
|
||||
|
||||
jQuery(id).jstree({
|
||||
"core": {
|
||||
"expand_selected_onload":true,
|
||||
"themes": {
|
||||
"dots":false
|
||||
}
|
||||
},
|
||||
"state" : {
|
||||
"key" : "tree_state",
|
||||
|
||||
},
|
||||
"types" : {
|
||||
"default": {
|
||||
"icon": "far fa-file-alt"
|
||||
},
|
||||
},
|
||||
"plugins" : ["wholerow", "types", "state"]
|
||||
});
|
||||
|
||||
jQuery(id).on("ready.jstree", function (e, data) {
|
||||
|
||||
jQuery(this).jstree("deselect_all");
|
||||
jQuery(this).jstree("select_node", "treenode_" + selectedId + "", true);
|
||||
jQuery(this).jstree("save_state");
|
||||
|
||||
})
|
||||
|
||||
jQuery(id).on('activate_node.jstree', function (e, data) {
|
||||
|
||||
jQuery(this).jstree("save_state");
|
||||
|
||||
if (data == undefined || data.node == undefined || data.node.id == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = data.node.a_attr.href;
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Make public what you want to have public, everything else is private
|
||||
return {
|
||||
initTree: initTree,
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user