make sure history state is correct when triggering events
This commit is contained in:
parent
bcb7e3f720
commit
99672fc039
1 changed files with 4 additions and 2 deletions
|
@ -40,8 +40,9 @@ Ox.History = function(options) {
|
|||
},
|
||||
redo: function() {
|
||||
if (position < history.length) {
|
||||
position++;
|
||||
$element && $element.triggerEvent('redo');
|
||||
return history[position++];
|
||||
return history[position - 1];
|
||||
}
|
||||
},
|
||||
redoText: function() {
|
||||
|
@ -57,8 +58,9 @@ Ox.History = function(options) {
|
|||
},
|
||||
undo: function() {
|
||||
if (position > 0) {
|
||||
position--;
|
||||
$element && $element.triggerEvent('undo');
|
||||
return history[--position];
|
||||
return history[position];
|
||||
}
|
||||
},
|
||||
undoText: function() {
|
||||
|
|
Loading…
Reference in a new issue