Browse Source

Merge branch 'dev'

Robin Herbots 13 years ago
parent
commit
3ed9e20b7a
1 changed files with 11 additions and 14 deletions
  1. 11 14
      jquery.inputmask.js

+ 11 - 14
jquery.inputmask.js

@@ -593,23 +593,20 @@ This plugin is based on the masked input plugin written by Josh Bush (digitalbus
                     }, 0);
                     }, 0);
                 }).bind('setvalue.inputmask', function() {
                 }).bind('setvalue.inputmask', function() {
                     var input = this;
                     var input = this;
-                    setTimeout(function() {
-                        undoBuffer = input._valueGet();
-                        checkVal(input, buffer, true);
-                        if (input._valueGet() == _buffer.join(''))
-                            input._valueSet('');
-                    }, 0);
+                    undoBuffer = input._valueGet();
+                    checkVal(input, buffer, true);
+                    if (input._valueGet() == _buffer.join(''))
+                        input._valueSet('');
                 });
                 });
                 }
                 }
 
 
-                setTimeout(function() {
-                    lastPosition = checkVal(el, buffer, true);
-                    if (document.activeElement === el) { //position the caret when in focus
-                        $input.addClass('focus.inputmask');
-                        caret(el, lastPosition);
-                    } else if (opts.clearMaskOnLostFocus && el._valueGet() == _buffer.join(''))
-                        el._valueSet('');
-                }, 0);
+                //apply mask
+                lastPosition = checkVal(el, buffer, true);
+                if (document.activeElement === el) { //position the caret when in focus
+                  $input.addClass('focus.inputmask');
+                  caret(el, lastPosition);
+                } else if (opts.clearMaskOnLostFocus && el._valueGet() == _buffer.join(''))
+                      el._valueSet('');
 
 
                 //private functions
                 //private functions
                 function patchValueProperty(npt) {
                 function patchValueProperty(npt) {