always call the callback form setMode
This commit is contained in:
parent
a06739af9a
commit
f4ea1ccb6a
1 changed files with 4 additions and 4 deletions
|
|
@ -893,17 +893,17 @@ var EditSession = function(text, mode) {
|
|||
config.loadModule(["mode", path], function(m) {
|
||||
if (this.$modeId !== path)
|
||||
return cb && cb();
|
||||
if (this.$modes[path] && !options)
|
||||
return this.$onChangeMode(this.$modes[path]);
|
||||
if (m && m.Mode) {
|
||||
if (this.$modes[path] && !options) {
|
||||
this.$onChangeMode(this.$modes[path]);
|
||||
} else if (m && m.Mode) {
|
||||
m = new m.Mode(options);
|
||||
if (!options) {
|
||||
this.$modes[path] = m;
|
||||
m.$id = path;
|
||||
}
|
||||
this.$onChangeMode(m);
|
||||
cb && cb();
|
||||
}
|
||||
cb && cb();
|
||||
}.bind(this));
|
||||
|
||||
// set mode to text until loading is finished
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue