{"version":3,"sources":["js/loader.js"],"names":["$","Drupal","drupalSettings","length","prepend","on","this","checkValidity","show","window","hide","timeoutId","document","ajaxStart","setTimeout","ajaxStop","clearTimeout","jQuery"],"mappings":"CAAA,SAAWA,EAAGC,EAAQC,GACpB,aAQiC,IAA7BF,EAAE,gBAAgBG,QACpBH,EAAE,QAAQI,QAAQ,mCAIpBJ,EAAE,QAAQK,GAAG,UAAU,WACjBC,KAAKC,iBACPP,EAAE,qBAAqBQ,UAM3BR,EAAES,QAAQJ,GAAG,kBAAkB,WAC7BL,EAAE,qBAAqBU,UAMzB,IAAIC,EAAY,KAChBX,EAAEY,UAAUC,WAAU,WACpBF,EAAYG,YAAW,WACrBd,EAAE,qBAAqBQ,SACtB,QACFO,UAAS,WACVC,aAAaL,GACbX,EAAE,qBAAqBU,UApC3B,CAuCGO,OAAQhB,OAAQC","file":"loader.js","sourcesContent":["(function ($, Drupal, drupalSettings) {\n 'use strict';\n\n //\n // ²ÝÝ®ÎÛÊÓƵµ¼º½ 'Rex Appeal' Throbber.\n //\n\n // If the Rex loader does not exist, we are likely dealing\n // with the Admin theme. Dynamically add applicable div...\n if ($('.rex-loading').length === 0) {\n $('body').prepend('
');\n }\n\n // ...and attach submission event listener to any forms.\n $('form').on('submit', function () {\n if (this.checkValidity()) {\n $('body .rex-loading').show();\n }\n });\n\n // Make sure it is hidden when page has loaded. Also make sure it is\n // hidden right before page 'unload' to set desired state in bfcache.\n $(window).on('load, pagehide', function () {\n $('body .rex-loading').hide();\n });\n\n // Also connect display with any Ajax calls.\n // Use a quick 1s timeout to prevent any 'flash' of\n // the throbber if Ajax call has already completed.\n var timeoutId = null;\n $(document).ajaxStart(function () {\n timeoutId = setTimeout(function () {\n $('body .rex-loading').show();\n }, 1000);\n }).ajaxStop(function () {\n clearTimeout(timeoutId);\n $('body .rex-loading').hide();\n });\n\n})(jQuery, Drupal, drupalSettings);\n"]}