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);
|
event.addListener(window, "resize", env.onResize);
|
||||||
editor.on("destroy", function() {
|
editor.on("destroy", function() {
|
||||||
event.removeListener(window, "resize", env.onResize);
|
event.removeListener(window, "resize", env.onResize);
|
||||||
|
env.editor.container.env = null; // prevent memory leak on old ie
|
||||||
});
|
});
|
||||||
editor.container.env = editor.env = env;
|
editor.container.env = editor.env = env;
|
||||||
return editor;
|
return editor;
|
||||||
|
|
|
||||||
|
|
@ -966,7 +966,6 @@ var EditSession = function(text, mode) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$startWorker = function() {
|
this.$startWorker = function() {
|
||||||
if (typeof Worker !== "undefined" && !require.noWorker) {
|
|
||||||
try {
|
try {
|
||||||
this.$worker = this.$mode.createWorker(this);
|
this.$worker = this.$mode.createWorker(this);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
@ -974,9 +973,6 @@ var EditSession = function(text, mode) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
this.$worker = null;
|
this.$worker = null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
this.$worker = null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue