Merge pull request #366 from holtwick/main
Add canUndo/canRedo to UndoManager. Fixes #365
This commit is contained in:
		
						commit
						f577a8e3cf
					
				@ -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