Add canUndo/canRedo to UndoManager. Fixes #365
This commit is contained in:
parent
645f05b0bb
commit
f857345451
@ -282,4 +282,22 @@ export class UndoManager extends Observable {
|
|||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are undo steps available?
|
||||||
|
*
|
||||||
|
* @return {boolean} `true` if undo is possible
|
||||||
|
*/
|
||||||
|
canUndo() {
|
||||||
|
return this.undoStack.length > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are redo steps available?
|
||||||
|
*
|
||||||
|
* @return {boolean} `true` if redo is possible
|
||||||
|
*/
|
||||||
|
canRedo() {
|
||||||
|
return this.redoStack.length > 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user