mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-20 10:48:00 +08:00
feat:1、实现空节点功能,当文档标记为空目录时不加载内容页无法编辑内容
2、实现HTTP接口方式登录, 3、优化markdown编辑器部分功能
This commit is contained in:
@@ -125,9 +125,11 @@ $(function () {
|
||||
// 插入 GFM 任务列表
|
||||
var cm = window.editor.cm;
|
||||
var selection = cm.getSelection();
|
||||
|
||||
var cursor = cm.getCursor();
|
||||
if (selection === "") {
|
||||
cm.setCursor(cursor.line, 0);
|
||||
cm.replaceSelection("- [x] " + selection);
|
||||
cm.setCursor(cursor.line, cursor.ch + 6);
|
||||
} else {
|
||||
var selectionText = selection.split("\n");
|
||||
|
||||
@@ -196,6 +198,10 @@ $(function () {
|
||||
layer.msg("获取当前文档信息失败");
|
||||
return;
|
||||
}
|
||||
if (node.a_attr && node.a_attr.disabled) {
|
||||
layer.msg("空节点不能添加内容");
|
||||
return;
|
||||
}
|
||||
|
||||
var doc_id = parseInt(node.id);
|
||||
|
||||
@@ -381,7 +387,7 @@ $(function () {
|
||||
|
||||
//如果没有选中节点则选中默认节点
|
||||
// openLastSelectedNode();
|
||||
}).on('select_node.jstree', function (node, selected, event) {
|
||||
}).on('select_node.jstree', function (node, selected) {
|
||||
|
||||
if ($("#markdown-save").hasClass('change')) {
|
||||
if (confirm("编辑内容未保存,需要保存吗?")) {
|
||||
@@ -391,6 +397,12 @@ $(function () {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//如果是空目录则直接出发展开下一级功能
|
||||
if (selected.node.a_attr && selected.node.a_attr.disabled) {
|
||||
selected.instance.toggle_node(selected.node);
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
loadDocument(selected);
|
||||
}).on("move_node.jstree", jstree_save).on("delete_node.jstree",function($node,$parent) {
|
||||
|
Reference in New Issue
Block a user