r109963 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109962‎ | r109963 | r109964 >
Date:22:33, 24 January 2012
Author:yonishostak
Status:ok (Comments)
Tags:aft 
Comment:
AFTv5: fix the jquery slide effect, its no longer confused by fast mouse movement
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
@@ -178,17 +178,8 @@
179179 }
180180
181181 // }}}
182 - // {{{ toggleToolbox
183182
184 - // Display/hide the toolbox
185 - $.articleFeedbackv5special.toggleToolbox = function( container ) {
186 - var id = $.articleFeedbackv5special.stripID(container, 'articleFeedbackv5-feedback-tools-');
187 - $( '#articleFeedbackv5-feedback-tools-list-' + id ).slideToggle( 300 );
188 - }
189 -
190183 // }}}
191 -
192 - // }}}
193184 // {{{ Process methods
194185
195186 // {{{ flagFeedback
@@ -273,8 +264,15 @@
274265 // set effects on toolboxes
275266 $( '.articleFeedbackv5-feedback-tools > ul' ).hide();
276267 $( '.articleFeedbackv5-feedback-tools' ).hover(
277 - function( eventObj ) { $.articleFeedbackv5special.toggleToolbox( this ); },
278 - function( eventObj ) { $.articleFeedbackv5special.toggleToolbox( this ); }
 268+ function( eventObj ) {
 269+ //alert(this);
 270+ var id = $.articleFeedbackv5special.stripID( this, 'articleFeedbackv5-feedback-tools-' );
 271+ $( '#articleFeedbackv5-feedback-tools-list-' + id ).slideDown( 200 );
 272+ },
 273+ function( eventObj ) {
 274+ var id = $.articleFeedbackv5special.stripID( this, 'articleFeedbackv5-feedback-tools-' );
 275+ $( '#articleFeedbackv5-feedback-tools-list-' + id ).slideUp( 200 );
 276+ }
279277 );
280278 } else {
281279 $( '#articleFeedbackv5-show-feedback' ).text( mw.msg( 'articlefeedbackv5-error-loading-feedback' ) );

Comments

#Comment by Krinkle (talk | contribs)   23:30, 24 January 2012

Hm.. can you elaborate on this ? The only difference I can spot here is that instead of toggling the state on hover, it's manually showing in when hovering and hiding it when going out of hover - which is a good thing (since one shouldn't assume wether the element is shown or hidden at any point).

But the fast movement problem could still happen, if it is a problem you could use .stop(true, true) before the .slide*. That might fix it, try though :)

See also http://jsfiddle.net/GumE8/1/ , quickly hover in and out of the brown box a few times to see the effect.

Status & tagging log