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:
Nicolas Lempereur
2015-08-21 15:58:52 +02:00
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++;