From: Aleksander Ɓukasz Date: Tue, 10 Dec 2013 21:46:04 +0000 (+0100) Subject: integration wip: setting editor configuration from the outside X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/4051dd930f2002891e98b5d26fa536ef574f9e59?ds=sidebyside;hp=3182d8f5a1642eeac079576083eea86f09c5751a integration wip: setting editor configuration from the outside --- diff --git a/src/fnpjs/runner.js b/src/fnpjs/runner.js index eeef9f9..7797e24 100644 --- a/src/fnpjs/runner.js +++ b/src/fnpjs/runner.js @@ -10,10 +10,10 @@ var Runner = function(app, modules) { } var bootstrappedData = {}, - options = {}, moduleInstances = {}, eventListeners = [], - plugins = []; + plugins = [], + config; _.each(_.keys(modules || {}), function(moduleName) { if(_.contains(app.permissions[moduleName] || [], 'handleEvents')) { @@ -52,12 +52,16 @@ var Runner = function(app, modules) { } : undefined; this.getDOM = _.contains(permissions, 'getDOM') ? function() { - return $(options.rootSelector); + return $(config.rootSelector); } : undefined; this.getPlugins = function() { return plugins; }; + + this.getConfig = function() { + return config; + }; }; @@ -69,10 +73,10 @@ var Runner = function(app, modules) { plugins.push(plugin); }; - this.start = function(_options) { - options = _.extend({ + this.start = function(_config) { + config = _.extend({ rootSelector: 'body' - }, _options); + }, _config); app.initModules.forEach(function(moduleName) { getModuleInstance(moduleName).start(); });