Browse Source

fix maskjump for multimask

Robin Herbots 11 years ago
parent
commit
a59c0906a8
2 changed files with 3 additions and 2 deletions
  1. 1 2
      js/jquery.inputmask.js
  2. 2 0
      js/jquery.inputmask.phone.extensions.js

+ 1 - 2
js/jquery.inputmask.js

@@ -578,7 +578,7 @@
                 var position = pos;
                 if (position <= 0) return 0;
 
-                while (--position > 0 && !isMask(position) /*&& (opts.nojumps !== true || opts.nojumpsThreshold > position)*/) {
+                while (--position > 0 && !isMask(position)) {
                 };
                 return position;
             }
@@ -1353,7 +1353,6 @@
 
         function multiMaskScope(el, masksets, opts) {
             var $el = $(el);
-            opts.nojumps = true;
             function mcaret(input, begin, end) {
                 var npt = input.jquery && input.length > 0 ? input[0] : input, range;
                 if (typeof begin == 'number') {

+ 2 - 0
js/jquery.inputmask.phone.extensions.js

@@ -45,6 +45,7 @@ When using this extension make sure you specify the correct url to get the masks
                 maskList.splice(0, 0, "+p(ppp)ppp-pppp");
                 return maskList;
             },
+            nojumps: true,
             nojumpsThreshold: 1
         },
         'phonebe': {
@@ -73,6 +74,7 @@ When using this extension make sure you specify the correct url to get the masks
                 maskList.splice(0, 0, "+32(ppp)ppp-pppp");
                 return maskList;
             },
+            nojumps: true,
             nojumpsThreshold: 4
         }
     });