浏览代码

fix numeric Input mask on 1 char field

Robin Herbots 12 年之前
父节点
当前提交
e95da1a1af

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 build.major = 2
 build.minor = 2
-build.revision = 20
+build.revision = 21
 
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js

二进制
dist/jQuery.InputMask.2.2.20.nupkg


+ 6 - 6
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 2.2.20
+* Version: 2.2.21
 */
 
 (function ($) {
@@ -1316,7 +1316,7 @@
                                                         firstUnmaskedPosition = firstUnmaskedPosition == maskL ? (maskL + 1) : seekNext(firstUnmaskedPosition);
                                                     }
                                                 }
-                                                if (firstUnmaskedPosition <= p && (getActiveMaskSet()['greedy'] || buffer.length < maskL)) {
+                                                if (firstUnmaskedPosition <= p && (getActiveMaskSet()['greedy'] || (buffer.length < maskL || getBufferElement(buffer, p) == getPlaceHolder(p)))) {
                                                     if (buffer[firstMaskPos] != getPlaceHolder(firstMaskPos) && buffer.length < maskL) {
                                                         var offset = prepareBuffer(buffer, -1, isRTL);
                                                         if (pos.end != 0) p = p + offset;
@@ -1439,7 +1439,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.20
+Version: 2.2.21
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1536,7 +1536,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2012 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.20
+Version: 2.2.21
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2029,7 +2029,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.20
+Version: 2.2.21
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2204,7 +2204,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.20
+Version: 2.2.21
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask

文件差异内容过多而无法显示
+ 27 - 27
dist/jquery.inputmask.bundle.min.js


文件差异内容过多而无法显示
+ 31 - 31
dist/min/jquery.inputmask.js


+ 1 - 1
jquery.inputmask.jquery.json

@@ -8,7 +8,7 @@
 		"inputmask",
 		"mask"
     ],
-    "version": "2.2.20",
+    "version": "2.2.21",
     "author": {
         "name": "Robin Herbots",
         "url": "http://github.com/RobinHerbots/jquery.inputmask"

+ 1 - 1
js/jquery.inputmask.js

@@ -1316,7 +1316,7 @@
                                                         firstUnmaskedPosition = firstUnmaskedPosition == maskL ? (maskL + 1) : seekNext(firstUnmaskedPosition);
                                                     }
                                                 }
-                                                if (firstUnmaskedPosition <= p && (getActiveMaskSet()['greedy'] || buffer.length < maskL)) {
+                                                if (firstUnmaskedPosition <= p && (getActiveMaskSet()['greedy'] || (buffer.length < maskL || getBufferElement(buffer, p) == getPlaceHolder(p)))) {
                                                     if (buffer[firstMaskPos] != getPlaceHolder(firstMaskPos) && buffer.length < maskL) {
                                                         var offset = prepareBuffer(buffer, -1, isRTL);
                                                         if (pos.end != 0) p = p + offset;