ソースを参照

fix inital value setting in numericinput

Robin Herbots 12 年 前
コミット
1d1309ce77

+ 1 - 1
build.properties

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

BIN
dist/jQuery.InputMask.2.2.29.nupkg


BIN
dist/jQuery.InputMask.2.2.30.nupkg


+ 9 - 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.29
+* Version: 2.2.30
 */
 
 (function ($) {
@@ -627,6 +627,7 @@
                 $.each(inputValue, function (ndx, charCode) {
                     if (strict !== true || isMask(isRTL ? (opts.numericInput ? seekPrevious(ml) : ml - ndx - 1) : ndx)) {
                         var index = isRTL ? (opts.numericInput ? ml : ml - ndx - 1) : ndx;
+                        console.log("charcaode " + charCode.charCodeAt(0) + " writeOut " + writeOut + " strict " + strict + " index " + index);
                         $(input).trigger("keypress", [true, charCode.charCodeAt(0), writeOut, strict, index]);
                     }
                 });
@@ -1269,7 +1270,7 @@
                         if (k) {
                             var pos, results, result;
                             if (checkval) {
-                                var pcaret = strict ? ndx : getActiveMaskSet()["p"];
+                                var pcaret = strict ? ndx : (opts.numericInput ? seekNext(getActiveMaskSet()["p"]) : getActiveMaskSet()["p"]);
                                 pos = { begin: pcaret, end: pcaret };
                             } else {
                                 pos = caret(input);
@@ -1298,6 +1299,7 @@
 
                             if (isRTL) {
                                 var p = seekPrevious(pos.end);
+                                console.log("isrtl " + c + " pos " + p + " buffer " + JSON.stringify(getActiveBuffer()));
                                 results = isValid(p, c, strict, isRTL);
                                 if (strict === true) results = [{ "activeMasksetIndex": activeMasksetIndex, "result": results }];
                                 $.each(results, function (index, result) {
@@ -1332,6 +1334,7 @@
                                             } else setBufferElement(buffer, p, c, true, isRTL);
                                         }
                                         getActiveMaskSet()["p"] = p;
+                                        console.log("newpos " + p);
                                     }
                                 });
 
@@ -1444,7 +1447,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.29
+Version: 2.2.30
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1541,7 +1544,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.29
+Version: 2.2.30
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2034,7 +2037,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.29
+Version: 2.2.30
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2196,7 +2199,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.29
+Version: 2.2.30
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask

ファイルの差分が大きいため隠しています
+ 37 - 37
dist/jquery.inputmask.bundle.min.js


ファイルの差分が大きいため隠しています
+ 43 - 43
dist/min/jquery.inputmask.js


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 4 - 1
js/jquery.inputmask.js

@@ -627,6 +627,7 @@
                 $.each(inputValue, function (ndx, charCode) {
                     if (strict !== true || isMask(isRTL ? (opts.numericInput ? seekPrevious(ml) : ml - ndx - 1) : ndx)) {
                         var index = isRTL ? (opts.numericInput ? ml : ml - ndx - 1) : ndx;
+                        console.log("charcaode " + charCode.charCodeAt(0) + " writeOut " + writeOut + " strict " + strict + " index " + index);
                         $(input).trigger("keypress", [true, charCode.charCodeAt(0), writeOut, strict, index]);
                     }
                 });
@@ -1269,7 +1270,7 @@
                         if (k) {
                             var pos, results, result;
                             if (checkval) {
-                                var pcaret = strict ? ndx : getActiveMaskSet()["p"];
+                                var pcaret = strict ? ndx : (opts.numericInput ? seekNext(getActiveMaskSet()["p"]) : getActiveMaskSet()["p"]);
                                 pos = { begin: pcaret, end: pcaret };
                             } else {
                                 pos = caret(input);
@@ -1298,6 +1299,7 @@
 
                             if (isRTL) {
                                 var p = seekPrevious(pos.end);
+                                console.log("isrtl " + c + " pos " + p + " buffer " + JSON.stringify(getActiveBuffer()));
                                 results = isValid(p, c, strict, isRTL);
                                 if (strict === true) results = [{ "activeMasksetIndex": activeMasksetIndex, "result": results }];
                                 $.each(results, function (index, result) {
@@ -1332,6 +1334,7 @@
                                             } else setBufferElement(buffer, p, c, true, isRTL);
                                         }
                                         getActiveMaskSet()["p"] = p;
+                                        console.log("newpos " + p);
                                     }
                                 });