Skip to content

Commit

Permalink
giving the opportunity to pass watchInputs locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Escobar committed Mar 20, 2016
1 parent 312b4d6 commit 8e9bfde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .versions
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
igorescobar:[email protected].7
igorescobar:[email protected].8
[email protected]
[email protected]
[email protected]
5 changes: 3 additions & 2 deletions src/jquery.mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@
options = options || {};
var selector = this.selector,
globals = $.jMaskGlobals,
interval = $.jMaskGlobals.watchInterval,
interval = globals.watchInterval,
watchInputs = options.watchInputs || globals.watchInputs,
maskFunction = function() {
if (notSameMaskObject(this, mask, options)) {
return $(this).data('mask', new Mask(this, mask, options));
Expand All @@ -441,7 +442,7 @@

$(this).each(maskFunction);

if (selector && selector !== '' && globals.watchInputs) {
if (selector && selector !== '' && watchInputs) {
clearInterval($.maskWatchers[selector]);
$.maskWatchers[selector] = setInterval(function(){
$(document).find(selector).each(maskFunction);
Expand Down

0 comments on commit 8e9bfde

Please sign in to comment.