* 打开文档编辑界面 * @param $node
($node)
| 103 | * @param $node |
| 104 | */ |
| 105 | function 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 | * 将一个节点推送到现有数组中 |
no test coverage detected