kopia lustrzana https://github.com/c9/core
make sure operationEnd events are not emitted to wrong session
rodzic
9c1f27d6d8
commit
539cf4b6e2
|
@ -276,6 +276,10 @@ var Editor = function(renderer, session) {
|
|||
if (this.session == session)
|
||||
return;
|
||||
|
||||
// make sure operationEnd events are not emitted to wrong session
|
||||
if (this.curOp) this.endOperation();
|
||||
this.curOp = {};
|
||||
|
||||
var oldSession = this.session;
|
||||
if (oldSession) {
|
||||
this.session.removeEventListener("change", this.$onDocumentChange);
|
||||
|
@ -372,6 +376,8 @@ var Editor = function(renderer, session) {
|
|||
oldSession: oldSession
|
||||
});
|
||||
|
||||
this.curOp = null;
|
||||
|
||||
oldSession && oldSession._signal("changeEditor", {oldEditor: this});
|
||||
session && session._signal("changeEditor", {editor: this});
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue