Browse Source

fix for value reversing with numericInput

Robin Herbots 11 years ago
parent
commit
c3fbd3da1f

+ 1 - 1
bower.json

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

+ 1 - 1
build.properties

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

File diff suppressed because it is too large
+ 22 - 22
dist/inputmask/jquery.inputmask.js


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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.71
+* Version: 3.0.72
 */
 
 (function (factory) {
@@ -522,9 +522,9 @@
                                                 var altMatch2 = malternateMatches[ndx2];
                                                 //verify equality
                                                 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;
                                                 }
                                             }
@@ -927,7 +927,7 @@
                         }
                     }
                     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)) {
                         unmaskedValue = opts.onUnMask.call($input, bufferValue, unmaskedValue, opts);
                     }
@@ -1681,7 +1681,7 @@
                         var valueBuffer = actionObj["value"].split('');
                         checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
                         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":
                         $el = $({});
                         $el.data('_inputmask', {
@@ -1941,7 +1941,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 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
 */
@@ -2069,7 +2069,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 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
 */
@@ -2565,7 +2565,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 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
 */
@@ -2825,7 +2825,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 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
 Allows for using regular expressions as a mask
@@ -3019,7 +3019,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.71
+Version: 3.0.72
 
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks

File diff suppressed because it is too large
+ 34 - 34
dist/jquery.inputmask.bundle.min.js


+ 1 - 1
jquery.inputmask.jquery.json

@@ -8,7 +8,7 @@
 		"inputmask",
 		"mask"
     ],
-    "version": "3.0.71",
+    "version": "3.0.72",
     "author": {
         "name": "Robin Herbots",
         "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 bufferValue = (isRTL ? getBuffer().reverse() : getBuffer()).join('');
+                    var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join('');
                     if ($.isFunction(opts.onUnMask)) {
                         unmaskedValue = opts.onUnMask.call($input, bufferValue, unmaskedValue, opts);
                     }
@@ -1681,7 +1681,7 @@
                         var valueBuffer = actionObj["value"].split('');
                         checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
                         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":
                         $el = $({});
                         $el.data('_inputmask', {

+ 1 - 1
package.json

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