r106085 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106084‎ | r106085 | r106086 >
Date:20:41, 13 December 2011
Author:yonishostak
Status:ok
Tags:
Comment:
AFTv5: fix bug 32937 - text prompt not working correctly on IE7
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.js (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
@@ -224,6 +224,12 @@
225225 * Bucket 1: Share Your Feedback
226226 */
227227 '1': {
 228+
 229+ /**
 230+ * Currently displayed placeholder text. This is a workaround for Chrome/FF
 231+ * automatic focus in overlays.
 232+ */
 233+ currentDefaultText: '',
228234
229235 // {{{ templates
230236
@@ -352,6 +358,7 @@
353359 var def_msg_no = mw.msg( 'articlefeedbackv5-bucket1-question-comment-no' );
354360 if ( $txt.val() == '' || $txt.val() == def_msg_yes || $txt.val() == def_msg_no ) {
355361 $txt.val( new_val == 'yes' ? def_msg_yes : def_msg_no );
 362+ $.articleFeedbackv5.currentBucket().currentDefaultText = $txt.val();
356363 }
357364 // enable submission
358365 $.articleFeedbackv5.enableSubmission( true );
@@ -360,18 +367,10 @@
361368 // Clear out the question on focus
362369 $block.find( '.articleFeedbackv5-comment textarea' )
363370 .focus( function () {
364 - var def_msg = '';
365 - var val = $.articleFeedbackv5.find( '.articleFeedbackv5-bucket1-toggle input[checked]' ).val();
366 - if ( val == 'yes' ) {
367 - def_msg = mw.msg( 'articlefeedbackv5-bucket1-question-comment-yes' );
368 - } else if ( val == 'no' ) {
369 - def_msg = mw.msg( 'articlefeedbackv5-bucket1-question-comment-no' );
370 - }
371 - if ( $( this ).val() == def_msg ) {
 371+ if ( $( this ).val() == $.articleFeedbackv5.currentBucket().currentDefaultText ) {
372372 $( this ).val( '' );
373 - $(this).addClass( 'active' );
 373+ $( this ).addClass( 'active' );
374374 }
375 -
376375 } )
377376 .keyup ( function () {
378377 if( $( this ).val().length > 0 ) {
Index: trunk/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.js
@@ -128,6 +128,7 @@
129129 $fixedTab.addClass( 'articleFeedbackv5-fixedtab' );
130130 $fixedTab.find( '#articleFeedbackv5-fixedtabbox' ).addClass( 'articleFeedbackv5-fixedtabbox' );
131131 $fixedTab.find( '#articleFeedbackv5-fixedtablink' ).addClass( 'articleFeedbackv5-fixedtablink' );
 132+ $fixedTab.find( '#articleFeedbackv5-fixedtablink' ).css( 'border', '#00F 1px solid' );
132133 $aftDiv.articleFeedbackv5( 'addToRemovalQueue', $fixedTab );
133134 }
134135

Status & tagging log