inputmask.binding.js 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. /*!
  2. * bindings/inputmask.binding.js
  3. * https://github.com/RobinHerbots/Inputmask
  4. * Copyright (c) 2010 - 2019 Robin Herbots
  5. * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. * Version: 4.0.9
  7. */
  8. (function(factory) {
  9. if (typeof define === "function" && define.amd) {
  10. define([ "jquery", "../inputmask", "../global/window" ], factory);
  11. } else if (typeof exports === "object") {
  12. module.exports = factory(require("jquery"), require("../inputmask"), require("../global/window"));
  13. } else {
  14. factory(jQuery, window.Inputmask, window);
  15. }
  16. })(function($, Inputmask, window) {
  17. $(window.document).ajaxComplete(function(event, xmlHttpRequest, ajaxOptions) {
  18. if ($.inArray("html", ajaxOptions.dataTypes) !== -1) {
  19. $(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function(ndx, lmnt) {
  20. if (lmnt.inputmask === undefined) {
  21. Inputmask().mask(lmnt);
  22. }
  23. });
  24. }
  25. }).ready(function() {
  26. $(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function(ndx, lmnt) {
  27. if (lmnt.inputmask === undefined) {
  28. Inputmask().mask(lmnt);
  29. }
  30. });
  31. });
  32. });