Fixed a typo in placeholder that was stopping the cancel to work

This commit is contained in:
Mostafa Eweda 2012-03-08 20:29:21 +02:00
commit 1283b11f0e

View file

@ -60,7 +60,7 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
this.$pos = pos;
// Used for reset
this.$undoStackDepth = session.getUndoManager().$undoStack ? session.getUndoManager().$undoStack.length : -1;
this.$undoStackDepth = session.getUndoManager().$undostack ? session.getUndoManager().$undostack.length : -1;
this.setup();
session.selection.on("changeCursor", this.$onCursorChange);
@ -202,7 +202,7 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
if(this.$undoStackDepth === -1)
throw Error("Canceling placeholders only supported with undo manager attached to session.");
var undoManager = this.session.getUndoManager();
var undosRequired = undoManager.$undoStack.length - this.$undoStackDepth;
var undosRequired = undoManager.$undostack.length - this.$undoStackDepth;
for (var i = 0; i < undosRequired; i++) {
undoManager.undo(true);
}