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