miscelaneous fixes from c9
This commit is contained in:
parent
f1973e4233
commit
8443991f13
12 changed files with 234 additions and 81 deletions
|
|
@ -52,14 +52,14 @@ var UndoManager = function() {
|
|||
(function() {
|
||||
|
||||
/**
|
||||
* Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements:
|
||||
*
|
||||
* - `args[0]` is an array of deltas
|
||||
* - `args[1]` is the document to associate with
|
||||
*
|
||||
* @param {Object} options Contains additional properties
|
||||
*
|
||||
**/
|
||||
* Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements:
|
||||
*
|
||||
* - `args[0]` is an array of deltas
|
||||
* - `args[1]` is the document to associate with
|
||||
*
|
||||
* @param {Object} options Contains additional properties
|
||||
*
|
||||
**/
|
||||
this.execute = function(options) {
|
||||
var deltas = options.args[0];
|
||||
this.$doc = options.args[1];
|
||||
|
|
@ -78,12 +78,12 @@ var UndoManager = function() {
|
|||
};
|
||||
|
||||
/**
|
||||
* [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo}
|
||||
* @param {Boolean} dontSelect {:dontSelect}
|
||||
*
|
||||
*
|
||||
* @returns {Range} The range of the undo.
|
||||
**/
|
||||
* [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo}
|
||||
* @param {Boolean} dontSelect {:dontSelect}
|
||||
*
|
||||
*
|
||||
* @returns {Range} The range of the undo.
|
||||
**/
|
||||
this.undo = function(dontSelect) {
|
||||
var deltas = this.$undoStack.pop();
|
||||
var undoSelectionRange = null;
|
||||
|
|
@ -98,11 +98,11 @@ var UndoManager = function() {
|
|||
};
|
||||
|
||||
/**
|
||||
* [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo}
|
||||
* @param {Boolean} dontSelect {:dontSelect}
|
||||
*
|
||||
*
|
||||
**/
|
||||
* [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo}
|
||||
* @param {Boolean} dontSelect {:dontSelect}
|
||||
*
|
||||
*
|
||||
**/
|
||||
this.redo = function(dontSelect) {
|
||||
var deltas = this.$redoStack.pop();
|
||||
var redoSelectionRange = null;
|
||||
|
|
@ -117,9 +117,9 @@ var UndoManager = function() {
|
|||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Destroys the stack of undo and redo redo operations.
|
||||
**/
|
||||
*
|
||||
* Destroys the stack of undo and redo redo operations.
|
||||
**/
|
||||
this.reset = function() {
|
||||
this.$undoStack = [];
|
||||
this.$redoStack = [];
|
||||
|
|
@ -127,36 +127,36 @@ var UndoManager = function() {
|
|||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Returns `true` if there are undo operations left to perform.
|
||||
* @returns {Boolean}
|
||||
**/
|
||||
*
|
||||
* Returns `true` if there are undo operations left to perform.
|
||||
* @returns {Boolean}
|
||||
**/
|
||||
this.hasUndo = function() {
|
||||
return this.$undoStack.length > 0;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Returns `true` if there are redo operations left to perform.
|
||||
* @returns {Boolean}
|
||||
**/
|
||||
*
|
||||
* Returns `true` if there are redo operations left to perform.
|
||||
* @returns {Boolean}
|
||||
**/
|
||||
this.hasRedo = function() {
|
||||
return this.$redoStack.length > 0;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Marks the current status clean
|
||||
**/
|
||||
*
|
||||
* Marks the current status clean
|
||||
**/
|
||||
this.markClean = function() {
|
||||
this.dirtyCounter = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Returns if the current status is clean
|
||||
* @returns {Boolean}
|
||||
**/
|
||||
*
|
||||
* Returns if the current status is clean
|
||||
* @returns {Boolean}
|
||||
**/
|
||||
this.isClean = function() {
|
||||
return this.dirtyCounter === 0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue