From: Tim Starling Date: Mon, 20 Feb 2012 23:47:47 +0000 (+0000) Subject: Bug 34538 again. Bug reproduced and fix tested. X-Git-Tag: 1.31.0-rc.0~24597 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=e4ca2740d9406ae1e42b4d53dae85e8511dc38a9;p=lhc%2Fweb%2Fwiklou.git Bug 34538 again. Bug reproduced and fix tested. --- diff --git a/resources/mediawiki.special/mediawiki.special.changeemail.js b/resources/mediawiki.special/mediawiki.special.changeemail.js index 6b4ed81df0..00e14fab3d 100644 --- a/resources/mediawiki.special/mediawiki.special.changeemail.js +++ b/resources/mediawiki.special/mediawiki.special.changeemail.js @@ -24,16 +24,18 @@ var updateMailValidityLabel = function( mail ) { } }; -// Lame tip to let user know if its email is valid. See bug 22449 -// Only bind once for 'blur' so that the user can fill it in without errors -// After that look at every keypress for direct feedback if it was invalid onblur -$( '#wpNewEmail' ).one( 'blur', function() { - if ( $( '#mw-emailaddress-validity' ).length === 0 ) { - $(this).after( '' ); - } - updateMailValidityLabel( $(this).val() ); - $(this).keyup( function() { +$( document ).ready( function() { + // Lame tip to let user know if its email is valid. See bug 22449 + // Only bind once for 'blur' so that the user can fill it in without errors + // After that look at every keypress for direct feedback if it was invalid onblur + $( '#wpNewEmail' ).one( 'blur', function() { + if ( $( '#mw-emailaddress-validity' ).length === 0 ) { + $(this).after( '' ); + } updateMailValidityLabel( $(this).val() ); + $(this).keyup( function() { + updateMailValidityLabel( $(this).val() ); + } ); } ); } );