浏览代码

forgot the changes ;-)

Robin Herbots 12 年之前
父节点
当前提交
794c3f77ae
共有 5 个文件被更改,包括 121 次插入145 次删除
  1. 二进制
      dist/jQuery.InputMask.2.2.52.nupkg
  2. 6 18
      dist/jquery.inputmask.bundle.js
  3. 66 66
      dist/jquery.inputmask.bundle.min.js
  4. 43 43
      dist/min/jquery.inputmask.js
  5. 6 18
      js/jquery.inputmask.js

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


+ 6 - 18
dist/jquery.inputmask.bundle.js

@@ -82,14 +82,14 @@
                 iphone = navigator.userAgent.match(new RegExp("iphone", "i")) !== null,
                 android = navigator.userAgent.match(new RegExp("android.*safari.*", "i")) !== null,
                 pasteEvent = isInputEventSupported('paste') && !msie10 ? 'paste' : 'input',
-                android533,
+                android53x,
                 masksets,
                 activeMasksetIndex = 0;
 
             if (android) {
                 var browser = navigator.userAgent.match(/safari.*/i),
                     version = parseInt(new RegExp(/[0-9]+/).exec(browser));
-                android533 = (version <= 533);
+                android53x = (version <= 537);
                 //android534 = (533 < version) && (version <= 534);
             }
             if (typeof fn === "string") {
@@ -698,8 +698,6 @@
                     }
                 }
 
-                var caretSavePoint;
-
                 function caret(input, begin, end) {
                     var npt = input.jquery && input.length > 0 ? input[0] : input, range;
                     if (typeof begin == 'number') {
@@ -709,16 +707,9 @@
                         end = (typeof end == 'number') ? end : begin;
                         if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                         if (npt.setSelectionRange) {
-                            if (android) {
-                                setTimeout(function () {
-                                    npt.selectionStart = begin;
-                                    npt.selectionEnd = android ? begin : end;
-                                }, 10);
-                                caretSavePoint = { "begin": begin, "end": end };
-                            } else {
-                                npt.selectionStart = begin;
-                                npt.selectionEnd = end;
-                            }
+                            npt.selectionStart = begin;
+                            npt.selectionEnd = android ? begin : end;
+
                         } else if (npt.createTextRange) {
                             range = npt.createTextRange();
                             range.collapse(true);
@@ -1163,7 +1154,7 @@
                             } else {
                                 $.each(masksets, function (ndx, ms) {
                                     activeMasksetIndex = ndx;
-                                    beginPos = android533 ? pos.end : pos.begin;
+                                    beginPos = android53x ? pos.end : pos.begin;
                                     var buffer = getActiveBuffer(), firstMaskPos = isRTL ? seekPrevious(getMaskLength() + 1) : seekNext(-1),
                                         maskL = getMaskLength();
                                     if (k == opts.keyCode.DELETE) { //handle delete
@@ -1451,9 +1442,6 @@
                                         }
                                     }
                                 }
-                                if (android && checkval !== true) {
-                                    caret(input, caretSavePoint.begin, caretSavePoint.end);
-                                }
                                 if (opts.showTooltip) { //update tooltip
                                     $input.prop("title", getActiveMaskSet()["mask"]);
                                 }

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


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


+ 6 - 18
js/jquery.inputmask.js

@@ -82,14 +82,14 @@
                 iphone = navigator.userAgent.match(new RegExp("iphone", "i")) !== null,
                 android = navigator.userAgent.match(new RegExp("android.*safari.*", "i")) !== null,
                 pasteEvent = isInputEventSupported('paste') && !msie10 ? 'paste' : 'input',
-                android533,
+                android53x,
                 masksets,
                 activeMasksetIndex = 0;
 
             if (android) {
                 var browser = navigator.userAgent.match(/safari.*/i),
                     version = parseInt(new RegExp(/[0-9]+/).exec(browser));
-                android533 = (version <= 533);
+                android53x = (version <= 537);
                 //android534 = (533 < version) && (version <= 534);
             }
             if (typeof fn === "string") {
@@ -698,8 +698,6 @@
                     }
                 }
 
-                var caretSavePoint;
-
                 function caret(input, begin, end) {
                     var npt = input.jquery && input.length > 0 ? input[0] : input, range;
                     if (typeof begin == 'number') {
@@ -709,16 +707,9 @@
                         end = (typeof end == 'number') ? end : begin;
                         if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                         if (npt.setSelectionRange) {
-                            if (android) {
-                                setTimeout(function () {
-                                    npt.selectionStart = begin;
-                                    npt.selectionEnd = android ? begin : end;
-                                }, 10);
-                                caretSavePoint = { "begin": begin, "end": end };
-                            } else {
-                                npt.selectionStart = begin;
-                                npt.selectionEnd = end;
-                            }
+                            npt.selectionStart = begin;
+                            npt.selectionEnd = android ? begin : end;
+
                         } else if (npt.createTextRange) {
                             range = npt.createTextRange();
                             range.collapse(true);
@@ -1163,7 +1154,7 @@
                             } else {
                                 $.each(masksets, function (ndx, ms) {
                                     activeMasksetIndex = ndx;
-                                    beginPos = android533 ? pos.end : pos.begin;
+                                    beginPos = android53x ? pos.end : pos.begin;
                                     var buffer = getActiveBuffer(), firstMaskPos = isRTL ? seekPrevious(getMaskLength() + 1) : seekNext(-1),
                                         maskL = getMaskLength();
                                     if (k == opts.keyCode.DELETE) { //handle delete
@@ -1451,9 +1442,6 @@
                                         }
                                     }
                                 }
-                                if (android && checkval !== true) {
-                                    caret(input, caretSavePoint.begin, caretSavePoint.end);
-                                }
                                 if (opts.showTooltip) { //update tooltip
                                     $input.prop("title", getActiveMaskSet()["mask"]);
                                 }