Палсеич— (lusever) wrote in changelog,
Палсеич—
lusever
changelog

[ljcom] r9421: LJSUP-6482: SMS Notification RU.

Committer: pkornilov
LJSUP-6482: SMS Notification RU.
U   trunk/htdocs/js/editprofile.js
Modified: trunk/htdocs/js/editprofile.js
===================================================================
--- trunk/htdocs/js/editprofile.js	2010-08-27 03:21:07 UTC (rev 9420)
+++ trunk/htdocs/js/editprofile.js	2010-08-27 04:03:07 UTC (rev 9421)
@@ -5,6 +5,12 @@
 		{
 			this.supportedProviders = ['beeline', 'megafon'];
 			this.table = $('#phone_verification');
+
+			if(!this.table.length)
+			{
+				return;
+			}
+
 			this.ui = {
 				table: this.table,
 				provider: this.table.find('[name=txtmsg_provider]'),
@@ -43,25 +49,21 @@
 				this.setState('initial', 'info', 'initial');
 			}
 
-			this.ui.phInput.keypress(function(ev)
+			this.ui.phInput.input(function(ev)
 			{
-				var input = this;
-				setTimeout(function()
+				if(this.value.length == 0)
 				{
-					if(input.value.length == 0)
-					{
-						that.setState('initial', 'info', 'initial');
-						return;
-					}
+					that.setState('initial', 'info', 'initial');
+					return;
+				}
 
-					if(that.testPhoneNumber(input.value))
-					{
-						that.setState('correctNum', 'success', 'correctnum');
-					}
-					else {
-						that.setState('badNum', 'error', 'badnum');
-					}
-				},0);
+				if(that.testPhoneNumber(this.value))
+				{
+					that.setState('correctNum', 'success', 'correctnum');
+				}
+				else {
+					that.setState('badNum', 'error', 'badnum');
+				}
 			});
 
 			this.ui.resendBtn.click(function()

Tags: js, ljcom, lusever
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments