Skip to content

Prevent undo if initial content is empty #215

@amenzoweb

Description

@amenzoweb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions