ソースを参照

forgot the files ;-)

Robin Herbots 12 年 前
コミット
90fe216a4b

BIN
dist/jQuery.InputMask.2.4.11.nupkg


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

@@ -1000,6 +1000,7 @@
 
 
                     //init vars
                     //init vars
                     var skipKeyPressEvent = false, //Safari 5.1.x - modal dialog fires keypress twice workaround
                     var skipKeyPressEvent = false, //Safari 5.1.x - modal dialog fires keypress twice workaround
+                        skipInputEvent = false, //skip when triggered from within inputmask
                         ignorable = false;
                         ignorable = false;
 
 
                     if (opts.numericInput) opts.isNumeric = opts.numericInput;
                     if (opts.numericInput) opts.isNumeric = opts.numericInput;
@@ -1115,6 +1116,10 @@
                             caret(input, 0, seekNext(getActiveMaskSet()["lastValidPosition"]));
                             caret(input, 0, seekNext(getActiveMaskSet()["lastValidPosition"]));
                         }, 0);
                         }, 0);
                     }).bind(pasteEvent + ".inputmask dragdrop.inputmask drop.inputmask", function (e) {
                     }).bind(pasteEvent + ".inputmask dragdrop.inputmask drop.inputmask", function (e) {
+                        if (skipInputEvent === true) {
+                            skipInputEvent = false;
+                            return true;
+                        }
                         var input = this, $input = $(input);
                         var input = this, $input = $(input);
 
 
                         //paste event for IE8 and lower I guess ;-)
                         //paste event for IE8 and lower I guess ;-)
@@ -1141,6 +1146,10 @@
 
 
                     if (androidchrome) {
                     if (androidchrome) {
                         $el.bind("input.inputmask", function (e) {
                         $el.bind("input.inputmask", function (e) {
+                            if (skipInputEvent === true) {
+                                skipInputEvent = false;
+                                return true;
+                            }
                             var input = this, $input = $(input);
                             var input = this, $input = $(input);
 
 
                             chromeValueOnInput = getActiveBuffer().join('');
                             chromeValueOnInput = getActiveBuffer().join('');
@@ -1608,6 +1617,8 @@
                                                 setTimeout(function () { //timeout needed for IE
                                                 setTimeout(function () { //timeout needed for IE
                                                     if (isComplete(buffer) === true)
                                                     if (isComplete(buffer) === true)
                                                         $input.trigger("complete");
                                                         $input.trigger("complete");
+                                                    skipInputEvent = true;
+                                                    $input.trigger("input");
                                                 }, 0);
                                                 }, 0);
                                             }
                                             }
                                         } else if (isSlctn) {
                                         } else if (isSlctn) {

ファイルの差分が大きいため隠しています
+ 37 - 37
dist/jquery.inputmask.bundle.min.js


ファイルの差分が大きいため隠しています
+ 41 - 41
dist/min/jquery.inputmask.js


+ 11 - 0
js/jquery.inputmask.js

@@ -1000,6 +1000,7 @@
 
 
                     //init vars
                     //init vars
                     var skipKeyPressEvent = false, //Safari 5.1.x - modal dialog fires keypress twice workaround
                     var skipKeyPressEvent = false, //Safari 5.1.x - modal dialog fires keypress twice workaround
+                        skipInputEvent = false, //skip when triggered from within inputmask
                         ignorable = false;
                         ignorable = false;
 
 
                     if (opts.numericInput) opts.isNumeric = opts.numericInput;
                     if (opts.numericInput) opts.isNumeric = opts.numericInput;
@@ -1115,6 +1116,10 @@
                             caret(input, 0, seekNext(getActiveMaskSet()["lastValidPosition"]));
                             caret(input, 0, seekNext(getActiveMaskSet()["lastValidPosition"]));
                         }, 0);
                         }, 0);
                     }).bind(pasteEvent + ".inputmask dragdrop.inputmask drop.inputmask", function (e) {
                     }).bind(pasteEvent + ".inputmask dragdrop.inputmask drop.inputmask", function (e) {
+                        if (skipInputEvent === true) {
+                            skipInputEvent = false;
+                            return true;
+                        }
                         var input = this, $input = $(input);
                         var input = this, $input = $(input);
 
 
                         //paste event for IE8 and lower I guess ;-)
                         //paste event for IE8 and lower I guess ;-)
@@ -1141,6 +1146,10 @@
 
 
                     if (androidchrome) {
                     if (androidchrome) {
                         $el.bind("input.inputmask", function (e) {
                         $el.bind("input.inputmask", function (e) {
+                            if (skipInputEvent === true) {
+                                skipInputEvent = false;
+                                return true;
+                            }
                             var input = this, $input = $(input);
                             var input = this, $input = $(input);
 
 
                             chromeValueOnInput = getActiveBuffer().join('');
                             chromeValueOnInput = getActiveBuffer().join('');
@@ -1608,6 +1617,8 @@
                                                 setTimeout(function () { //timeout needed for IE
                                                 setTimeout(function () { //timeout needed for IE
                                                     if (isComplete(buffer) === true)
                                                     if (isComplete(buffer) === true)
                                                         $input.trigger("complete");
                                                         $input.trigger("complete");
+                                                    skipInputEvent = true;
+                                                    $input.trigger("input");
                                                 }, 0);
                                                 }, 0);
                                             }
                                             }
                                         } else if (isSlctn) {
                                         } else if (isSlctn) {