diff --git a/assets/front-end/js/view/filterable-gallery.js b/assets/front-end/js/view/filterable-gallery.js index 4e6dba0dc..2841739b1 100644 --- a/assets/front-end/js/view/filterable-gallery.js +++ b/assets/front-end/js/view/filterable-gallery.js @@ -93,7 +93,7 @@ /*! no static exports found */ /***/ (function(module, exports) { -eval("function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\njQuery(window).on(\"elementor/frontend/init\", function () {\n var filterableGalleryHandler = function filterableGalleryHandler($scope, $) {\n var filterControls = $scope.find(\".fg-layout-3-filter-controls\").eq(0),\n filterTrigger = $scope.find(\"#fg-filter-trigger\"),\n form = $scope.find(\".fg-layout-3-search-box\"),\n input = $scope.find(\"#fg-search-box-input\"),\n searchRegex,\n buttonFilter,\n timer;\n\n if (form.length) {\n form.on(\"submit\", function (e) {\n e.preventDefault();\n });\n }\n\n filterTrigger.on(\"click\", function () {\n filterControls.toggleClass(\"open-filters\");\n });\n filterTrigger.on(\"blur\", function () {\n filterControls.removeClass(\"open-filters\");\n });\n\n if (!isEditMode) {\n var $gallery = $(\".eael-filter-gallery-container\", $scope),\n $settings = $gallery.data(\"settings\"),\n fg_items = $gallery_items = $gallery.data(\"gallery-items\"),\n $layout_mode = $settings.grid_style === \"masonry\" ? \"masonry\" : \"fitRows\",\n $gallery_enabled = $settings.gallery_enabled === \"yes\",\n $images_per_page = $gallery.data(\"images-per-page\"),\n $init_show_setting = $gallery.data(\"init-show\");\n fg_items.splice(0, $init_show_setting); // init isotope\n\n var gwrap = $(\".eael-filter-gallery-wrapper\");\n var layoutMode = gwrap.data(\"layout-mode\");\n var mfpCaption = gwrap.data(\"mfp_caption\");\n var $isotope_gallery = $gallery.isotope({\n itemSelector: \".eael-filterable-gallery-item-wrap\",\n layoutMode: $layout_mode,\n percentPosition: true,\n stagger: 30,\n transitionDuration: $settings.duration + \"ms\",\n filter: function filter() {\n var $this = $(this);\n var $result = searchRegex ? $this.text().match(searchRegex) : true;\n\n if (buttonFilter === undefined) {\n if (layoutMode !== \"layout_3\") {\n buttonFilter = $scope.find(\".eael-filter-gallery-control ul li\").first().data(\"filter\");\n } else {\n buttonFilter = $scope.find(\".fg-layout-3-filter-controls li\").first().data(\"filter\");\n }\n }\n\n var buttonResult = buttonFilter ? $this.is(buttonFilter) : true;\n return $result && buttonResult;\n }\n }); // Popup\n\n $($scope).magnificPopup({\n delegate: \".eael-magnific-link.active\",\n type: \"image\",\n gallery: {\n enabled: $gallery_enabled\n },\n image: {\n titleSrc: function titleSrc(item) {\n if (mfpCaption === \"yes\") {\n return item.el.parents('.gallery-item-caption-over').find('.fg-item-title').html() || item.el.parents('.gallery-item-caption-wrap').find('.fg-item-title').html() || item.el.parents('.eael-filterable-gallery-item-wrap').find('.fg-item-title').html();\n }\n }\n }\n }); // filter\n\n $scope.on(\"click\", \".control\", function () {\n var $this = $(this);\n buttonFilter = $(this).attr(\"data-filter\");\n var initData = $(\".eael-filter-gallery-container .eael-filterable-gallery-item-wrap\" + buttonFilter, $scope).length;\n var $tspan = $scope.find(\"#fg-filter-trigger > span\");\n\n if ($tspan.length) {\n $tspan.text($this.text());\n }\n\n var firstInit = parseInt($this.data('first-init'));\n\n if (!firstInit) {\n $this.data('first-init', 1);\n var item_found = initData;\n var index_list = $items = [];\n\n var _iterator = _createForOfIteratorHelper(fg_items.entries()),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 2),\n index = _step$value[0],\n item = _step$value[1];\n\n if (buttonFilter !== '' && buttonFilter !== '*') {\n var element = $($(item)[0]);\n\n if (element.is(buttonFilter)) {\n ++item_found;\n $items.push($(item)[0]);\n }\n }\n\n if (item_found === $images_per_page) {\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (index_list.length > 0) {\n fg_items = fg_items.filter(function (item, index) {\n return !index_list.includes(index);\n });\n }\n }\n\n var LoadMoreShow = $(this).data(\"load-more-status\"),\n loadMore = $(\".eael-gallery-load-more\", $scope); //hide load more button if selected control have no item to show\n\n if (LoadMoreShow || fg_items.length < 1) {\n loadMore.hide();\n } else {\n loadMore.show();\n }\n\n $this.siblings().removeClass(\"active\");\n $this.addClass(\"active\");\n\n if (!firstInit && $items.length > 0) {\n $isotope_gallery.isotope({\n filter: buttonFilter\n });\n $gallery.append($items);\n $isotope_gallery.isotope('appended', $items);\n $isotope_gallery.imagesLoaded().progress(function () {\n $isotope_gallery.isotope(\"layout\");\n });\n } else {\n $isotope_gallery.isotope({\n filter: buttonFilter\n });\n }\n }); //quick search\n\n input.on(\"input\", function () {\n var $this = $(this);\n clearTimeout(timer);\n timer = setTimeout(function () {\n searchRegex = new RegExp($this.val(), \"gi\");\n $isotope_gallery.isotope();\n }, 600);\n }); // layout gal, while images are loading\n\n $isotope_gallery.imagesLoaded().progress(function () {\n $isotope_gallery.isotope(\"layout\");\n }); // layout gal, on click tabs\n\n $isotope_gallery.on(\"arrangeComplete\", function () {\n $isotope_gallery.isotope(\"layout\");\n }); // layout gal, after window loaded\n\n $(window).on(\"load\", function () {\n $isotope_gallery.isotope(\"layout\");\n }); // Load more button\n\n $scope.on(\"click\", \".eael-gallery-load-more\", function (e) {\n e.preventDefault();\n var $this = $(this),\n // $init_show = $(\".eael-filter-gallery-container\", $scope).children(\".eael-filterable-gallery-item-wrap\").length,\n // $total_items = $gallery.data(\"total-gallery-items\"),\n $nomore_text = $gallery.data(\"nomore-item-text\"),\n filter_enable = $(\".eael-filter-gallery-control\", $scope).length,\n $items = [];\n var filter_name = $(\".eael-filter-gallery-control li.active\", $scope).data('filter');\n\n if (filterControls.length > 0) {\n filter_name = $(\".fg-layout-3-filter-controls li.active\", $scope).data('filter');\n }\n\n var item_found = 0;\n var index_list = [];\n\n var _iterator2 = _createForOfIteratorHelper(fg_items.entries()),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _step2$value = _slicedToArray(_step2.value, 2),\n index = _step2$value[0],\n item = _step2$value[1];\n\n if (filter_name !== '' && filter_name !== '*' && filter_enable) {\n var element = $($(item)[0]);\n\n if (element.is(filter_name)) {\n ++item_found;\n $items.push($(item)[0]);\n index_list.push(index);\n }\n\n if (fg_items.length - 1 === index) {\n $(\".eael-filter-gallery-control li.active\", $scope).data('load-more-status', 1);\n $this.hide();\n }\n } else {\n ++item_found;\n $items.push($(item)[0]);\n index_list.push(index);\n }\n\n if (item_found === $images_per_page) {\n break;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n if (index_list.length > 0) {\n fg_items = fg_items.filter(function (item, index) {\n return !index_list.includes(index);\n });\n }\n\n if (fg_items.length < 1) {\n $this.html('
' + $nomore_text + \"
\");\n setTimeout(function () {\n $this.fadeOut(\"slow\");\n }, 600);\n } // append items\n\n\n $gallery.append($items);\n $isotope_gallery.isotope(\"appended\", $items);\n $isotope_gallery.imagesLoaded().progress(function () {\n $isotope_gallery.isotope(\"layout\");\n });\n }); // Fix issue on Safari: hide filter menu\n\n $(document).on('mouseup', function (e) {\n if (!filterTrigger.is(e.target) && filterTrigger.has(e.target).length === 0) {\n filterControls.removeClass(\"open-filters\");\n }\n });\n }\n };\n\n elementorFrontend.hooks.addAction(\"frontend/element_ready/eael-filterable-gallery.default\", filterableGalleryHandler);\n});\n\n//# sourceURL=webpack:///./src/js/view/filterable-gallery.js?"); +eval("function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\njQuery(window).on(\"elementor/frontend/init\", function () {\n var filterableGalleryHandler = function filterableGalleryHandler($scope, $) {\n var filterControls = $scope.find(\".fg-layout-3-filter-controls\").eq(0),\n filterTrigger = $scope.find(\"#fg-filter-trigger\"),\n form = $scope.find(\".fg-layout-3-search-box\"),\n input = $scope.find(\"#fg-search-box-input\"),\n searchRegex,\n buttonFilter,\n timer;\n\n if (form.length) {\n form.on(\"submit\", function (e) {\n e.preventDefault();\n });\n }\n\n filterTrigger.on(\"click\", function () {\n filterControls.toggleClass(\"open-filters\");\n });\n filterTrigger.on(\"blur\", function () {\n filterControls.removeClass(\"open-filters\");\n });\n\n if (!isEditMode) {\n var $gallery = $(\".eael-filter-gallery-container\", $scope),\n $settings = $gallery.data(\"settings\"),\n fg_items = $gallery_items = $gallery.data(\"gallery-items\"),\n $layout_mode = $settings.grid_style === \"masonry\" ? \"masonry\" : \"fitRows\",\n $gallery_enabled = $settings.gallery_enabled === \"yes\",\n $images_per_page = $gallery.data(\"images-per-page\"),\n $init_show_setting = $gallery.data(\"init-show\");\n fg_items.splice(0, $init_show_setting); // init isotope\n\n var gwrap = $(\".eael-filter-gallery-wrapper\");\n var layoutMode = gwrap.data(\"layout-mode\");\n var mfpCaption = gwrap.data(\"mfp_caption\");\n var $isotope_gallery = $gallery.isotope({\n itemSelector: \".eael-filterable-gallery-item-wrap\",\n layoutMode: $layout_mode,\n percentPosition: true,\n stagger: 30,\n transitionDuration: $settings.duration + \"ms\",\n filter: function filter() {\n var $this = $(this);\n var $result = searchRegex ? $this.text().match(searchRegex) : true;\n\n if (buttonFilter === undefined) {\n if (layoutMode !== \"layout_3\") {\n buttonFilter = $scope.find(\".eael-filter-gallery-control ul li\").first().data(\"filter\");\n } else {\n buttonFilter = $scope.find(\".fg-layout-3-filter-controls li\").first().data(\"filter\");\n }\n }\n\n var buttonResult = buttonFilter ? $this.is(buttonFilter) : true;\n return $result && buttonResult;\n }\n }); // Popup\n\n $($scope).magnificPopup({\n delegate: \".eael-magnific-link.active\",\n type: \"image\",\n gallery: {\n enabled: $gallery_enabled\n },\n image: {\n titleSrc: function titleSrc(item) {\n if (mfpCaption === \"yes\") {\n return item.el.parents('.gallery-item-caption-over').find('.fg-item-title').html() || item.el.parents('.gallery-item-caption-wrap').find('.fg-item-title').html() || item.el.parents('.eael-filterable-gallery-item-wrap').find('.fg-item-title').html();\n }\n }\n }\n }); // filter\n\n $scope.on(\"click\", \".control\", function () {\n var $this = $(this);\n buttonFilter = $(this).attr(\"data-filter\");\n var initData = $(\".eael-filter-gallery-container .eael-filterable-gallery-item-wrap\" + buttonFilter, $scope).length;\n var $tspan = $scope.find(\"#fg-filter-trigger > span\");\n\n if ($tspan.length) {\n $tspan.text($this.text());\n }\n\n var firstInit = parseInt($this.data('first-init'));\n\n if (!firstInit) {\n $this.data('first-init', 1);\n var item_found = initData;\n var index_list = $items = [];\n\n var _iterator = _createForOfIteratorHelper(fg_items.entries()),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 2),\n index = _step$value[0],\n item = _step$value[1];\n\n if (buttonFilter !== '' && buttonFilter !== '*') {\n var element = $($(item)[0]);\n\n if (element.is(buttonFilter)) {\n ++item_found;\n $items.push($(item)[0]);\n index_list.push(index);\n }\n }\n\n if (item_found === $images_per_page) {\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (index_list.length > 0) {\n fg_items = fg_items.filter(function (item, index) {\n return !index_list.includes(index);\n });\n }\n }\n\n var LoadMoreShow = $(this).data(\"load-more-status\"),\n loadMore = $(\".eael-gallery-load-more\", $scope); //hide load more button if selected control have no item to show\n\n if (LoadMoreShow || fg_items.length < 1) {\n loadMore.hide();\n } else {\n loadMore.show();\n }\n\n $this.siblings().removeClass(\"active\");\n $this.addClass(\"active\");\n\n if (!firstInit && $items.length > 0) {\n $isotope_gallery.isotope({\n filter: buttonFilter\n });\n $gallery.append($items);\n $isotope_gallery.isotope('appended', $items);\n $isotope_gallery.imagesLoaded().progress(function () {\n $isotope_gallery.isotope(\"layout\");\n });\n } else {\n $isotope_gallery.isotope({\n filter: buttonFilter\n });\n }\n }); //quick search\n\n input.on(\"input\", function () {\n var $this = $(this);\n clearTimeout(timer);\n timer = setTimeout(function () {\n searchRegex = new RegExp($this.val(), \"gi\");\n $isotope_gallery.isotope();\n }, 600);\n }); // layout gal, while images are loading\n\n $isotope_gallery.imagesLoaded().progress(function () {\n $isotope_gallery.isotope(\"layout\");\n }); // layout gal, on click tabs\n\n $isotope_gallery.on(\"arrangeComplete\", function () {\n $isotope_gallery.isotope(\"layout\");\n }); // layout gal, after window loaded\n\n $(window).on(\"load\", function () {\n $isotope_gallery.isotope(\"layout\");\n }); // Load more button\n\n $scope.on(\"click\", \".eael-gallery-load-more\", function (e) {\n e.preventDefault();\n var $this = $(this),\n // $init_show = $(\".eael-filter-gallery-container\", $scope).children(\".eael-filterable-gallery-item-wrap\").length,\n // $total_items = $gallery.data(\"total-gallery-items\"),\n $nomore_text = $gallery.data(\"nomore-item-text\"),\n filter_enable = $(\".eael-filter-gallery-control\", $scope).length,\n $items = [];\n var filter_name = $(\".eael-filter-gallery-control li.active\", $scope).data('filter');\n\n if (filterControls.length > 0) {\n filter_name = $(\".fg-layout-3-filter-controls li.active\", $scope).data('filter');\n }\n\n var item_found = 0;\n var index_list = [];\n\n var _iterator2 = _createForOfIteratorHelper(fg_items.entries()),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _step2$value = _slicedToArray(_step2.value, 2),\n index = _step2$value[0],\n item = _step2$value[1];\n\n if (filter_name !== '' && filter_name !== '*' && filter_enable) {\n var element = $($(item)[0]);\n\n if (element.is(filter_name)) {\n ++item_found;\n $items.push($(item)[0]);\n index_list.push(index);\n }\n\n if (fg_items.length - 1 === index) {\n $(\".eael-filter-gallery-control li.active\", $scope).data('load-more-status', 1);\n $this.hide();\n }\n } else {\n ++item_found;\n $items.push($(item)[0]);\n index_list.push(index);\n }\n\n if (item_found === $images_per_page) {\n break;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n if (index_list.length > 0) {\n fg_items = fg_items.filter(function (item, index) {\n return !index_list.includes(index);\n });\n }\n\n if (fg_items.length < 1) {\n $this.html('
' + $nomore_text + \"
\");\n setTimeout(function () {\n $this.fadeOut(\"slow\");\n }, 600);\n } // append items\n\n\n $gallery.append($items);\n $isotope_gallery.isotope(\"appended\", $items);\n $isotope_gallery.imagesLoaded().progress(function () {\n $isotope_gallery.isotope(\"layout\");\n });\n }); // Fix issue on Safari: hide filter menu\n\n $(document).on('mouseup', function (e) {\n if (!filterTrigger.is(e.target) && filterTrigger.has(e.target).length === 0) {\n filterControls.removeClass(\"open-filters\");\n }\n });\n }\n };\n\n elementorFrontend.hooks.addAction(\"frontend/element_ready/eael-filterable-gallery.default\", filterableGalleryHandler);\n});\n\n//# sourceURL=webpack:///./src/js/view/filterable-gallery.js?"); /***/ }) diff --git a/assets/front-end/js/view/filterable-gallery.min.js b/assets/front-end/js/view/filterable-gallery.min.js index e13c48ab5..5fa946ca7 100644 --- a/assets/front-end/js/view/filterable-gallery.min.js +++ b/assets/front-end/js/view/filterable-gallery.min.js @@ -1 +1 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}({10:function(e,t){function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return l=e.done,e},e:function(e){f=!0,a=e},f:function(){try{l||null==r.return||r.return()}finally{if(f)throw a}}}}function i(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r span");l.length&&l.text(i.text());var f=parseInt(i.data("first-init"));if(!f){i.data("first-init",1);var u,s=a,d=$items=[],g=n(p.entries());try{for(g.s();!(u=g.n()).done;){var y=r(u.value,2),v=(y[0],y[1]);if(""!==o&&"*"!==o)t(t(v)[0]).is(o)&&(++s,$items.push(t(v)[0]));if(s===m)break}}catch(e){g.e(e)}finally{g.f()}d.length>0&&(p=p.filter((function(e,t){return!d.includes(t)})))}var h=t(this).data("load-more-status"),b=t(".eael-gallery-load-more",e);h||p.length<1?b.hide():b.show(),i.siblings().removeClass("active"),i.addClass("active"),!f&&$items.length>0?(x.isotope({filter:o}),c.append($items),x.isotope("appended",$items),x.imagesLoaded().progress((function(){x.isotope("layout")}))):x.isotope({filter:o})})),s.on("input",(function(){var e=t(this);clearTimeout(a),a=setTimeout((function(){i=new RegExp(e.val(),"gi"),x.isotope()}),600)})),x.imagesLoaded().progress((function(){x.isotope("layout")})),x.on("arrangeComplete",(function(){x.isotope("layout")})),t(window).on("load",(function(){x.isotope("layout")})),e.on("click",".eael-gallery-load-more",(function(i){i.preventDefault();var o=t(this),a=c.data("nomore-item-text"),f=t(".eael-filter-gallery-control",e).length,u=[],s=t(".eael-filter-gallery-control li.active",e).data("filter");l.length>0&&(s=t(".fg-layout-3-filter-controls li.active",e).data("filter"));var d,g=0,y=[],v=n(p.entries());try{for(v.s();!(d=v.n()).done;){var h=r(d.value,2),b=h[0],w=h[1];if(""!==s&&"*"!==s&&f)t(t(w)[0]).is(s)&&(++g,u.push(t(w)[0]),y.push(b)),p.length-1===b&&(t(".eael-filter-gallery-control li.active",e).data("load-more-status",1),o.hide());else++g,u.push(t(w)[0]),y.push(b);if(g===m)break}}catch(e){v.e(e)}finally{v.f()}y.length>0&&(p=p.filter((function(e,t){return!y.includes(t)}))),p.length<1&&(o.html('
'+a+"
"),setTimeout((function(){o.fadeOut("slow")}),600)),c.append(u),x.isotope("appended",u),x.imagesLoaded().progress((function(){x.isotope("layout")}))})),t(document).on("mouseup",(function(e){f.is(e.target)||0!==f.has(e.target).length||l.removeClass("open-filters")}))}}))}))}}); \ No newline at end of file +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}({10:function(e,t){function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return l=e.done,e},e:function(e){f=!0,a=e},f:function(){try{l||null==r.return||r.return()}finally{if(f)throw a}}}}function i(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r span");l.length&&l.text(i.text());var f=parseInt(i.data("first-init"));if(!f){i.data("first-init",1);var u,s=a,d=$items=[],g=n(p.entries());try{for(g.s();!(u=g.n()).done;){var y=r(u.value,2),h=y[0],v=y[1];if(""!==o&&"*"!==o)t(t(v)[0]).is(o)&&(++s,$items.push(t(v)[0]),d.push(h));if(s===m)break}}catch(e){g.e(e)}finally{g.f()}d.length>0&&(p=p.filter((function(e,t){return!d.includes(t)})))}var b=t(this).data("load-more-status"),w=t(".eael-gallery-load-more",e);b||p.length<1?w.hide():w.show(),i.siblings().removeClass("active"),i.addClass("active"),!f&&$items.length>0?(x.isotope({filter:o}),c.append($items),x.isotope("appended",$items),x.imagesLoaded().progress((function(){x.isotope("layout")}))):x.isotope({filter:o})})),s.on("input",(function(){var e=t(this);clearTimeout(a),a=setTimeout((function(){i=new RegExp(e.val(),"gi"),x.isotope()}),600)})),x.imagesLoaded().progress((function(){x.isotope("layout")})),x.on("arrangeComplete",(function(){x.isotope("layout")})),t(window).on("load",(function(){x.isotope("layout")})),e.on("click",".eael-gallery-load-more",(function(i){i.preventDefault();var o=t(this),a=c.data("nomore-item-text"),f=t(".eael-filter-gallery-control",e).length,u=[],s=t(".eael-filter-gallery-control li.active",e).data("filter");l.length>0&&(s=t(".fg-layout-3-filter-controls li.active",e).data("filter"));var d,g=0,y=[],h=n(p.entries());try{for(h.s();!(d=h.n()).done;){var v=r(d.value,2),b=v[0],w=v[1];if(""!==s&&"*"!==s&&f)t(t(w)[0]).is(s)&&(++g,u.push(t(w)[0]),y.push(b)),p.length-1===b&&(t(".eael-filter-gallery-control li.active",e).data("load-more-status",1),o.hide());else++g,u.push(t(w)[0]),y.push(b);if(g===m)break}}catch(e){h.e(e)}finally{h.f()}y.length>0&&(p=p.filter((function(e,t){return!y.includes(t)}))),p.length<1&&(o.html('
'+a+"
"),setTimeout((function(){o.fadeOut("slow")}),600)),c.append(u),x.isotope("appended",u),x.imagesLoaded().progress((function(){x.isotope("layout")}))})),t(document).on("mouseup",(function(e){f.is(e.target)||0!==f.has(e.target).length||l.removeClass("open-filters")}))}}))}))}}); \ No newline at end of file diff --git a/src/js/view/filterable-gallery.js b/src/js/view/filterable-gallery.js index a8deee103..373f12644 100644 --- a/src/js/view/filterable-gallery.js +++ b/src/js/view/filterable-gallery.js @@ -99,6 +99,7 @@ jQuery(window).on("elementor/frontend/init", function () { if (element.is(buttonFilter)) { ++item_found; $items.push($(item)[0]); + index_list.push(index); } }