Roo/bootstrap/PhoneInput.js
authorjohn <john@roojs.com>
Wed, 28 Mar 2018 08:47:35 +0000 (16:47 +0800)
committerjohn <john@roojs.com>
Wed, 28 Mar 2018 08:47:35 +0000 (16:47 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/PhoneInput.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 73ecf00..ccb9681 100644 (file)
@@ -469,6 +469,7 @@ Roo.extend(Roo.bootstrap.PhoneInput, Roo.bootstrap.TriggerField, {
         setValue : function(v)
         {
             var d = this.getDialCode(v);
+            Roo.log(d);
             this.value = v;
             
             if(!d || d.length == 0) {
index 768e600..3dab73a 100644 (file)
@@ -39657,6 +39657,7 @@ Roo.extend(Roo.bootstrap.PhoneInput, Roo.bootstrap.TriggerField, {
         setValue : function(v)
         {
             var d = this.getDialCode(v);
+            Roo.log(d);
             this.value = v;
             
             if(!d || d.length == 0) {
@@ -39665,7 +39666,7 @@ Roo.extend(Roo.bootstrap.PhoneInput, Roo.bootstrap.TriggerField, {
                 }
                 return;
             }
-            Roo.log(d);
+            
             this.setFlagClass(this.dialCodeMapping[d].iso2);
             this.setDialCode(d);
             this.inputEl().dom.value = v.replace('+'+d,'');
index 0cff75e..502c668 100644 (file)
@@ -1624,6 +1624,6 @@ this.view.select(A);if(B!==false){var el=this.view.getNode(A);if(el){this.list.s
 );this.list.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';;},collapseIf:function(e){var A=e.within(this.el);var B=e.within(this.list);var C=(Roo.get(e.getTarget()).id==this.list.id)?true:false;if(A||B||C){return;}this.collapse();},onSelect:function(A,B){if(this.fireEvent('beforeselect',this,A,B)!==false){this.setFlagClass(A.data.iso2);
 this.setDialCode(A.data.dialCode);this.hasFocus=false;this.collapse();this.fireEvent('select',this,A,B);}},flagEl:function(){var A=this.el.select('div.flag',true).first();if(!A){return false;}return A;},dialCodeHolderEl:function(){var d=this.el.select('input.dial-code-holder',true).first();
 if(!d){return false;}return d;},setDialCode:function(v){this.dialCodeHolder.dom.value='+'+v;},setFlagClass:function(n){this.flag.dom.className='flag '+n;},getValue:function(){var v=this.inputEl().getValue();if(this.dialCodeHolder){v=this.dialCodeHolder.dom.value+this.inputEl().getValue();
-}return v;},setValue:function(v){var d=this.getDialCode(v);this.value=v;if(!d||d.length==0){if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);}return;}Roo.log(d);this.setFlagClass(this.dialCodeMapping[d].iso2);this.setDialCode(d);this.inputEl().dom.value=v.replace('+'+d,'');
+}return v;},setValue:function(v){var d=this.getDialCode(v);Roo.log(d);this.value=v;if(!d||d.length==0){if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);}return;}this.setFlagClass(this.dialCodeMapping[d].iso2);this.setDialCode(d);this.inputEl().dom.value=v.replace('+'+d,'');
 this.validate();},getDialCode:function(v=''){if(v.length==0){return this.dialCodeHolder.dom.value;}var A="";if(v.charAt(0)!="+"){return false;}var B="";for(var i=1;i<v.length;i++){var c=v.charAt(i);if(!isNaN(c)){B+=c;if(this.dialCodeMapping[B]){A=v.substr(1,i);
 }if(B.length==4){break;}}}return A;},reset:function(){this.setValue(this.defaultDialCode);}});