always call setMode callback after the event

This commit is contained in:
nightwing 2013-09-14 14:55:41 +04:00
commit 414667916e

View file

@ -886,8 +886,9 @@ var EditSession = function(text, mode) {
this.$modes["ace/mode/text"] = new TextMode(); this.$modes["ace/mode/text"] = new TextMode();
if (this.$modes[path] && !options) { if (this.$modes[path] && !options) {
cb && cb(this.mode); this.$onChangeMode(this.$modes[path]);
return this.$onChangeMode(this.$modes[path]); cb && cb();
return;
} }
// load on demand // load on demand
this.$modeId = path; this.$modeId = path;
@ -903,7 +904,7 @@ var EditSession = function(text, mode) {
m.$id = path; m.$id = path;
} }
this.$onChangeMode(m); this.$onChangeMode(m);
cb && cb(this.mode); cb && cb();
} }
}.bind(this)); }.bind(this));