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) {
|
config.loadModule(["mode", path], function(m) {
|
||||||
if (this.$modeId !== path)
|
if (this.$modeId !== path)
|
||||||
return cb && cb();
|
return cb && cb();
|
||||||
if (this.$modes[path] && !options)
|
if (this.$modes[path] && !options) {
|
||||||
return this.$onChangeMode(this.$modes[path]);
|
this.$onChangeMode(this.$modes[path]);
|
||||||
if (m && m.Mode) {
|
} else if (m && m.Mode) {
|
||||||
m = new m.Mode(options);
|
m = new m.Mode(options);
|
||||||
if (!options) {
|
if (!options) {
|
||||||
this.$modes[path] = m;
|
this.$modes[path] = m;
|
||||||
m.$id = path;
|
m.$id = path;
|
||||||
}
|
}
|
||||||
this.$onChangeMode(m);
|
this.$onChangeMode(m);
|
||||||
cb && cb();
|
|
||||||
}
|
}
|
||||||
|
cb && cb();
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
// set mode to text until loading is finished
|
// set mode to text until loading is finished
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue