mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-15 23:55:50 +00:00
判断内容Dirty
This commit is contained in:
@@ -361,6 +361,12 @@ function setEditorContent(content, isMarkdown, preview, callback) {
|
||||
_setEditorContent(content, isMarkdown, preview, callback);
|
||||
// });
|
||||
}
|
||||
function setEditorIsDirty(isDirty) {
|
||||
tinymce.activeEditor.isNotDirty = !isDirty; // isDirty = false
|
||||
}
|
||||
function editorIsDirty() {
|
||||
return !LEA.readOnly && tinymce.activeEditor.isDirty();
|
||||
}
|
||||
function _setEditorContent(content, isMarkdown, preview, callback) {
|
||||
if(!content) {
|
||||
content = "";
|
||||
@@ -387,6 +393,8 @@ function _setEditorContent(content, isMarkdown, preview, callback) {
|
||||
if(typeof tinymce != "undefined" && tinymce.activeEditor) {
|
||||
var editor = tinymce.activeEditor;
|
||||
editor.setContent(content);
|
||||
setEditorIsDirty(false);
|
||||
// editor.isNotDirty = true; // isDirty = false
|
||||
|
||||
callback && callback(); // Note.toggleReadOnly();
|
||||
|
||||
|
Reference in New Issue
Block a user