Browse Source

fix some focus issues

Robin Herbots 12 years ago
parent
commit
a6192ba278

+ 1 - 1
build.properties

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

BIN
dist/jQuery.InputMask.2.2.23.nupkg


BIN
dist/jQuery.InputMask.2.2.24.nupkg


+ 11 - 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: 2.2.23
+* Version: 2.2.24
 */
 
 (function ($) {
@@ -611,19 +611,19 @@
                     ms["p"] = isRTL ? getMaskLength() : 0;
                 });
                 if (strict !== true) activeMasksetIndex = 0;
-                caret(input, getActiveMaskSet()["p"]);
+                //caret(input, getActiveMaskSet()["p"]);
 
                 if (isRTL && !opts.numericInput)
                     inputValue = inputValue.reverse();
 
                 var ml = getMaskLength();
                 $.each(inputValue, function (ndx, charCode) {
-                    if (!strict || isMask(isRTL ? (opts.numericInput ? seekPrevious(ml) : ml - ndx - 1) : ndx)) {
+                    if (strict !== true || isMask(isRTL ? (opts.numericInput ? seekPrevious(ml) : ml - ndx - 1) : ndx)) {
                         var index = isRTL ? (opts.numericInput ? ml : ml - ndx - 1) : ndx;
                         $(input).trigger("keypress", [true, charCode.charCodeAt(0), writeOut, strict, index]);
                     }
                 });
-                if (strict)
+                if (strict === true)
                     getActiveMaskSet()["lastValidPosition"] = isRTL ? seekNext(getActiveMaskSet()["p"]) : seekPrevious(getActiveMaskSet()["p"]);
             }
 
@@ -1348,7 +1348,7 @@
                                         setTimeout(function () { opts.onKeyValidation.call(this, result["result"], opts); }, 0);
                                         if (getActiveMaskSet()["writeOutBuffer"] && result["result"] !== false) {
                                             var buffer = getActiveBuffer();
-                                            writeBuffer(input, buffer, opts.numericInput ? seekNext(getActiveMaskSet()["p"]) : getActiveMaskSet()["p"]);
+                                            writeBuffer(input, buffer, checkval ? undefined : (opts.numericInput ? seekNext(getActiveMaskSet()["p"]) : getActiveMaskSet()["p"]));
                                             setTimeout(function () { //timeout needed for IE
                                                 if (isComplete(buffer))
                                                     $input.trigger("complete");
@@ -1401,7 +1401,7 @@
                                         setTimeout(function () { opts.onKeyValidation.call(this, result["result"], opts); }, 0);
                                         if (getActiveMaskSet()["writeOutBuffer"] && result["result"] !== false) {
                                             var p = getActiveMaskSet()["p"], buffer = getActiveBuffer();
-                                            writeBuffer(input, buffer, p);
+                                            writeBuffer(input, buffer, checkval ? undefined : p);
 
                                             setTimeout(function () { //timeout needed for IE
                                                 if (isComplete(buffer))
@@ -1413,7 +1413,7 @@
                                     }
                                 }
                             }
-                            if (android) {
+                            if (android && checkval !== true) {
                                 caret(input, caretSavePoint.begin, caretSavePoint.end);
                             }
                             if (opts.showTooltip) { //update tooltip
@@ -1445,7 +1445,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.23
+Version: 2.2.24
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1542,7 +1542,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.23
+Version: 2.2.24
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2035,7 +2035,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.23
+Version: 2.2.24
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2210,7 +2210,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.23
+Version: 2.2.24
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask

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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 6 - 6
js/jquery.inputmask.js

@@ -611,19 +611,19 @@
                     ms["p"] = isRTL ? getMaskLength() : 0;
                 });
                 if (strict !== true) activeMasksetIndex = 0;
-                caret(input, getActiveMaskSet()["p"]);
+                //caret(input, getActiveMaskSet()["p"]);
 
                 if (isRTL && !opts.numericInput)
                     inputValue = inputValue.reverse();
 
                 var ml = getMaskLength();
                 $.each(inputValue, function (ndx, charCode) {
-                    if (!strict || isMask(isRTL ? (opts.numericInput ? seekPrevious(ml) : ml - ndx - 1) : ndx)) {
+                    if (strict !== true || isMask(isRTL ? (opts.numericInput ? seekPrevious(ml) : ml - ndx - 1) : ndx)) {
                         var index = isRTL ? (opts.numericInput ? ml : ml - ndx - 1) : ndx;
                         $(input).trigger("keypress", [true, charCode.charCodeAt(0), writeOut, strict, index]);
                     }
                 });
-                if (strict)
+                if (strict === true)
                     getActiveMaskSet()["lastValidPosition"] = isRTL ? seekNext(getActiveMaskSet()["p"]) : seekPrevious(getActiveMaskSet()["p"]);
             }
 
@@ -1348,7 +1348,7 @@
                                         setTimeout(function () { opts.onKeyValidation.call(this, result["result"], opts); }, 0);
                                         if (getActiveMaskSet()["writeOutBuffer"] && result["result"] !== false) {
                                             var buffer = getActiveBuffer();
-                                            writeBuffer(input, buffer, opts.numericInput ? seekNext(getActiveMaskSet()["p"]) : getActiveMaskSet()["p"]);
+                                            writeBuffer(input, buffer, checkval ? undefined : (opts.numericInput ? seekNext(getActiveMaskSet()["p"]) : getActiveMaskSet()["p"]));
                                             setTimeout(function () { //timeout needed for IE
                                                 if (isComplete(buffer))
                                                     $input.trigger("complete");
@@ -1401,7 +1401,7 @@
                                         setTimeout(function () { opts.onKeyValidation.call(this, result["result"], opts); }, 0);
                                         if (getActiveMaskSet()["writeOutBuffer"] && result["result"] !== false) {
                                             var p = getActiveMaskSet()["p"], buffer = getActiveBuffer();
-                                            writeBuffer(input, buffer, p);
+                                            writeBuffer(input, buffer, checkval ? undefined : p);
 
                                             setTimeout(function () { //timeout needed for IE
                                                 if (isComplete(buffer))
@@ -1413,7 +1413,7 @@
                                     }
                                 }
                             }
-                            if (android) {
+                            if (android && checkval !== true) {
                                 caret(input, caretSavePoint.begin, caretSavePoint.end);
                             }
                             if (opts.showTooltip) { //update tooltip