浏览代码

Merge pull request #313 from tmikus/2.x

Fixed problem with 'integer' mask on IE 7.
Robin Herbots 12 年之前
父节点
当前提交
da9985160a
共有 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: {
                 number: function (opts) {
                     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 + "})?)+)$");
                 }
             },