angular-summernote icon indicating copy to clipboard operation
angular-summernote copied to clipboard

Prevent undo if initial content is empty

Open amenzoweb opened this issue 5 years ago • 0 comments

Hi, Firsly thank you for this awesome module, great job.

I have a small probleme using it, initial content is set after summernote and page init. (Page loaded ( with summernote init) then i put my content.) My problem is : how to prevent undo action if history length is 1.

I found it in code but I will be happy to set it in option like that I dont lose changes on module update.

Instead of : /** * undo */ History.prototype.undo = function () { // Create snap shot if not yet recorded if (this.$editable.html() !== this.stack[this.stackOffset].contents) { this.recordUndo(); } if (this.stackOffset > 0) { this.stackOffset--; this.applySnapshot(this.stack[this.stackOffset]); } };

/** * undo */ History.prototype.undo = function () { // Create snap shot if not yet recorded if (this.$editable.html() !== this.stack[this.stackOffset].contents) { this.recordUndo(); } if (this.stackOffset > 1) { this.stackOffset--; this.applySnapshot(this.stack[this.stackOffset]); } };

Is there a function to set that without code update?

thank you

amenzoweb avatar Mar 16 '20 14:03 amenzoweb