MCPcopy Index your code
hub / github.com/TruthHun/BookStack / openEditCatalogDialog

Function openEditCatalogDialog

static/js/editor.js:105–126  ·  view source on GitHub ↗

* 打开文档编辑界面 * @param $node

($node)

Source from the content-addressed store, hash-verified

103 * @param $node
104 */
105function openEditCatalogDialog($node) {
106 var $then = $("#addDocumentModal");
107 var doc_id = parseInt($node ? $node.id : 0);
108 var text = $node ? $node.text.split("<small")[0] : '';
109 var parentId = $node && $node.parent !== '#' ? $node.parent : 0;
110
111 console.log($node);
112
113 $then.find("input[name='doc_id']").val(doc_id);
114 $then.find("input[name='parent_id']").val(parentId);
115 $then.find("input[name='doc_name']").val(text);
116
117 for (var index in window.documentCategory){
118 var item = window.documentCategory[index];
119 if(item.id === doc_id){
120 $then.find("input[name='doc_identify']").val(item.identify);
121 break;
122 }
123 }
124
125 $then.modal({ show : true });
126}
127
128/**
129 * 将一个节点推送到现有数组中

Callers 2

markdown.jsFile · 0.85
html-editor.jsFile · 0.85

Calls 1

$Function · 0.50

Tested by

no test coverage detected