ソースを参照

Fixed problem with 'integer' mask on IE 7.
Generated expression for signs looked like '[]?' which caused problem on that browser - it expects at least one character in a regexp group.

Tomasz Mikuś 12 年 前
コミット
35657d771e
1 ファイル変更1 行追加1 行削除
  1. 1 1
      js/jquery.inputmask.numeric.extensions.js

+ 1 - 1
js/jquery.inputmask.numeric.extensions.js

@@ -159,7 +159,7 @@ Optional extensions on the jquery.inputmask base
             regex: {
             regex: {
                 number: function (opts) {
                 number: function (opts) {
                     var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                     var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
-                    var signedExpression = "[" + (opts.allowPlus ? "\+" : "") + (opts.allowMinus ? "-" : "") + "]?";
+                    var signedExpression = opts.allowPlus || opts.allowMinus ? "[" + (opts.allowPlus ? "\+" : "") + (opts.allowMinus ? "-" : "") + "]?" : "";
                     return new RegExp("^" + signedExpression + "(\\d+|\\d{1," + opts.groupSize + "}((" + escapedGroupSeparator + "\\d{" + opts.groupSize + "})?)+)$");
                     return new RegExp("^" + signedExpression + "(\\d+|\\d{1," + opts.groupSize + "}((" + escapedGroupSeparator + "\\d{" + opts.groupSize + "})?)+)$");
                 }
                 }
             },
             },