ソースを参照

Need to check and see if both methods exists.

In our use case we only used the get override and did not have a set
method.
Andrew Spear 12 年 前
コミット
cdafe1b4f4
1 ファイル変更2 行追加2 行削除
  1. 2 2
      js/jquery.inputmask.js

+ 2 - 2
js/jquery.inputmask.js

@@ -1157,8 +1157,8 @@
                                 npt._valueSet = function (value) { this.value = isRTL ? value.split('').reverse().join('') : value; };
                             }
                             if ($.valHooks.text == undefined || $.valHooks.text.inputmaskpatch != true) {
-                                var valueGet = $.valHooks.text ? $.valHooks.text.get : function () { return this.value; };
-                                var valueSet = $.valHooks.text ? $.valHooks.text.set : function (value) { return this.value = value; };
+                                var valueGet = $.valHooks.text && $.valHooks.text.get ? $.valHooks.text.get : function () { return this.value; };
+                                var valueSet = $.valHooks.text && $.valHooks.text.set ? $.valHooks.text.set : function (value) { return this.value = value; };
 
                                 jQuery.extend($.valHooks, {
                                     text: {