1/******/ (function() { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3
4/***/ "./plugins/teft-cards/src/block-library/grid-dynamic/frontend.js": 5/*!***********************************************************************!*\ 6 !*** ./plugins/teft-cards/src/block-library/grid-dynamic/frontend.js ***! 7 \***********************************************************************/ 8/***/ (function() { 9 10var endpoint = window.teftCardsFrontend.rest + 'teft-cards/v1/get-render'; 11function loadMore(button, block) { 12 button.disabled = true; 13 var loadingAnimation = setTimeout(function () { 14 block.classList.add('loading'); 15 }, 1000); 16 fetch(endpoint + '?args=' + JSON.stringify(button.dataset)).then(function (response) { 17 return response.json(); 18 }).then(function (data) { 19 if (data) { 20 clearTimeout(loadingAnimation); 21 block.classList.remove('loading'); 22 block.querySelector('.teft-cards-grid').innerHTML += data.content; 23 button.dataset.offset = parseInt(button.dataset.offset, 10) + parseInt(button.dataset.perpage, 10); 24 button.disabled = false; 25 if (!data.nextContent) { 26 button.disabled = true; 27 button.classList.add('inactive'); 28 } 29 } 30 }); 31} 32var dynamicCardBlocks = document.querySelectorAll('.teft-cards-grid-dynamic.has-load-more'); 33var _loop = function _loop() { 34 var block = dynamicCardBlocks[i]; 35 var loadMoreButton = block.querySelector('.teft-cards-grid--load-more'); 36 loadMoreButton.addEventListener('click', function (e) { 37 return loadMore(e.target, block); 38 }); 39}; 40for (var i = 0; i < dynamicCardBlocks.length; i++) { 41 _loop(); 42} 43 44/***/ })
vendor: 3,655 bytes, lines 44-131
44 45 46/******/ }); 47/************************************************************************/ 48/******/ // The module cache 49/******/ var __webpack_module_cache__ = {}; 50/******/ 51/******/ // The require function 52/******/ function __webpack_require__(moduleId) { 53/******/ // Check if module is in cache 54/******/ var cachedModule = __webpack_module_cache__[moduleId]; 55/******/ if (cachedModule !== undefined) { 56/******/ return cachedModule.exports; 57/******/ } 58/******/ // Create a new module (and put it into the cache) 59/******/ var module = __webpack_module_cache__[moduleId] = { 60/******/ // no module.id needed 61/******/ // no module.loaded needed 62/******/ exports: {} 63/******/ }; 64/******/ 65/******/ // Execute the module function 66/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 67/******/ 68/******/ // Return the exports of the module 69/******/ return module.exports; 70/******/ } 71/******/ 72/************************************************************************/ 73/******/ /* webpack/runtime/compat get default export */ 74/******/ !function() { 75/******/ // getDefaultExport function for compatibility with non-harmony modules 76/******/ __webpack_require__.n = function(module) { 77/******/ var getter = module && module.__esModule ? 78/******/ function() { return module['default']; } : 79/******/ function() { return module; }; 80/******/ __webpack_require__.d(getter, { a: getter }); 81/******/ return getter; 82/******/ }; 83/******/ }(); 84/******/ 85/******/ /* webpack/runtime/define property getters */ 86/******/ !function() { 87/******/ // define getter functions for harmony exports 88/******/ __webpack_require__.d = function(exports, definition) { 89/******/ for(var key in definition) { 90/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 91/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 92/******/ } 93/******/ } 94/******/ }; 95/******/ }(); 96/******/ 97/******/ /* webpack/runtime/hasOwnProperty shorthand */ 98/******/ !function() { 99/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 100/******/ }(); 101/******/ 102/******/ /* webpack/runtime/make namespace object */ 103/******/ !function() { 104/******/ // define __esModule on exports 105/******/ __webpack_require__.r = function(exports) { 106/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 107/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 108/******/ } 109/******/ Object.defineProperty(exports, '__esModule', { value: true }); 110/******/ }; 111/******/ }(); 112/******/ 113/************************************************************************/ 114var __webpack_exports__ = {}; 115// This entry need to be wrapped in an IIFE because it need to be in strict mode. 116!function() { 117"use strict"; 118/*!********************************************!*\ 119 !*** ./plugins/teft-cards/src/frontend.js ***! 120 \********************************************/ 121__webpack_require__.r(__webpack_exports__); 122/* harmony import */ var _block_library_grid_dynamic_frontend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./block-library/grid-dynamic/frontend */ "./plugins/teft-cards/src/block-library/grid-dynamic/frontend.js"); 123/* harmony import */ var _block_library_grid_dynamic_frontend__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_block_library_grid_dynamic_frontend__WEBPACK_IMPORTED_MODULE_0__); 124/** 125 * Internal dependencies 126 */ 127 128}(); 129/******/ })() 130; 131//# sourceMappingURL=frontend.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.