minor fixes: removed whitespace, added semicolon

This commit is contained in:
Rob Moen 2012-02-24 00:49:28 +00:00
parent 8cf2fe9f33
commit dab0396b54
Notes: Gabriel Wicke 2012-02-27 16:40:01 +00:00

View file

@ -1,6 +1,6 @@
/** /**
* Creates an ve.dm.Surface object. * Creates an ve.dm.Surface object.
* *
* @class * @class
* @constructor * @constructor
* @extends {ve.EventEmitter} * @extends {ve.EventEmitter}
@ -30,12 +30,12 @@ ve.dm.Surface.prototype.purgeHistory = function() {
this.selection = null; this.selection = null;
this.smallStack = []; this.smallStack = [];
this.bigStack = []; this.bigStack = [];
this.undoIndex = 0; this.undoIndex = 0;
}; };
ve.dm.Surface.prototype.getHistory = function() { ve.dm.Surface.prototype.getHistory = function() {
if ( this.smallStack.length > 0 ) { if ( this.smallStack.length > 0 ) {
return this.bigStack.slice( 0 ).concat( [{ 'stack': this.smallStack.slice(0) }] ); return this.bigStack.slice( 0 ).concat( [{ 'stack': this.smallStack.slice(0) }] );
} else { } else {
return this.bigStack.slice( 0 ); return this.bigStack.slice( 0 );
} }
@ -43,7 +43,7 @@ ve.dm.Surface.prototype.getHistory = function() {
/** /**
* Gets the document model of the surface. * Gets the document model of the surface.
* *
* @method * @method
* @returns {ve.dm.DocumentNode} Document model of the surface * @returns {ve.dm.DocumentNode} Document model of the surface
*/ */
@ -52,8 +52,8 @@ ve.dm.Surface.prototype.getDocument = function() {
}; };
/** /**
* Gets the selection * Gets the selection
* *
* @method * @method
* @returns {ve.Range} Current selection * @returns {ve.Range} Current selection
*/ */
@ -63,10 +63,10 @@ ve.dm.Surface.prototype.getSelection = function() {
/** /**
* Changes the selection. * Changes the selection.
* *
* If changing the selection at a high frequency (such as while dragging) use the combine argument * If changing the selection at a high frequency (such as while dragging) use the combine argument
* to avoid them being split up into multiple history items * to avoid them being split up into multiple history items
* *
* @method * @method
* @param {ve.Range} selection * @param {ve.Range} selection
* @param {Boolean} isManual Whether this selection was the result of a user action, and thus should * @param {Boolean} isManual Whether this selection was the result of a user action, and thus should
@ -81,18 +81,18 @@ ve.dm.Surface.prototype.select = function( selection, isManual ) {
this.breakpoint(); this.breakpoint();
} }
// check if the last thing is a selection, if so, swap it. // check if the last thing is a selection, if so, swap it.
this.selection = selection; this.selection = selection;
this.emit( 'select', this.selection.clone() ); this.emit( 'select', this.selection.clone() );
//} //}
}; };
/** /**
* Applies a series of transactions to the content data. * Applies a series of transactions to the content data.
* *
* If committing multiple transactions which are the result of a single user action and need to be * If committing multiple transactions which are the result of a single user action and need to be
* part of a single history item, use the isPartial argument for all but the last one to avoid them * part of a single history item, use the isPartial argument for all but the last one to avoid them
* being split up into multple history items. * being split up into multple history items.
* *
* @method * @method
* @param {ve.dm.Transaction} transactions Tranasction to apply to the document * @param {ve.dm.Transaction} transactions Tranasction to apply to the document
* @param {boolean} isPartial whether this transaction is part of a larger logical grouping of * @param {boolean} isPartial whether this transaction is part of a larger logical grouping of
@ -117,7 +117,7 @@ ve.dm.Surface.prototype.breakpoint = function( selection ) {
ve.dm.Surface.prototype.undo = function() { ve.dm.Surface.prototype.undo = function() {
this.breakpoint(); this.breakpoint();
this.undoIndex++ this.undoIndex++;
if ( this.bigStack[this.bigStack.length - this.undoIndex] ) { if ( this.bigStack[this.bigStack.length - this.undoIndex] ) {
var diff = 0; var diff = 0;
var item = this.bigStack[this.bigStack.length - this.undoIndex]; var item = this.bigStack[this.bigStack.length - this.undoIndex];