mediawiki-extensions-Visual.../modules/es/models/es.HistoryStateModel.js

32 lines
673 B
JavaScript
Raw Normal View History

/**
* Creates an es.HistoryStateModel object.
*
* @class
* @constructor
*/
es.HistoryStateModel = function() {
this.transactions = [];
this.selection = null;
};
/* Methods */
es.HistoryStateModel.prototype.getSelection = function() {
return this.selection;
};
es.HistoryStateModel.prototype.getTransactions = function() {
return this.transactions;
};
es.HistoryStateModel.prototype.getTransactionCount = function() {
return this.transactions.length;
};
es.HistoryStateModel.prototype.pushTransaction = function( transaction, selection ) {
this.transactions.push( transaction );
if ( selection !== undefined ) {
this.selection = selection.clone();
}
};