new OperationHistory()
Methods
-
canRedo() → {Bool}
-
Check if a redo action can be taken.
Returns:
- Type
- Bool
-
canUndo() → {Bool}
-
Check if an undo action can be taken.
Returns:
- Type
- Bool
-
clear()
-
Clear the history list.
-
getCurrOperation() → {Kekule.Operation}
-
Get current operation in list.
Returns:
- Type
- Kekule.Operation
-
getOperationAt(index) → {Kekule.Operation}
-
Return child operation at index.
Parameters:
Name Type Description index
Int Returns:
- Type
- Kekule.Operation
-
getOperationCount() → {Int}
-
Returns count of operations in history.
Returns:
- Type
- Int
-
pop() → {Kekule.Operation}
-
Popup topmost operation out of list.
Returns:
- Type
- Kekule.Operation
-
push(operation)
-
Add new operation to history list.
Parameters:
Name Type Description operation
Kekule.Operation -
redo() → {Kekule.Operation}
-
Redo a rollbacked operation.
Returns:
Operation redone.- Type
- Kekule.Operation
-
undo() → {Kekule.Operation}
-
Undo current operation.
Returns:
Operation undone.- Type
- Kekule.Operation
-
undoAll()
-
Undo all operations.
-
unpop() → {Kekule.Operation}
-
Rollback a pop action.
Returns:
- Type
- Kekule.Operation
Events
-
clear
-
Invoked when the operation list is cleared. event param of it has one fields: {currOperIndex: Int}
-
operChange
-
Invoked when the items in operation history has some changes.
-
pop
-
Invoked when the an operation is popped from history. event param of it has two fields: {operation: Kekule.Operation, currOperIndex: Int}
-
push
-
Invoked when the an operation is pushed into history. event param of it has two fields: {operation: Kekule.Operation, currOperIndex: Int}
-
redo
-
Invoked when one operation is redone. event param of it has one fields: {operation: Kekule.Operation, currOperIndex: Int}
-
undo
-
Invoked when one operation is undone. event param of it has two fields: {operation: Kekule.Operation, currOperIndex: Int}