浏览代码

Merge branch '1.x' into 2.x

Robin Herbots 12 年之前
父节点
当前提交
701b62a2b1

+ 1 - 1
build.properties

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

+ 11 - 8
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.1.9
+* Version: 2.1.10
 */
 
 (function ($) {
@@ -654,12 +654,12 @@
                 }
             }
 
-            function caret(input, begin, end) {
-                if (!$(input).is(':visible')) {
-                    return;
-                }
+            function caret(input, begin, end) {       
                 var npt = input.jquery && input.length > 0 ? input[0] : input;
                 if (typeof begin == 'number') {
+                  	if (!$(input).is(':visible')) {
+                    	return;
+                	}
                     end = (typeof end == 'number') ? end : begin;
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                     if (npt.setSelectionRange) {
@@ -674,6 +674,9 @@
                     npt.focus();
                     if (android && end != npt.selectionEnd) caretposCorrection = { begin: begin, end: end };
                 } else {
+                	if (!$(input).is(':visible')) {
+                    	return { begin: 0, end: 0 };
+                	}
                     var caretpos = android ? caretposCorrection : null, caretposCorrection = null;
                     if (caretpos == null) {
                         if (npt.setSelectionRange) {
@@ -1264,7 +1267,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.1.9
+Version: 2.1.10
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1361,7 +1364,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.1.9
+Version: 2.1.10
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1854,7 +1857,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.1.9
+Version: 2.1.10
 
 Optional extensions on the jquery.inputmask base
 */

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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 7 - 4
js/jquery.inputmask.js

@@ -654,12 +654,12 @@
                 }
             }
 
-            function caret(input, begin, end) {
-                if (!$(input).is(':visible')) {
-                    return;
-                }
+            function caret(input, begin, end) {       
                 var npt = input.jquery && input.length > 0 ? input[0] : input;
                 if (typeof begin == 'number') {
+                  	if (!$(input).is(':visible')) {
+                    	return;
+                	}
                     end = (typeof end == 'number') ? end : begin;
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                     if (npt.setSelectionRange) {
@@ -674,6 +674,9 @@
                     npt.focus();
                     if (android && end != npt.selectionEnd) caretposCorrection = { begin: begin, end: end };
                 } else {
+                	if (!$(input).is(':visible')) {
+                    	return { begin: 0, end: 0 };
+                	}
                     var caretpos = android ? caretposCorrection : null, caretposCorrection = null;
                     if (caretpos == null) {
                         if (npt.setSelectionRange) {