浏览代码

fix change event

Robin Herbots 13 年之前
父节点
当前提交
eaa7215a06
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      js/jquery.inputmask.js

+ 3 - 3
js/jquery.inputmask.js

@@ -533,6 +533,9 @@ This plugin is based on the masked input plugin written by Josh Bush (digitalbus
                 }).bind("blur.inputmask", function() {
                 }).bind("blur.inputmask", function() {
                     var $input = $(this), input = this, nptValue = input._valueGet();
                     var $input = $(this), input = this, nptValue = input._valueGet();
                     $input.removeClass('focus.inputmask');
                     $input.removeClass('focus.inputmask');
+                    if (nptValue != undoBuffer) {
+                        $input.change();
+                    }
                     if (opts.clearMaskOnLostFocus) {
                     if (opts.clearMaskOnLostFocus) {
                         if (nptValue == _buffer.join(''))
                         if (nptValue == _buffer.join(''))
                             input._valueSet('');
                             input._valueSet('');
@@ -553,9 +556,6 @@ This plugin is based on the masked input plugin written by Josh Bush (digitalbus
                             }
                             }
                         }
                         }
                     }
                     }
-                    if (input._valueGet() != undoBuffer) {
-                        $input.change();
-                    }
                 }).bind("focus.inputmask", function() {
                 }).bind("focus.inputmask", function() {
                     var $input = $(this), input = this;
                     var $input = $(this), input = this;
                     $input.addClass('focus.inputmask');
                     $input.addClass('focus.inputmask');