1/*! elementor-pro - v3.13.2 - 22-05-2023 */ 2"use strict"; 3(self["webpackChunkelementor_tenweb"] = self["webpackChunkelementor_tenweb"] || []).push([["gallery"],{ 4 5
5/***/ "../modules/gallery/assets/js/frontend/handler.js": 6 /*!********************************************************!*\ 7 !*** ../modules/gallery/assets/js/frontend/handler.js ***! 8 \********************************************************/ 9 /***/ ((__unused_webpack_module, exports) => { 10 11 12 13 Object.defineProperty(exports, "__esModule", ({ 14 value: true 15 })); 16 exports["default"] = void 0; 17 18 class galleryHandler extends elementorModules.frontend.handlers.Base { 19 getDefaultSettings() { 20 return { 21 selectors: { 22 container: '.elementor-gallery__container', 23 galleryTitles: '.elementor-gallery-title', 24 twbbGalleryImageDiv: '.twbb_item_image_section', 25 galleryImages: '.e-gallery-image', 26 galleryItemOverlay: '.elementor-gallery-item__overlay', 27 galleryItemContent: '.elementor-gallery-item__content' 28 }, 29 classes: { 30 activeTitle: 'elementor-item-active' 31 } 32 }; 33 } 34 35 getDefaultElements() { 36 const { 37 selectors 38 } = this.getSettings(), 39 elements = { 40 $container: this.$element.find(selectors.container), 41 $titles: this.$element.find(selectors.galleryTitles) 42 }; 43 elements.$items = elements.$container.children(); 44 elements.$images = elements.$items.children(selectors.twbbGalleryImageDiv).children(selectors.galleryImages); 45 elements.$itemsOverlay = elements.$items.children(selectors.twbbGalleryImageDiv).children(selectors.galleryItemOverlay); 46 elements.$itemsContent = elements.$items.children(selectors.galleryItemContent); 47 elements.$itemsContentElements = elements.$itemsContent.children(); 48 return elements; 49 } 50 51 getGallerySettings() { 52 const settings = this.getElementSettings(), 53 activeBreakpoints = elementorFrontend.config.responsive.activeBreakpoints, 54 activeBreakpointsKeys = Object.keys(activeBreakpoints), 55 breakPointSettings = {}, 56 desktopIdealRowHeight = elementorFrontend.getDeviceSetting('desktop', settings, 'ideal_row_height'); 57 activeBreakpointsKeys.forEach(breakpoint => { 58 // The Gallery widget currently does not support widescreen. 59 if ('widescreen' !== breakpoint) { 60 const idealRowHeight = elementorFrontend.getDeviceSetting(breakpoint, settings, 'ideal_row_height'); 61 breakPointSettings[activeBreakpoints[breakpoint].value] = { 62 horizontalGap: elementorFrontend.getDeviceSetting(breakpoint, settings, 'hgap').size, 63 verticalGap: elementorFrontend.getDeviceSetting(breakpoint, settings, 'gap').size, 64 columns: elementorFrontend.getDeviceSetting(breakpoint, settings, 'columns'), 65 idealRowHeight: idealRowHeight?.size 66 }; 67 } 68 }); 69 return { 70 type: settings.gallery_layout, 71 idealRowHeight: desktopIdealRowHeight?.size, 72 container: this.elements.$container, 73 columns: settings.columns, 74 aspectRatio: settings.aspect_ratio, 75 lastRow: 'normal', 76 horizontalGap: elementorFrontend.getDeviceSetting('desktop', settings, 'hgap').size, 77 verticalGap: elementorFrontend.getDeviceSetting('desktop', settings, 'gap').size, 78 animationDuration: settings.content_animation_duration, 79 breakpoints: breakPointSettings, 80 rtl: elementorFrontend.config.is_rtl, 81 lazyLoad: 'yes' === settings.lazyload 82 }; 83 } 84 85 initGallery() { 86 this.gallery = new EGallery(this.getGallerySettings()); 87 this.toggleAllAnimationsClasses(); 88 } 89 90 removeAnimationClasses($element) { 91 $element.removeClass((index, className) => (className.match(/elementor-animated-item-\S+/g) || []).join(' ')); 92 } 93 94 toggleOverlayHoverAnimation() { 95 this.removeAnimationClasses(this.elements.$itemsOverlay); 96 const hoverAnimation = this.getElementSettings('background_overlay_hover_animation'); 97 98 if (hoverAnimation) { 99 this.elements.$itemsOverlay.addClass('elementor-animated-item--' + hoverAnimation); 100 } 101 } 102 103 toggleOverlayContentAnimation() { 104 this.removeAnimationClasses(this.elements.$itemsContentElements); 105 const contentHoverAnimation = this.getElementSettings('content_hover_animation'); 106 107 if (contentHoverAnimation) { 108 this.elements.$itemsContentElements.addClass('elementor-animated-item--' + contentHoverAnimation); 109 } 110 } 111 112 toggleOverlayContentSequencedAnimation() { 113 this.elements.$itemsContent.toggleClass('elementor-gallery--sequenced-animation', 'yes' === this.getElementSettings('content_sequenced_animation')); 114 } 115 116 toggleImageHoverAnimation() { 117 const imageHoverAnimation = this.getElementSettings('image_hover_animation'); 118 this.removeAnimationClasses(this.elements.$images); 119 120 if (imageHoverAnimation) { 121 this.elements.$images.addClass('elementor-animated-item--' + imageHoverAnimation); 122 } 123 } 124
125 toggleAllAnimationsClasses() { 126 const elementSettings = this.getElementSettings(), 127 animation = elementSettings.background_overlay_hover_animation || elementSettings.content_hover_animation || elementSettings.image_hover_animation; 128 this.elements.$items.toggleClass('elementor-animated-content', !!animation); 129 this.toggleImageHoverAnimation(); 130 this.toggleOverlayHoverAnimation(); 131 this.toggleOverlayContentAnimation(); 132 this.toggleOverlayContentSequencedAnimation(); 133 } 134 135 toggleAnimationClasses(settingKey) { 136 if ('content_sequenced_animation' === settingKey) { 137 this.toggleOverlayContentSequencedAnimation(); 138 } 139 140 if ('background_overlay_hover_animation' === settingKey) { 141 this.toggleOverlayHoverAnimation(); 142 } 143 144 if ('content_hover_animation' === settingKey) { 145 this.toggleOverlayContentAnimation(); 146 } 147 148 if ('image_hover_animation' === settingKey) { 149 this.toggleImageHoverAnimation(); 150 } 151 } 152 153 setGalleryTags(id) { 154 this.gallery.setSettings('tags', 'all' === id ? [] : ['' + id]); 155 } 156 157 bindEvents() { 158 this.elements.$titles.on('click', this.galleriesNavigationListener.bind(this)).on('keyup', event => { 159 const ENTER_KEY = 13, 160 SPACE_KEY = 32; 161 if (ENTER_KEY === event.keyCode || SPACE_KEY === event.keyCode) { 162 event.currentTarget.click(); 163 } 164 }); 165 } 166 galleriesNavigationListener(event) { 167 const classes = this.getSettings('classes'), 168 clickedElement = jQuery(event.target); // Make sure no other gallery title has an active class 169 170 this.elements.$titles.removeClass(classes.activeTitle); // Give the gallery being activated the active class 171
172 clickedElement.addClass(classes.activeTitle); 173 this.setGalleryTags(clickedElement.data('gallery-index')); 174 175 const updateLightboxGroup = () => this.setLightboxGalleryIndex(clickedElement.data('gallery-index')); // Wait for the gallery to filter before grouping items for the Light-box 176 177 178 setTimeout(updateLightboxGroup, 1000); 179 } 180 181 setLightboxGalleryIndex() { 182 let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; 183 184 if ('all' === index) { 185 return this.elements.$items.attr('data-elementor-lightbox-slideshow', 'all_' + this.getID()); 186 } 187 188 this.elements.$items.not('.e-gallery-item--hidden').attr('data-elementor-lightbox-slideshow', index + '_' + this.getID()); 189 } 190 191 onInit() { 192 super.onInit(...arguments); 193 194 if (elementorFrontend.isEditMode() && 1 <= this.$element.find('.elementor-widget-empty-icon').length) { 195 this.$element.addClass('elementor-widget-empty'); 196 } 197 198 if (!this.elements.$container.length) { 199 return; 200 } 201 202 this.initGallery(); 203 this.elements.$titles.first().trigger('click'); 204 } 205 206 getSettingsDictionary() { 207 if (this.settingsDictionary) { 208 return this.settingsDictionary; 209 } 210 211 const activeBreakpoints = elementorFrontend.config.responsive.activeBreakpoints, 212 activeBreakpointsKeys = Object.keys(activeBreakpoints); 213 const settingsDictionary = { 214 columns: ['columns'], 215 gap: ['verticalGap'], 216 hgap: ['horizontalGap'], 217 ideal_row_height: ['idealRowHeight'] 218 }; 219 activeBreakpointsKeys.forEach(breakpoint => { 220 // The Gallery widget currently does not support widescreen. 221 if ('widescreen' === breakpoint) { 222 return; 223 } 224 225 settingsDictionary['columns_' + breakpoint] = ['breakpoints.' + activeBreakpoints[breakpoint].value + '.columns']; 226 settingsDictionary['gap_' + breakpoint] = ['breakpoints.' + activeBreakpoints[breakpoint].value + '.verticalGap']; 227 settingsDictionary['hgap_' + breakpoint] = ['breakpoints.' + activeBreakpoints[breakpoint].value + '.horizontalGap']; 228 settingsDictionary['ideal_row_height_' + breakpoint] = ['breakpoints.' + activeBreakpoints[breakpoint].value + '.idealRowHeight']; 229 }); 230 settingsDictionary.aspect_ratio = ['aspectRatio']; 231 this.settingsDictionary = settingsDictionary; 232 return this.settingsDictionary; 233 } 234 235 onElementChange(settingKey) { 236 if (-1 !== ['background_overlay_hover_animation', 'content_hover_animation', 'image_hover_animation', 'content_sequenced_animation'].indexOf(settingKey)) { 237 this.toggleAnimationClasses(settingKey); 238 return; 239 } 240 241 const settingsDictionary = this.getSettingsDictionary(); 242 const settingsToUpdate = settingsDictionary[settingKey]; 243 244 if (settingsToUpdate) { 245 const gallerySettings = this.getGallerySettings(); 246 settingsToUpdate.forEach(settingToUpdate => { 247 this.gallery.setSettings(settingToUpdate, this.getItems(gallerySettings, settingToUpdate)); 248 }); 249 } 250 } 251 252 onDestroy() { 253 super.onDestroy(); 254 255 if (this.gallery) { 256 this.gallery.destroy(); 257 } 258 } 259 260 } 261 262 exports["default"] = galleryHandler; 263 264 /***/ })
264 265 266}]); 267//# sourceMappingURL=gallery.e5ba72e3c57da531df85.bundle.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.