inputmask.binding.js 967 B

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