From f2c4660ded5689940f6b0b22936a2739a451809f Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Mon, 10 Nov 2008 12:23:05 +0000 Subject: [PATCH] fix popup menus --- deluge/ui/webui/static/mooui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deluge/ui/webui/static/mooui.js b/deluge/ui/webui/static/mooui.js index 47dcd209a..dfe4c271e 100644 --- a/deluge/ui/webui/static/mooui.js +++ b/deluge/ui/webui/static/mooui.js @@ -78,7 +78,7 @@ return menu},build:function(){var self=this if($defined(this.element)){this.element.destroy();} this.element=this._build(this.items)},hide:function(force){if(!this.no_close){this.element.dispose() this.fireEvent('closed')}else if(force){this.element.dispose() -this.fireEvent('closed')}},show:function(e){x=e.client.x,y=e.client.y-10;this.element.inject(document.body);this.fixSize();this.fixLeft();var menuSize=this.element.getSize(),windowSize=window.getSize();if((menuSize.y+y)>=windowSize.y){y=windowSize.y-menuSize.y-(windowSize.y-y);};this.element.setStyles({'left':x,'top':y-2});this.element.addEvent('mouseleave',function(e){this.hide();}.bind(this));},fixSize:function(el){var widest=0;el.getElements('li').each(function(item){var text=item.getElement('span');var width=text.getSize().x;if(width>widest){widest=width};});el.setStyle('width',widest+32);},fixLeft:function(el){var widest=0 +this.fireEvent('closed')}},show:function(e){x=e.client.x,y=e.client.y-10;this.element.inject(document.body);var menuSize=this.element.getSize(),windowSize=window.getSize();if((menuSize.y+y)>=windowSize.y){y=windowSize.y-menuSize.y-(windowSize.y-y);};this.element.setStyles({'left':x,'top':y-2});this.element.addEvent('mouseleave',function(e){this.hide();}.bind(this));},fixSize:function(el){var widest=0;el.getElements('li').each(function(item){var text=item.getElement('span');var width=text.getSize().x;if(width>widest){widest=width};});el.setStyle('width',widest+32);},fixLeft:function(el){var widest=0 el.getElements('li').each(function(item){var width=item.getSize().x if(width>widest){widest=width}});el.setStyle('width',widest+2) el.getElements('li ul').each(function(item){item.setStyle('left',widest-20)});},showPos:function(x,y){}})