From 3f86e440bd305552203090972acaa3bfc73acf24 Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Thu, 6 Nov 2008 20:44:12 +0000 Subject: [PATCH] label js --- deluge/plugins/label/label/data/test1.js | 18 +++++++++++------- deluge/ui/webui/templates/white/header.html | 2 -- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/deluge/plugins/label/label/data/test1.js b/deluge/plugins/label/label/data/test1.js index 7d1725f36..c67e56047 100644 --- a/deluge/plugins/label/label/data/test1.js +++ b/deluge/plugins/label/label/data/test1.js @@ -7,13 +7,11 @@ popup_icon = "/static/images/tango/emblem-symbolic-link.png" /*the best i could find in 15 minutes, i still hate it.*/ Plugins = {} - Plugins.Label = { - /*onload:*/ - initialize: function() { + initialize : function() { this.bound = { addPopup: this.addPopup.bind(this), - labelAction: this.labelAction.bindWithEvent(this) + labelAction: this.labelAction.bindWithEvent(this), }; $$('.filter_label').each(this.bound.addPopup); @@ -21,13 +19,16 @@ Plugins.Label = { var menu = new Widgets.PopupMenu(); menu.add(this.menu); menu.addEvent('action', this.bound.labelAction); + }, /*add menu to html-ui*/ addPopup: function (el) { + var label_id = el.id.substring(13); /*crop of "filter_label_"*/ - el.addEvent('click', function(el) { - alert('popup:' + label_id); + el.addEvent('contextmenu', function(el) { + alert('popup menu here : [label="' + label_id + '"] (using this.menu definitions)'); + return false; }); }, @@ -73,4 +74,7 @@ Plugins.Label = { ] }; -window.addEvent('domready', Plugins.Label.initialize); +window.addEvent('domready', function(e) { + Plugins.Label.initialize(); +}); + diff --git a/deluge/ui/webui/templates/white/header.html b/deluge/ui/webui/templates/white/header.html index 492d3ef8e..04bcab3bb 100644 --- a/deluge/ui/webui/templates/white/header.html +++ b/deluge/ui/webui/templates/white/header.html @@ -12,10 +12,8 @@ $def with (title, active_tab="NONE") -