Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent undo if initial content is empty #215

Open
amenzoweb opened this issue Mar 16, 2020 · 0 comments
Open

Prevent undo if initial content is empty #215

amenzoweb opened this issue Mar 16, 2020 · 0 comments

Comments

@amenzoweb
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant