allow using uiWorker on ie9 where Worker is undefined

This commit is contained in:
nightwing 2014-08-13 23:36:50 +04:00
commit 6682c18ab3
2 changed files with 7 additions and 10 deletions

View file

@ -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;

View file

@ -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;
}
};
/**