ソースを参照

Merge branch 'dev'

Robin Herbots 13 年 前
コミット
6b7016f787
2 ファイル変更9 行追加15 行削除
  1. 4 10
      js/jquery.inputmask.date.extensions.js
  2. 5 5
      js/jquery.inputmask.js

+ 4 - 10
js/jquery.inputmask.date.extensions.js

@@ -3,7 +3,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.0.5
+Version: 1.0.6
 
 Optional extensions on the jquery.inputmask base
 */
@@ -71,9 +71,7 @@ Optional extensions on the jquery.inputmask base
                                 isValid = opts.regex.val1.test("0" + chrs.charAt(0));
                                 if (isValid) {
                                     buffer[pos - 1] = "0";
-                                    buffer[pos] = chrs.charAt(0);
-                                    pos++;
-                                    return { "pos": pos };
+                                    return { "pos": pos ,"c": chrs.charAt(0) };
                                 }
                             }
                         }
@@ -102,9 +100,7 @@ Optional extensions on the jquery.inputmask base
                                     isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
                                     if (isValid) {
                                         buffer[pos - 1] = "0";
-                                        buffer[pos] = chrs.charAt(0);
-                                        pos++;
-                                        return { "pos": pos };
+                                        return { "pos": pos, "c": chrs.charAt(0) };
                                     }
                                 }
                             }
@@ -209,9 +205,7 @@ Optional extensions on the jquery.inputmask base
                                         isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
                                         if (isValid) {
                                             buffer[pos - 1] = "0";
-                                            buffer[pos] = chrs.charAt(0);
-                                            pos++;
-                                            return { "pos": pos };
+                                            return { "pos": pos, "c": chrs.charAt(0) };
                                         }
                                     }
                                 }

+ 5 - 5
js/jquery.inputmask.js

@@ -667,11 +667,11 @@
                 //apply mask
                 lastPosition = checkVal(el, buffer, true);
 
-   		// Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame.
-		var activeElement;	
-		try {		    		
-		   activeElement = document.activeElement;
-		} catch(e) {}
+   				// Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame.
+				var activeElement;	
+				try {		    		
+				   activeElement = document.activeElement;
+				} catch(e) {}
                 if (activeElement === el) { //position the caret when in focus
                     $input.addClass('focus.inputmask');
                     caret(el, lastPosition);