2
0
Эх сурвалжийг харах

Call plugins after Backbone models and views have been parsed.

JC Brand 10 жил өмнө
parent
commit
24cd78a78d
1 өөрчлөгдсөн 8 нэмэгдсэн , 1 устгасан
  1. 8 1
      converse.js

+ 8 - 1
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;
         },
     };
 }));