mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
完成编辑的提交;
This commit is contained in:
@@ -94,6 +94,9 @@
|
||||
<div id="editor-text-area"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content-state" style="height: 30px;line-height: 30px;padding-left: 15px;border-top: 1px solid #e8e8e8;color: #666;">
|
||||
内容变动自动提交
|
||||
</div>
|
||||
<div id="content-data" style="display: none;">{:urlencode($post->content_html)}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user