Client plugins loading correctly with new HTML templates
authorDarren <darren@darrenwhitlen.com>
Mon, 11 Nov 2013 10:16:13 +0000 (10:16 +0000)
committerDarren <darren@darrenwhitlen.com>
Mon, 11 Nov 2013 10:16:13 +0000 (10:16 +0000)
client/src/app.js
client/src/models/pluginmanager.js

index f63db1fdd19834aa40beae1f1c60760bc8dd6915..c6eba1a3c076a43dac30891557ca3e0bffa2eee7 100644 (file)
@@ -107,13 +107,6 @@ _kiwi.global = {
         var continueStart, locale;\r
         opts = opts || {};\r
 \r
-        // Load the plugin manager\r
-        _kiwi.global.plugins = new _kiwi.model.PluginManager();\r
-\r
-        // Set up the settings datastore\r
-        _kiwi.global.settings = _kiwi.model.DataStore.instance('kiwi.settings');\r
-        _kiwi.global.settings.load();\r
-\r
         continueStart = function (locale, s, xhr) {\r
             if (locale) {\r
                 _kiwi.global.i18n = new Jed({locale_data: locale, domain: xhr.getResponseHeader('Content-Language')});\r
@@ -130,9 +123,16 @@ _kiwi.global = {
             // Start the client up\r
             _kiwi.app.start();\r
 \r
+            // Now everything has started up, load the plugin manager for third party plugins\r
+            _kiwi.global.plugins = new _kiwi.model.PluginManager();\r
+\r
             callback && callback();\r
         };\r
 \r
+        // Set up the settings datastore\r
+        _kiwi.global.settings = _kiwi.model.DataStore.instance('kiwi.settings');\r
+        _kiwi.global.settings.load();\r
+\r
         locale = _kiwi.global.settings.get('locale');\r
         if (!locale) {\r
             $.getJSON(opts.base_path + '/assets/locales/magic.json', continueStart);\r
index e3fc829377b2beb0281ecbe18dd3e018ab416578..7a5181b579ecb37c0cc3f1dbaed46e70205e25a4 100644 (file)
@@ -1,6 +1,7 @@
 _kiwi.model.PluginManager = Backbone.Model.extend({\r
     initialize: function () {\r
-        this.$plugin_holder = $('<div id="kiwi_plugins" style="display:none;"></div>').appendTo('#kiwi');\r
+        this.$plugin_holder = $('<div id="kiwi_plugins" style="display:none;"></div>')\r
+            .appendTo(_kiwi.app.view.$el);\r
         this.loaded_plugins = {};\r
     },\r
 \r