diff --git a/deluge/plugins/label/label/data/label.js b/deluge/plugins/label/label/data/label.js index b897cbf20..827053a09 100644 --- a/deluge/plugins/label/label/data/label.js +++ b/deluge/plugins/label/label/data/label.js @@ -334,15 +334,15 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, { }, updateTorrentMenu: function(filter) { - Ext.each(filter.getStates(), function(state) { - if (!state) return; + for (var state in filter.getStates()) { + if (!state) continue; this.torrentMenu.addMenuItem({ text: state, label: state, handler: this.onTorrentMenuClick, scope: this }); - }, this); + } }, onDisable: function() { @@ -355,17 +355,6 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, { }, onEnable: function() { - if (deluge.sidebar.hasFilter('label')) { - var filter = deluge.sidebar.getFilter('label'); - this.setFilter(filter); - this.updateTorrentMenu(filter); - } else { - deluge.sidebar.on('filtercreate', this.onFilterCreate, this); - deluge.sidebar.on('afterfiltercreate', this.onAfterFilterCreate, this); - Deluge.FilterPanel.templates.label = '