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

Function openDeleteDocumentDialog

static/js/editor.js:80–99  ·  view source on GitHub ↗

* 删除一个文档 * @param $node

($node)

Source from the content-addressed store, hash-verified

78 * @param $node
79 */
80function openDeleteDocumentDialog($node) {
81 var index = layer.confirm('你确定要删除该文档吗?', {
82 btn: ['确定','取消'] //按钮
83 }, function(){
84
85 $.post(window.deleteURL,{"identify" : window.book.identify,"doc_id" : $node.id}).done(function (res) {
86 layer.close(index);
87 if(res.errcode === 0){
88 window.treeCatalog.delete_node($node);
89 // resetEditor($node);
90 }else{
91 layer.msg("删除失败",{icon : 2})
92 }
93 }).fail(function () {
94 layer.close(index);
95 layer.msg("删除失败",{icon : 2})
96 });
97
98 });
99}
100
101/**
102 * 打开文档编辑界面

Callers 2

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

Calls 1

postMethod · 0.80

Tested by

no test coverage detected