r110167 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110166‎ | r110167 | r110168 >
Date:20:55, 27 January 2012
Author:rsterbin
Status:ok
Tags:aft 
Comment:
Use closest() rather than parents(), so it doesn't go hunting all the way up to the dom root; comment out the animated hide for now
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
@@ -158,7 +158,7 @@
159159 $( '.articleFeedbackv5-' + value + '-link' ).live( 'click', function( e ) {
160160 e.preventDefault();
161161 var $l = $( e.target );
162 - var id = $l.parents( '.articleFeedbackv5-feedback' ).attr( 'rel' );
 162+ var id = $l.closest( '.articleFeedbackv5-feedback' ).attr( 'rel' );
163163 var activity = $.articleFeedbackv5special.getActivity( id );
164164 if ( activity[value] ) {
165165 return false;
@@ -178,7 +178,7 @@
179179 $( '.articleFeedbackv5-abuse-link' ).live( 'click', function( e ) {
180180 e.preventDefault();
181181 var $l = $( e.target );
182 - var id = $l.parents( '.articleFeedbackv5-feedback' ).attr( 'rel' );
 182+ var id = $l.closest( '.articleFeedbackv5-feedback' ).attr( 'rel' );
183183 var activity = $.articleFeedbackv5special.getActivity( id );
184184 if ( activity.abuse ) {
185185 $.articleFeedbackv5special.flagFeedback( id, 'abuse', -1 );
@@ -404,7 +404,8 @@
405405 $l.removeClass( 'abusive' );
406406 }
407407 if ( data['articlefeedbackv5-flag-feedback']['abuse-hidden'] ) {
408 - $l.parents( '.articleFeedbackv5-feedback' ).hide( 'slow' );
 408+ // TODO: Grey it out and add a "hidden" flag somewhere (as per Fabrice)
 409+ // $l.closest( '.articleFeedbackv5-feedback' ).hide( 'slow' );
409410 }
410411 } else {
411412 msg = 'articlefeedbackv5-' + type + '-saved';

Status & tagging log