markdown editor clear undo status when toggle note

This commit is contained in:
life
2015-11-12 11:19:01 +08:00
parent 43cc6ac0f3
commit 367eda7bfd
3 changed files with 23 additions and 13 deletions

View File

@@ -433,6 +433,7 @@ function _setEditorContent(content, isMarkdown, preview, callback) {
*/ */
if(MD) { if(MD) {
MD.setContent(content); MD.setContent(content);
MD.clearUndo();
callback && callback(); callback && callback();
} else { } else {
clearIntervalForSetContent = setTimeout(function() { clearIntervalForSetContent = setTimeout(function() {

View File

@@ -31431,7 +31431,8 @@ define('editor',[
function highlight(section) { function highlight(section) {
var text = escape(section.text); var text = escape(section.text);
if(!window.viewerMode) { // MDPureText 不用Prism
if(!window.LEAMDPureText) {
// log("pre") // log("pre")
// log(text); // log(text);
// # lif // # lif
@@ -33873,7 +33874,15 @@ define('core',[
// strings: "Markdown syntax" // strings: "Markdown syntax"
}); });
MD.insertLink2 = pagedownEditor.insertLink; MD.pagedownEditor = pagedownEditor;
// 重置undo
// 11/12
MD.clearUndo = function () {
MD.undoMgr.init();
MD.pagedownEditor.uiManager.setUndoRedoButtonStates();
};
MD.insertLink2 = pagedownEditor.insertLink;
// Custom insert link dialog // Custom insert link dialog
pagedownEditor.hooks.set("insertLinkDialog", function(callback) { pagedownEditor.hooks.set("insertLinkDialog", function(callback) {

22
public/md/main.min.js vendored

File diff suppressed because one or more lines are too long