labelPlugin.js 1016 Bytes
Newer Older
Joe TS Dell's avatar
Joe TS Dell committed
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
(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.labelPlugin = factory());
}(this, (function () { 'use strict';

  function labelPlugin() {
      return function (fp) {
          return {
              onReady: function () {
                  var id = fp.input.id;
                  if (!id) {
                      return;
                  }
                  if (fp.mobileInput) {
                      fp.input.removeAttribute("id");
                      fp.mobileInput.id = id;
                  }
                  else if (fp.altInput) {
                      fp.input.removeAttribute("id");
                      fp.altInput.id = id;
                  }
                  fp.loadedPlugins.push("labelPlugin");
              },
          };
      };
  }

  return labelPlugin;

})));