r112146 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112145‎ | r112146 | r112147 >
Date:20:57, 22 February 2012
Author:yonishostak
Status:ok
Tags:
Comment:
AFTv5: fix bug in toggled (un)helpful onSuccess handlers
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
@@ -576,7 +576,6 @@
577577 note = typeof note !== undefined ? note : '';
578578
579579 if( $.articleFeedbackv5special.listControls.disabled ) {
580 - console.log('disabled');
581580 return false;
582581 }
583582
@@ -837,9 +836,13 @@
838837 .removeClass( 'articleFeedbackv5-helpful-link' )
839838 .addClass( 'articleFeedbackv5-reversehelpful-link' )
840839 .attr( 'id', 'articleFeedbackv5-reversehelpful-link-' + id );
841 - if( data['toggle'] ) {
842 - $( '#articleFeedbackv5-unhelpful-link-' + id ).removeClass( 'helpful-active' );
843 - setActivityFlag( id, 'unhelpful', false )
 840+ if( data['articlefeedbackv5-flag-feedback']['toggle'] ) {
 841+ $( '#articleFeedbackv5-reverseunhelpful-link-' + id )
 842+ .removeClass( 'helpful-active' )
 843+ .removeClass( 'articleFeedbackv5-reverseunhelpful-link')
 844+ .addClass( 'articleFeedbackv5-unhelpful-link' )
 845+ .attr( 'id', 'articleFeedbackv5-unhelpful-link-' + id );
 846+ $.articleFeedbackv5special.setActivityFlag( id, 'unhelpful', false )
844847 }
845848 $.articleFeedbackv5special.setActivityFlag( id, 'helpful', true );
846849 }
@@ -890,9 +893,13 @@
891894 .removeClass( 'articleFeedbackv5-unhelpful-link')
892895 .addClass( 'articleFeedbackv5-reverseunhelpful-link' )
893896 .attr( 'id', 'articleFeedbackv5-reverseunhelpful-link-' + id );
894 - if( data['toggle'] ) {
895 - $( '#articleFeedbackv5-helpful-link-' + id ).removeClass( 'helpful-active' );
896 - setActivityFlag( id, 'helpful', false )
 897+ if( data['articlefeedbackv5-flag-feedback']['toggle'] ) {
 898+ $( '#articleFeedbackv5-reversehelpful-link-' + id )
 899+ .removeClass( 'helpful-active' )
 900+ .removeClass( 'articleFeedbackv5-reversehelpful-link')
 901+ .addClass( 'articleFeedbackv5-helpful-link' )
 902+ .attr( 'id', 'articleFeedbackv5-helpful-link-' + id );
 903+ $.articleFeedbackv5special.setActivityFlag( id, 'helpful', false )
897904 }
898905 $.articleFeedbackv5special.setActivityFlag( id, 'unhelpful', true );
899906 }

Status & tagging log