From f3439ad45bdb9d0a2571cd6ac95233e1661f3bec Mon Sep 17 00:00:00 2001 From: augushong Date: Fri, 4 Mar 2022 14:22:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BC=96=E8=BE=91=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E4=BA=A4;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/admin/post/edit_content.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/view/admin/post/edit_content.html b/view/admin/post/edit_content.html index b19f71c..ce3402f 100644 --- a/view/admin/post/edit_content.html +++ b/view/admin/post/edit_content.html @@ -94,6 +94,9 @@
+
+ 内容变动自动提交 +
@@ -118,23 +121,25 @@ if (contentSaveLock) { setTimeout(() => { autoSaveContent(); - }, 5000); + }, 2600); } else { contentSaveLock = true; $.post('{:url("update")}', { content_html: editor.getHtml(), id: '{$post->id}' }, function (result) { - + $('#content-state').text('自动提交成功') setTimeout(() => { autoSaveContent(); - }, 5000); + }, 2600); }) } } + autoSaveContent(); + const E = window.wangEditor; const editorConfig = { MENU_CONF: {} } @@ -146,6 +151,8 @@ editorConfig.onChange = (editor) => { console.log('content', editor) contentSaveLock = false; + + $('#content-state').text('等待自动提交') } // 先创建 editor @@ -167,7 +174,7 @@ }) setTimeout(() => { - $('#content').height(window.innerHeight - $('#editor-toolbar').outerHeight() - 30 - 45 - 7) + $('#content').height(window.innerHeight - $('#editor-toolbar').outerHeight() - 30 - 45 - 7 - 31) }, 300);