-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
inputmask.binding.js
31 lines (31 loc) · 967 Bytes
/
inputmask.binding.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
Input Mask plugin binding
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) Robin Herbots
Licensed under the MIT license
*/
(function (factory) {
factory(jQuery, window.Inputmask, window);
})(function ($, Inputmask, window) {
$(window.document)
.ajaxComplete(function (event, xmlHttpRequest, ajaxOptions) {
if ($.inArray("html", ajaxOptions.dataTypes) !== -1) {
$(
".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias], [data-inputmask-regex]"
).each(function (ndx, lmnt) {
if (lmnt.inputmask === undefined) {
Inputmask().mask(lmnt);
}
});
}
})
.ready(function () {
$(
".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias],[data-inputmask-regex]"
).each(function (ndx, lmnt) {
if (lmnt.inputmask === undefined) {
Inputmask().mask(lmnt);
}
});
});
});