summernote: add hasUndo and hasRedo method for pre/next buttons
Since the stack offset of the editing history is hidden, it was not possible to have next (CTRL+Y) and previous (CTRL+Z) buttons.
This commit is contained in:
committed by
Christophe Matthieu
parent
f52c046afe
commit
43d378f2e8
@@ -40,6 +40,14 @@ define(['summernote/core/range'], function (range) {
|
||||
}
|
||||
};
|
||||
|
||||
this.hasUndo = function () {
|
||||
return 1 < stackOffset;
|
||||
};
|
||||
|
||||
this.hasRedo = function () {
|
||||
return stack.length - 1 > stackOffset;
|
||||
};
|
||||
|
||||
this.recordUndo = function () {
|
||||
stackOffset++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user