From c9289873134be68cb3edf87e04142cdedc4eea8c Mon Sep 17 00:00:00 2001 From: ccerrillo Date: Wed, 17 Apr 2013 20:41:24 +0300 Subject: [PATCH] mootools change break context menu Fx.Tween in mootols 1.4.5 no longer sets visibility to hidden, so when the context menu dissapear, if you put the mouse in the space where the menu were showed is still there but with opacity to 0 and cannot click to nothing below that area So i emulated the old behaviour with OnComplete event. Additionally i changed the use of deprecated $empty --- src/webui/scripts/contextmenu.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/webui/scripts/contextmenu.js b/src/webui/scripts/contextmenu.js index 41a3f08d7..8f32acc73 100644 --- a/src/webui/scripts/contextmenu.js +++ b/src/webui/scripts/contextmenu.js @@ -27,7 +27,17 @@ var ContextMenu = new Class({ this.targets = $$(this.options.targets); //fx - this.fx = new Fx.Tween(this.menu, { property: 'opacity', duration:this.options.fadeSpeed }); + this.fx = new Fx.Tween(this.menu, { + property: 'opacity', + duration:this.options.fadeSpeed, + onComplete: function() { + if(this.getStyle('opacity')){ + this.setStyle('visibility','visible'); + }else{ + this.setStyle('visibility','hidden'); + } + }.bind(this.menu) + }); //hide and begin the listener this.hide().startListener(); @@ -158,4 +168,4 @@ var ContextMenu = new Class({ return this; } -}); \ No newline at end of file +});