ソースを参照

Decimal mask drops digits

Robin Herbots 13 年 前
コミット
b1265f9dd6

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 build.major = 1
 build.minor = 3
-build.revision = 12
+build.revision = 13
 
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js

BIN
dist/jQuery.InputMask.1.3.13.nupkg


BIN
dist/jQuery.InputMask.1.3.9.nupkg


+ 8 - 11
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: 1.3.12
+* Version: 1.3.13
 */
 
 (function ($) {
@@ -1127,7 +1127,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: 1.3.12
+Version: 1.3.13
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1224,7 +1224,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: 1.3.12
+Version: 1.3.13
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1717,7 +1717,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: 1.3.12
+Version: 1.3.13
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1784,15 +1784,12 @@ Optional extensions on the jquery.inputmask base
             onKeyDown: function (e, buffer, opts) {
                 var $input = $(this), input = this;
                 if (e.keyCode == opts.keyCode.TAB) {
-                    var nptStr = input._valueGet();
-                    var radixPosition = nptStr.indexOf(opts.radixPoint);
+                    var radixPosition = $.inArray(opts.radixPoint, buffer);
                     if (radixPosition != -1) {
-                        for (var i = 1; i < opts.digits; i++) {
-                            if (nptStr[radixPosition + i]) nptStr = nptStr + "0";
-                        }
-                        if (nptStr !== $input.val()) {
-                            $input.val(nptStr);
+                        for (var i = 1; i <= opts.digits && i < opts.getMaskLength($input.data('inputmask')['_buffer'], opts.greedy, opts.repeat, buffer, opts) ; i++) {
+                            if (buffer[radixPosition + i] == undefined) buffer[radixPosition + i] = "0";
                         }
+                        input._valueSet(buffer.join(''));
                     }
                 } else if (e.keyCode == opts.keyCode.DELETE || e.keyCode == opts.keyCode.BACKSPACE) {
                     opts.postFormat(buffer, 0, true, opts);

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


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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 4 - 7
js/jquery.inputmask.numeric.extensions.js

@@ -70,15 +70,12 @@ Optional extensions on the jquery.inputmask base
             onKeyDown: function (e, buffer, opts) {
                 var $input = $(this), input = this;
                 if (e.keyCode == opts.keyCode.TAB) {
-                    var nptStr = input._valueGet();
-                    var radixPosition = nptStr.indexOf(opts.radixPoint);
+                    var radixPosition = $.inArray(opts.radixPoint, buffer);
                     if (radixPosition != -1) {
-                        for (var i = 1; i < opts.digits; i++) {
-                            if (nptStr[radixPosition + i]) nptStr = nptStr + "0";
-                        }
-                        if (nptStr !== $input.val()) {
-                            $input.val(nptStr);
+                        for (var i = 1; i <= opts.digits && i < opts.getMaskLength($input.data('inputmask')['_buffer'], opts.greedy, opts.repeat, buffer, opts) ; i++) {
+                            if (buffer[radixPosition + i] == undefined) buffer[radixPosition + i] = "0";
                         }
+                        input._valueSet(buffer.join(''));
                     }
                 } else if (e.keyCode == opts.keyCode.DELETE || e.keyCode == opts.keyCode.BACKSPACE) {
                     opts.postFormat(buffer, 0, true, opts);