浏览代码

optional mask fix in isvalid

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

+ 1 - 1
build.properties

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

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


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


+ 11 - 5
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 2.2.6
+* Version: 2.2.7
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -445,7 +445,13 @@
 
 
                         maskPos = isRTL ? seekPrevious(buffer, pos) : seekNext(buffer, pos);
                         maskPos = isRTL ? seekPrevious(buffer, pos) : seekNext(buffer, pos);
                     }
                     }
-                    if ((activeMaskset['lastValidPosition'] == undefined && maskPos == isRTL ? seekPrevious(buffer, getMaskLength(buffer)) : seekNext(buffer, -1)) || (isRTL || opts.numericInput) ? activeMaskset['lastValidPosition'] <= opts.numericInput ? getMaskLength(buffer) : seekNext(buffer, maskPos) : activeMaskset['lastValidPosition'] >= seekPrevious(buffer, maskPos)) {
+                    if ((activeMaskset['lastValidPosition'] == undefined
+                            && maskPos == (isRTL ? seekPrevious(buffer, getMaskLength(buffer)) : seekNext(buffer, -1))
+                        )
+                        || (isRTL || opts.numericInput)
+                            ? activeMaskset['lastValidPosition'] <= opts.numericInput ? getMaskLength(buffer) : seekNext(buffer, maskPos)
+                            : activeMaskset['lastValidPosition'] >= seekPrevious(buffer, maskPos)
+                    ) {
                         if (maskPos >= 0 && maskPos < getMaskLength(buffer)) {
                         if (maskPos >= 0 && maskPos < getMaskLength(buffer)) {
                             results[index] = _isValid(maskPos, activeMaskset);
                             results[index] = _isValid(maskPos, activeMaskset);
                             if (results[index] !== false) {
                             if (results[index] !== false) {
@@ -1336,7 +1342,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.6
+Version: 2.2.7
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1433,7 +1439,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2012 Robin Herbots
 Copyright (c) 2010 - 2012 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.6
+Version: 2.2.7
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1926,7 +1932,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.6
+Version: 2.2.7
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */

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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 7 - 1
js/jquery.inputmask.js

@@ -445,7 +445,13 @@
 
 
                         maskPos = isRTL ? seekPrevious(buffer, pos) : seekNext(buffer, pos);
                         maskPos = isRTL ? seekPrevious(buffer, pos) : seekNext(buffer, pos);
                     }
                     }
-                    if ((activeMaskset['lastValidPosition'] == undefined && maskPos == isRTL ? seekPrevious(buffer, getMaskLength(buffer)) : seekNext(buffer, -1)) || (isRTL || opts.numericInput) ? activeMaskset['lastValidPosition'] <= opts.numericInput ? getMaskLength(buffer) : seekNext(buffer, maskPos) : activeMaskset['lastValidPosition'] >= seekPrevious(buffer, maskPos)) {
+                    if ((activeMaskset['lastValidPosition'] == undefined
+                            && maskPos == (isRTL ? seekPrevious(buffer, getMaskLength(buffer)) : seekNext(buffer, -1))
+                        )
+                        || (isRTL || opts.numericInput)
+                            ? activeMaskset['lastValidPosition'] <= opts.numericInput ? getMaskLength(buffer) : seekNext(buffer, maskPos)
+                            : activeMaskset['lastValidPosition'] >= seekPrevious(buffer, maskPos)
+                    ) {
                         if (maskPos >= 0 && maskPos < getMaskLength(buffer)) {
                         if (maskPos >= 0 && maskPos < getMaskLength(buffer)) {
                             results[index] = _isValid(maskPos, activeMaskset);
                             results[index] = _isValid(maskPos, activeMaskset);
                             if (results[index] !== false) {
                             if (results[index] !== false) {