From e4ca2740d9406ae1e42b4d53dae85e8511dc38a9 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 20 Feb 2012 23:47:47 +0000 Subject: [PATCH] Bug 34538 again. Bug reproduced and fix tested. --- .../mediawiki.special.changeemail.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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() ); + } ); } ); } ); -- 2.20.1