allow using uiWorker on ie9 where Worker is undefined
This commit is contained in:
parent
97d39e2912
commit
6682c18ab3
2 changed files with 7 additions and 10 deletions
|
|
@ -107,6 +107,7 @@ exports.edit = function(el) {
|
|||
event.addListener(window, "resize", env.onResize);
|
||||
editor.on("destroy", function() {
|
||||
event.removeListener(window, "resize", env.onResize);
|
||||
env.editor.container.env = null; // prevent memory leak on old ie
|
||||
});
|
||||
editor.container.env = editor.env = env;
|
||||
return editor;
|
||||
|
|
|
|||
|
|
@ -966,17 +966,13 @@ var EditSession = function(text, mode) {
|
|||
};
|
||||
|
||||
this.$startWorker = function() {
|
||||
if (typeof Worker !== "undefined" && !require.noWorker) {
|
||||
try {
|
||||
this.$worker = this.$mode.createWorker(this);
|
||||
} catch (e) {
|
||||
console.log("Could not load worker");
|
||||
console.log(e);
|
||||
this.$worker = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
try {
|
||||
this.$worker = this.$mode.createWorker(this);
|
||||
} catch (e) {
|
||||
console.log("Could not load worker");
|
||||
console.log(e);
|
||||
this.$worker = null;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue