浏览代码

Merge branch 'dev' into optional

Robin Herbots 13 年之前
父节点
当前提交
ce8622bca0
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 1 1
      js/jquery.inputmask.js
  2. 3 1
      js/jquery.inputmask.numeric.extensions.js

+ 1 - 1
js/jquery.inputmask.js

@@ -621,8 +621,8 @@
                     if (opts.greedy == false) {
                     if (opts.greedy == false) {
                         opts.repeat = Math.round(maxLength / getActiveBuffer().length);
                         opts.repeat = Math.round(maxLength / getActiveBuffer().length);
                     }
                     }
+                    $input.prop('maxLength', getMaskLength() * 2);
                 }
                 }
-                $input.prop('maxLength', getMaskLength() * 2);
 
 
                 //store tests & original buffer in the input element - used to get the unmasked value
                 //store tests & original buffer in the input element - used to get the unmasked value
                 $input.data('inputmask', {
                 $input.data('inputmask', {

+ 3 - 1
js/jquery.inputmask.numeric.extensions.js

@@ -34,7 +34,9 @@ Optional extensions on the jquery.inputmask base
                         for (var i = 1; i < opts.digits; i++) {
                         for (var i = 1; i < opts.digits; i++) {
                             if (nptStr[radixPosition + i]) nptStr = nptStr + "0";
                             if (nptStr[radixPosition + i]) nptStr = nptStr + "0";
                         }
                         }
-                        $input.val(nptStr);
+                        if (nptStr !== $input.val()) {
+                        	$input.val(nptStr);
+                        }
                     }
                     }
                 }
                 }
             },
             },