diff --git a/deluge/ui/web/js/Deluge.Plugin.js b/deluge/ui/web/js/Deluge.Plugin.js index 333e6c5cb..47759cc05 100644 --- a/deluge/ui/web/js/Deluge.Plugin.js +++ b/deluge/ui/web/js/Deluge.Plugin.js @@ -41,5 +41,15 @@ Deluge.Plugin = Ext.extend(Ext.util.Observable, { this.isDelugePlugin = true; Deluge.Plugins[this.name] = this; Deluge.Plugin.superclass.constructor.call(this, config); + }, + + disable: function() { + this.fireEvent("disabled", this); + if (this.onDisable) this.onDisable(); + }, + + enable: function() { + this.fireEvent("enable", this); + if (this.onEnable) this.onEnable(); } }); \ No newline at end of file diff --git a/deluge/ui/web/js/Deluge.UI.js b/deluge/ui/web/js/Deluge.UI.js index 2a4c7e9c4..3c2d53460 100644 --- a/deluge/ui/web/js/Deluge.UI.js +++ b/deluge/ui/web/js/Deluge.UI.js @@ -74,10 +74,11 @@ Deluge.UI = { Deluge.Client = new Ext.ux.util.RpcClient({ url: '/json' }); - - Ext.each(Deluge.Plugins, function(plugin) { + + for (var plugin in Deluge.Plugins) { + plugin = Deluge.Plugins[plugin]; plugin.enable(); - }); + } Deluge.Client.on('connected', function(e) { Deluge.Login.show();