The merge method now makes use of the unregisterAll method

This commit is contained in:
Oliver Sartun 2013-10-24 11:47:45 +02:00
parent 8938a0dc84
commit 3ef848ac25

View File

@ -706,13 +706,12 @@
if (undoManager instanceof UndoManager &&
undoManager.stack instanceof UndoStack) {
// unregister already registered objects
var registeredObjects = this.objectRegistry.get(),
hasObjects = !!registeredObjects.length;
if (hasObjects) apply(this.unregister, this, registeredObjects);
var registeredObjects = this.objectRegistry.get();
this.unregisterAll();
// replace the stack reference
this.stack = undoManager.stack;
// register the just unregistered objects, now on the new stack
if (hasObjects) apply(this.register, this, registeredObjects);
apply(this.register, this, registeredObjects);
}
},
/**