From 24cd78a78da69a5594615aa5c9053c1b4522def4 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Sun, 12 Oct 2014 16:24:57 +0200 Subject: [PATCH] Call plugins after Backbone models and views have been parsed. --- converse.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/converse.js b/converse.js index f6bbbc251..54d24bd40 100644 --- a/converse.js +++ b/converse.js @@ -4621,9 +4621,16 @@ return this; }; + this._initializePlugins = function () { + _.each(this.plugins, $.proxy(function (plugin) { + $.proxy(plugin, this)(); + }, this)); + }; + // Initialization // -------------- // This is the end of the initialize method. + this._initializePlugins(); this._initialize(); this.registerGlobalEventHandlers(); converse.emit('initialized'); @@ -4684,7 +4691,7 @@ converse.off(evt, handler); }, 'registerPlugin': function (name, callback) { - converse.plugins[name] = callback(converse); + converse.plugins[name] = callback; }, }; }));