Fix env.editor to point to the right object and add editor.env = env such that you can access env from the returned editor object

This commit is contained in:
Julian Viereck 2011-02-18 06:29:40 +08:00 • committed by Fabian Jakobs
commit 7ed9cb2f57

View file

@ -75,13 +75,16 @@ require(deps, function() {
var env = require("pilot/environment").create(); var env = require("pilot/environment").create();
catalog.startupPlugins({ env: env }).then(function() { catalog.startupPlugins({ env: env }).then(function() {
env.document = doc; env.document = doc;
env.editor = env; env.editor = editor;
editor.resize(); editor.resize();
Event.addListener(window, "resize", function() { Event.addListener(window, "resize", function() {
editor.resize(); editor.resize();
}); });
el.env = env; el.env = env;
}); });
// Store env on editor such that it can be accessed later on from
// the returned object.
editor.env = env;
return editor; return editor;
} }
}; };