inputmask.binding.js 943 B

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