浏览代码

fix for issue #333

Robin Herbots 12 年之前
父节点
当前提交
851c2c86dd

+ 1 - 1
build.properties

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

+ 1 - 1
component.json

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

二进制
dist/jQuery.InputMask.2.3.56.nupkg


二进制
dist/jQuery.InputMask.2.3.57.nupkg


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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 2.3.56
+* Version: 2.3.57
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -1662,11 +1662,16 @@
                         var currentCaret = caret(input);
                         var currentCaret = caret(input);
                         opts.onKeyUp.call(this, e, buffer, opts); //extra stuff to execute on keyup
                         opts.onKeyUp.call(this, e, buffer, opts); //extra stuff to execute on keyup
                         caret(input, currentCaret.begin, currentCaret.end);
                         caret(input, currentCaret.begin, currentCaret.end);
-                        if (k == opts.keyCode.TAB && $input.hasClass('focus.inputmask') && input._valueGet().length == 0 && opts.showMaskOnFocus) {
-                            buffer = getActiveBufferTemplate().slice();
-                            writeBuffer(input, buffer);
-                            caret(input, 0);
-                            valueOnFocus = getActiveBuffer().join('');
+                        if (k == opts.keyCode.TAB && opts.showMaskOnFocus) {
+                            if ($input.hasClass('focus.inputmask') && input._valueGet().length == 0) {
+                                buffer = getActiveBufferTemplate().slice();
+                                writeBuffer(input, buffer);
+                                caret(input, 0);
+                                valueOnFocus = getActiveBuffer().join('');
+                            } else {
+                                writeBuffer(input, buffer);
+                                caret(input, 0, getMaskLength());
+                            }
                         }
                         }
                     }
                     }
                 };
                 };
@@ -1681,7 +1686,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.56
+Version: 2.3.57
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1783,7 +1788,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2012 Robin Herbots
 Copyright (c) 2010 - 2012 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.56
+Version: 2.3.57
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2267,7 +2272,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.56
+Version: 2.3.57
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2436,7 +2441,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.56
+Version: 2.3.57
 
 
 Regex extensions on the jquery.inputmask base
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
 Allows for using regular expressions as a mask
@@ -2606,7 +2611,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.56
+Version: 2.3.57
 
 
 Phone extension.
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks
 When using this extension make sure you specify the correct url to get the masks

文件差异内容过多而无法显示
+ 33 - 33
dist/jquery.inputmask.bundle.min.js


文件差异内容过多而无法显示
+ 43 - 43
dist/min/jquery.inputmask.js


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 10 - 5
js/jquery.inputmask.js

@@ -1662,11 +1662,16 @@
                         var currentCaret = caret(input);
                         var currentCaret = caret(input);
                         opts.onKeyUp.call(this, e, buffer, opts); //extra stuff to execute on keyup
                         opts.onKeyUp.call(this, e, buffer, opts); //extra stuff to execute on keyup
                         caret(input, currentCaret.begin, currentCaret.end);
                         caret(input, currentCaret.begin, currentCaret.end);
-                        if (k == opts.keyCode.TAB && $input.hasClass('focus.inputmask') && input._valueGet().length == 0 && opts.showMaskOnFocus) {
-                            buffer = getActiveBufferTemplate().slice();
-                            writeBuffer(input, buffer);
-                            caret(input, 0);
-                            valueOnFocus = getActiveBuffer().join('');
+                        if (k == opts.keyCode.TAB && opts.showMaskOnFocus) {
+                            if ($input.hasClass('focus.inputmask') && input._valueGet().length == 0) {
+                                buffer = getActiveBufferTemplate().slice();
+                                writeBuffer(input, buffer);
+                                caret(input, 0);
+                                valueOnFocus = getActiveBuffer().join('');
+                            } else {
+                                writeBuffer(input, buffer);
+                                caret(input, 0, getMaskLength());
+                            }
                         }
                         }
                     }
                     }
                 };
                 };