From 7ec00ccc15ad15d8e82dcb6aea642a5c1a2edcbe Mon Sep 17 00:00:00 2001 From: bright503 <52627808+bright503@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:40:00 +0800 Subject: [PATCH] =?UTF-8?q?Editor.md=E5=88=9D=E5=A7=8B=E5=8C=96=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=90=8E=E5=86=8D=E5=8A=A0=E8=BD=BD=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hubcmdui/web/document-editor.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hubcmdui/web/document-editor.html b/hubcmdui/web/document-editor.html index c0602df..79e4009 100644 --- a/hubcmdui/web/document-editor.html +++ b/hubcmdui/web/document-editor.html @@ -287,13 +287,7 @@ $(document).ready(function() { // 初始化 Editor.md initEditor(); - - // 如果有文档 ID,则加载文档 - if (docId) { - loadDocument(docId); - document.getElementById('pageTitle').textContent = '编辑文档'; - } - + // 绑定保存按钮事件 document.getElementById('saveBtn').addEventListener('click', saveDocument); @@ -340,6 +334,11 @@ indentUnit: 4, // 使用官方默认工具栏配置 onload: function() { + // 如果有文档 ID,则加载文档 + if (docId) { + loadDocument(docId); + document.getElementById('pageTitle').textContent = '编辑文档'; + } console.log('Editor.md 初始化完成'); }, onchange: function() {