浏览代码

fix for value reversing with numericInput

Robin Herbots 11 年之前
父节点
当前提交
c3fbd3da1f

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "jquery.inputmask",
   "name": "jquery.inputmask",
-  "version": "3.0.71",
+  "version": "3.0.72",
   "main": [
   "main": [
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.extensions.js",
     "./dist/inputmask/jquery.inputmask.extensions.js",

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 
 build.major = 3
 build.major = 3
 build.minor = 0
 build.minor = 0
-build.revision = 71
+build.revision = 72
 
 
 target = jquery.inputmask.bundle.js
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js
 target.min = jquery.inputmask.bundle.min.js

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


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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Copyright (c) 2010 - 2014 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: 3.0.71
+* Version: 3.0.72
 */
 */
 
 
 (function (factory) {
 (function (factory) {
@@ -522,9 +522,9 @@
                                                 var altMatch2 = malternateMatches[ndx2];
                                                 var altMatch2 = malternateMatches[ndx2];
                                                 //verify equality
                                                 //verify equality
                                                 if (altMatch.match.mask == altMatch2.match.mask && (typeof altIndex != "string" || $.inArray(altMatch.locator[loopNdxCnt].toString(), altIndexArr) != -1)) {
                                                 if (altMatch.match.mask == altMatch2.match.mask && (typeof altIndex != "string" || $.inArray(altMatch.locator[loopNdxCnt].toString(), altIndexArr) != -1)) {
-                                                    malternateMatches.splice(ndx2, 1);
-                                                    altMatch.locator[loopNdxCnt] = altMatch2.locator[loopNdxCnt] + "," + altMatch.locator[loopNdxCnt];
-                                                    altMatch.alternation = loopNdxCnt; //we pass the alternation index => used in determineLastRequiredPosition
+                                                    maltMatches.splice(ndx1, 1);
+                                                    altMatch2.locator[loopNdxCnt] = altMatch2.locator[loopNdxCnt] + "," + altMatch.locator[loopNdxCnt];
+                                                    altMatch2.alternation = loopNdxCnt; //we pass the alternation index => used in determineLastRequiredPosition
                                                     break;
                                                     break;
                                                 }
                                                 }
                                             }
                                             }
@@ -927,7 +927,7 @@
                         }
                         }
                     }
                     }
                     var unmaskedValue = (isRTL ? umValue.reverse() : umValue).join('');
                     var unmaskedValue = (isRTL ? umValue.reverse() : umValue).join('');
-                    var bufferValue = (isRTL ? getBuffer().reverse() : getBuffer()).join('');
+                    var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join('');
                     if ($.isFunction(opts.onUnMask)) {
                     if ($.isFunction(opts.onUnMask)) {
                         unmaskedValue = opts.onUnMask.call($input, bufferValue, unmaskedValue, opts);
                         unmaskedValue = opts.onUnMask.call($input, bufferValue, unmaskedValue, opts);
                     }
                     }
@@ -1681,7 +1681,7 @@
                         var valueBuffer = actionObj["value"].split('');
                         var valueBuffer = actionObj["value"].split('');
                         checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
                         checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
                         opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
                         opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
-                        return isRTL ? getBuffer().reverse().join('') : getBuffer().join('');
+                        return isRTL ? getBuffer().slice().reverse().join('') : getBuffer().join('');
                     case "isValid":
                     case "isValid":
                         $el = $({});
                         $el = $({});
                         $el.data('_inputmask', {
                         $el.data('_inputmask', {
@@ -1941,7 +1941,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.71
+Version: 3.0.72
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2069,7 +2069,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.71
+Version: 3.0.72
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2565,7 +2565,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.71
+Version: 3.0.72
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2825,7 +2825,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.71
+Version: 3.0.72
 
 
 Regex extensions on the jquery.inputmask base
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
 Allows for using regular expressions as a mask
@@ -3019,7 +3019,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.71
+Version: 3.0.72
 
 
 Phone extension.
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks
 When using this extension make sure you specify the correct url to get the masks

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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 2 - 2
js/jquery.inputmask.js

@@ -927,7 +927,7 @@
                         }
                         }
                     }
                     }
                     var unmaskedValue = (isRTL ? umValue.reverse() : umValue).join('');
                     var unmaskedValue = (isRTL ? umValue.reverse() : umValue).join('');
-                    var bufferValue = (isRTL ? getBuffer().reverse() : getBuffer()).join('');
+                    var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join('');
                     if ($.isFunction(opts.onUnMask)) {
                     if ($.isFunction(opts.onUnMask)) {
                         unmaskedValue = opts.onUnMask.call($input, bufferValue, unmaskedValue, opts);
                         unmaskedValue = opts.onUnMask.call($input, bufferValue, unmaskedValue, opts);
                     }
                     }
@@ -1681,7 +1681,7 @@
                         var valueBuffer = actionObj["value"].split('');
                         var valueBuffer = actionObj["value"].split('');
                         checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
                         checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
                         opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
                         opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
-                        return isRTL ? getBuffer().reverse().join('') : getBuffer().join('');
+                        return isRTL ? getBuffer().slice().reverse().join('') : getBuffer().join('');
                     case "isValid":
                     case "isValid":
                         $el = $({});
                         $el = $({});
                         $el.data('_inputmask', {
                         $el.data('_inputmask', {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "jquery.inputmask",
   "name": "jquery.inputmask",
-  "version": "3.0.71",
+  "version": "3.0.72",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": [
   "main": [
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.js",