Browse Source

correct numericinput & isNumeric selection

Robin Herbots 12 years ago
parent
commit
e039c36c39

+ 1 - 1
README.md

@@ -356,7 +356,7 @@ The metadata of the actual mask provided in the mask definitions can be obtained
 $(selector).inputmask("getmetadata");
 ```
 
-## Preprocessing mask
+### Preprocessing mask
 
 You can define the mask as a function which can allow to preprocess the resulting mask.  Example sorting for of multiple masks or retrieving mask definitions from dynamically through ajax.
 The preprocessing fn should return a valid mask definition.

+ 1 - 1
build.properties

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

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
     "name": "jquery.inputmask",
-    "version": "2.3.32",
+    "version": "2.3.33",
     "main": "./dist/jquery.inputmask.bundle.js",
     "dependencies": {
         "jquery": ">=1.5"

BIN
dist/jQuery.InputMask.2.3.32.nupkg


BIN
dist/jQuery.InputMask.2.3.33.nupkg


+ 7 - 5
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.3.32
+* Version: 2.3.33
 */
 
 (function ($) {
@@ -919,6 +919,8 @@
                     getActiveMaskSet()["undoBuffer"] = el._valueGet();
                     var skipKeyPressEvent = false, //Safari 5.1.x - modal dialog fires keypress twice workaround
                         ignorable = false;
+
+                    if (opts.numericInput) opts.isNumeric = opts.numericInput;
                     if (el.dir == "rtl" || (opts.numericInput && opts.rightAlignNumerics) || (opts.isNumeric && opts.rightAlignNumerics))
                         $input.css("text-align", "right");
 
@@ -1588,7 +1590,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.3.32
+Version: 2.3.33
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1690,7 +1692,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.3.32
+Version: 2.3.33
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2167,7 +2169,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.3.32
+Version: 2.3.33
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2336,7 +2338,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.3.32
+Version: 2.3.33
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask

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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 2 - 0
js/jquery.inputmask.js

@@ -919,6 +919,8 @@
                     getActiveMaskSet()["undoBuffer"] = el._valueGet();
                     var skipKeyPressEvent = false, //Safari 5.1.x - modal dialog fires keypress twice workaround
                         ignorable = false;
+
+                    if (opts.numericInput) opts.isNumeric = opts.numericInput;
                     if (el.dir == "rtl" || (opts.numericInput && opts.rightAlignNumerics) || (opts.isNumeric && opts.rightAlignNumerics))
                         $input.css("text-align", "right");
 

+ 4 - 4
qunit/tests.js

@@ -1148,9 +1148,9 @@ test("inputmask({ mask: \"€ 999.999.999,99\", numericInput: true }); - 123 pos
     $("#testmask").remove();
 });
 
-test("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, isNumeric: true, radixPoint: \",\" }); - 123", function () {
+test("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radixPoint: \",\" }); - 123", function () {
     $('body').append('<input type="text" id="testmask" />');
-    $("#testmask").inputmask('€ 999.999.999,99', { numericInput: true, isNumeric: true, radixPoint: "," });
+    $("#testmask").inputmask('€ 999.999.999,99', { numericInput: true, radixPoint: "," });
 
     $("#testmask").click();
     $("#testmask").Type("123");
@@ -1159,9 +1159,9 @@ test("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, isNumeric:
     $("#testmask").remove();
 });
 
-test("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, isNumeric: true, radixPoint: \",\" }); - 123,45", function () {
+test("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radixPoint: \",\" }); - 123,45", function () {
     $('body').append('<input type="text" id="testmask" />');
-    $("#testmask").inputmask('€ 999.999.999,99', { numericInput: true, isNumeric: true, radixPoint: "," });
+    $("#testmask").inputmask('€ 999.999.999,99', { numericInput: true, radixPoint: "," });
 
     $("#testmask").click();
     $("#testmask").Type("123,45");