浏览代码

Update jquery.inputmask.extentions.js

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

+ 2 - 1
jquery.inputmask.extentions.js

@@ -284,6 +284,7 @@ Optional extentions on the jquery.inputmask base
                             placeholder: "",
                             placeholder: "",
                             repeat: 10,
                             repeat: 10,
                             greedy: false,
                             greedy: false,
+                            numericInput: false, //true => not working fixme
                             regex: {
                             regex: {
                                 number: function(radixPoint, digits) { return new RegExp("^([\+\-]?[0-9]*[" + radixPoint + "]?[0-9]" + digits + ")$"); }
                                 number: function(radixPoint, digits) { return new RegExp("^([\+\-]?[0-9]*[" + radixPoint + "]?[0-9]" + digits + ")$"); }
                             },
                             },
@@ -291,7 +292,7 @@ Optional extentions on the jquery.inputmask base
                                 '~': { //real number
                                 '~': { //real number
                                     validator: function(chrs, buffer, pos, strict, opts) {
                                     validator: function(chrs, buffer, pos, strict, opts) {
                                         function digitExpression() {
                                         function digitExpression() {
-                                            return isNaN(opts.digits) ? opts.digits : '{0,' + opts.digits + '}';
+                                            return isNaN(opts.digits) ? opts.digits : (strict ? '{' + opts.digits + '}' : '{0,' + opts.digits + '}');
                                         }
                                         }
                                         var cbuf = buffer.slice(); cbuf[pos] = chrs;
                                         var cbuf = buffer.slice(); cbuf[pos] = chrs;
                                         var bufferStr = cbuf.join('');
                                         var bufferStr = cbuf.join('');