/* |-------------------------------------------------------------------------- | apola.core.js |-------------------------------------------------------------------------- | Defines core object. */ ;(function($){ 'use strict'; $.Apola = { RTL: getComputedStyle( document.body ).direction === 'rtl', isTouch: $('html').hasClass('apo-touchevents'), TRANSITIONEND : "webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend", ANIMATIONEND: "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", modules: { languageSwitcher: function() { $('body').on('click.ApoloLanguageSwitcher', '.apo-language-switcher .apo-language-switcher-current', function(e) { var $parent = $(this).closest('.apo-language-switcher'); if($parent.length) $parent.toggleClass('apo-language-switcher-opened'); e.preventDefault(); }); }, animatedContent : function(delay, collection) { if(!$.fn.appear) return; collection = collection ? collection : $('[data-animation]'); collection = collection.not('[data-animation="none"]'); if(!collection.length) return; setTimeout(function() { collection.addClass('animated'); $("[data-animation]").each(function() { var self = $(this), scrollFactor = self.data('scroll-factor') ? self.data('scroll-factor') : -240; if($(window).width() > 767) { self.appear(function() { var delay = (self.attr("data-animation-delay") ? self.attr("data-animation-delay") : 1); if(delay > 1) self.css("animation-delay", delay + "ms"); self.addClass("apo-visible " + self.attr("data-animation")); self.on($.Apola.ANIMATIONEND, function(){ self.addClass('apo-animation-end'); }); }, {accX: 0, accY: scrollFactor}); } else { self.addClass("apo-visible"); } }); }, delay ? delay : 0); return collection; }, isotopeEffect: { _config: { itemTarget: '.apo-project, .apo-entry', itemBaseElement: '.apo-project-media, .apo-entry-media', timeout: 1500, delayInterval: 100 }, init: function( containers, collection, config ) { var _self = this; if( !containers || !containers.length ) return; config = $.isPlainObject( config ) ? $.extend( true, {}, this._config, config ) : this._config; containers.each(function(index, element) { _self.initEffect( $(element), collection, config ); }); }, initEffect: function($container, collection, config) { var _self = this, $targets, $baseElements; if( $container.data('isotopeEffect') ) return; if(collection && collection.length) { collection.each(function(index, element){ var $element = $(element), $target = $element.find( config.itemTarget ), $baseElement = $element.find( config.itemBaseElement ); if( $target.length && $baseElement.length ) { $baseElement.css('width', $baseElement.outerWidth()).addClass('apo-isotope-effect'); if( index > 0 ) $target.css('transition-delay', index * config.delayInterval + 'ms'); $target.addClass('apo-isotope-effect').on($.Apola.TRANSITIONEND, function(event) { if(event.originalEvent.propertyName !== 'width') return; var $this = $(this); $this.removeClass('apo-isotope-effect apo-isotope-effect-loaded'); $this.find(config.itemBaseElement).removeClass('apo-isotope-effect').css('width', 'auto'); event.stopPropagation(); }); setTimeout(function(){ $target.addClass('apo-isotope-effect-loaded'); }, config.timeout); } }); $container.data('isotopeEffect', true).removeClass('apo-isotope-has-slide-effect apo-parallax-grid-has-slide-effect'); return; } $targets = $container.find( config.itemTarget ); $baseElements = $container.find( config.itemBaseElement ); if( $baseElements.length ) { $baseElements.each(function(index, element){ var $element = $(element); $element.css('width', $element.outerWidth()); }); $baseElements.addClass('apo-isotope-effect'); } if( $targets.length ) { $targets.addClass('apo-isotope-effect').each(function(index, element){ var $element = $(element); if( index > 0 ) $element.css('transition-delay', index * config.delayInterval + 'ms'); }).on($.Apola.TRANSITIONEND, function(event) { if(event.originalEvent.propertyName !== 'width') return; var $this = $(this); $this.removeClass('apo-isotope-effect apo-isotope-effect-loaded'); $this.find(config.itemBaseElement).removeClass('apo-isotope-effect').css('width', 'auto'); }); setTimeout(function(){ $targets.addClass('apo-isotope-effect-loaded'); }, config.timeout); } $container.data('isotopeEffect', true).removeClass('apo-isotope-has-slide-effect apo-parallax-grid-has-slide-effect'); } }, stickySection: { STICKYPADDING: 10, MAXSTICKYHEIGHT: 90, init: function(){ this.body = $('body'); this.sticky = $('#apo-header').find('.apo-sticky'); if(!this.sticky.length) return; this.bindEvents(); this.updateDocumentState(); }, updateDocumentState: function(){ var self = this, $adminBar = $('#wpadminbar'); if(self.resizeTimeoutId) clearTimeout(self.resizeTimeoutId); self.resizeTimeoutId = setTimeout(function(){ self.reset(); self.sticky.removeAttr('style'); if($(window).width() < 768) return; self.stickyHeight = self.sticky.outerHeight(); self.stickyOffsetTop = self.sticky.offset().top; if($adminBar.length && ($adminBar.outerHeight() - self.stickyOffsetTop > 0)) { self.stickyOffsetTop += ($adminBar.outerHeight() - self.stickyOffsetTop); } if(self.stickyHeight > self.MAXSTICKYHEIGHT){ self.needScale = true; self.defPaddingTop = parseInt(self.sticky.css('padding-top'), 10); self.defPaddingBottom = parseInt(self.sticky.css('padding-bottom'), 10); self.stickyOffset = $adminBar.length ? (self.stickyOffsetTop + self.defPaddingTop - self.STICKYPADDING - $adminBar.outerHeight()) : self.stickyOffsetTop + self.defPaddingTop - self.STICKYPADDING; } else{ self.needScale = false; self.stickyOffset = $adminBar.length ? self.stickyOffsetTop - $adminBar.outerHeight() : self.stickyOffsetTop; if(self.stickyOffset < 0) self.stickyOffset = 0; } $(window).trigger('scroll.sticky'); }, 120); }, reset: function(){ var $w = $(window); this.sticky.removeClass('apo-sticked'); this.freeSpace(); if($w.width() < 768 && this.hasEvents){ var spacer = this.sticky.siblings('.apo-sticky-spacer'); if(spacer.length) spacer.remove(); $w.off('scroll.sticky'); this.hasEvents = false; return; } else if($w.width() >= 768 && !this.hasEvents){ $w.on('scroll.sticky', {self: this}, this.scrollHandler); this.hasEvents = true; } }, bindEvents: function(){ var $w = $(window), self = this; $w.on('scroll.sticky', {self: this}, this.scrollHandler); $w.on('resize.sticky', function(){ self.updateDocumentState(); }); self.hasEvents = true; }, scrollHandler: function(e){ var $w = $(this), self = e.data.self; if($w.scrollTop() > self.stickyOffset && !self.sticky.hasClass('apo-sticked')){ self.sticky.addClass('apo-sticked'); if(self.needScale){ self.sticky.css({ 'padding-top': self.STICKYPADDING, 'padding-bottom': self.STICKYPADDING }); } self.fillSpace(); } else if($w.scrollTop() <= self.stickyOffset && self.sticky.hasClass('apo-sticked')){ self.sticky.removeClass('apo-sticked'); if(self.needScale){ self.sticky.css({ 'padding-top': self.defPaddingTop, 'padding-bottom': self.defPaddingBottom }); } self.freeSpace(); } }, fillSpace: function(){ var self = this, parent = self.sticky.parent(), spacer = parent.children('.apo-sticky-spacer'); if(spacer.length){ spacer.show().css('height', self.stickyHeight); return false; } else{ spacer = $('
', { class: 'apo-sticky-spacer', style: 'height:' + self.stickyHeight + 'px' }); self.sticky.before(spacer); } }, freeSpace: function(){ var self = this, parent = self.sticky.parent(), spacer = parent.children('.apo-sticky-spacer'); if(spacer.length) spacer.hide(); } }, alertMessage: function(options) { if(!('Handlebars' in window)) return; var config = { target: $('body').children().last(), type: 'info', icon: 'icon-notification-circle', timeout: 4000 }; config = options && $.isPlainObject(options) ? $.extend(true, {}, config, options) : config; var template = ''; var messageBox = $(Handlebars.compile(template)(config)); messageBox.data('timeOut', setTimeout(function(){ messageBox.stop().slideUp({ duration: 350, easing: 'linear', step: function() { var sameHeight = $(this).closest('.apo-same-height-container'); if(sameHeight.length && sameHeight.data('SameHeight')) { sameHeight.data('SameHeight').setHeight(); } }, complete: function() { var sameHeight = $(this).closest('.apo-same-height-container'); if(sameHeight.length && sameHeight.data('SameHeight')) { sameHeight.data('SameHeight').setHeight(); } $(this).remove(); } }); }, config.timeout)).insertAfter(config.target).stop().slideDown({ duration: 350, easing: 'linear', step: function() { var sameHeight = $(this).closest('.apo-same-height-container'); if(sameHeight.length && sameHeight.data('SameHeight')) { sameHeight.data('SameHeight').setHeight(); } }, complete: function() { var sameHeight = $(this).closest('.apo-same-height-container'); if(sameHeight.length && sameHeight.data('SameHeight')) { sameHeight.data('SameHeight').setHeight(); } } }); }, pageLoader: function(customDelay) { var preloader = $('.apo-preloader'); if(!preloader.length) return; customDelay = customDelay ? customDelay : 1500; setTimeout(function(){ $('body').apoImagesLoaded().then(function(){ preloader.fadeOut(function(){ $(this).remove(); }); }); }, customDelay); }, backToTop: { config: { easing: 'linear', duration: 400 }, init: function( collection, config ) { if(!collection || !collection.length) { return; } var _self = this; config = config && $.isPlainObject( config ) ? $.extend(true, {}, this.config, config) : this.config; this.page = $('html, body'); collection.on('click.ApolaBackToTopButton', function( event ){ _self.movePage( config ); event.preventDefault(); }); }, movePage: function(config) { this.page.stop().animate({ scrollTop: 0 }, { easing: config.easing, duration: config.duration }); } }, OWLCarousel: { collection: $(), config: { items: 1, dots: false, navText: [], navElement: 'button', smartSpeed: 500, fluidSpeed: 500, autoplaySpeed: 500, navSpeed: 500, dotsSpeed: 500, dragEndSpeed: 500, animateIn: 'fadeIn', animateOut: 'fadeOut' }, init: function( container, config ) { if( !container || !container.length ) return; this.collection = this.collection.add( container ); config = $.isPlainObject( config ) ? $.extend( true, { rtl: $.Apola.RTL }, this.config, config ) : this.config; container.owlCarousel( config ); } }, fullScreen: function( controls, controlsClose, selector ) { if( !controls || !controls.length || !selector ) return; var $element, element, isFullScreen = false, $body = $('body'), bodyIntervalIdTimeout; controls.on( 'click.ApolaFullScreen', function(e) { element = document.querySelector(selector); $element = $(selector); if ( element && element.requestFullscreen ) { element.requestFullscreen(); $element.add($body).addClass('apo-fullscreen-element'); prepareBodyAfterEscapeFullScreenMode(); isFullScreen = true; } else if ( element && element.webkitRequestFullscreen ) { element.webkitRequestFullscreen(); $element.add($body).addClass('apo-fullscreen-element'); prepareBodyAfterEscapeFullScreenMode(); isFullScreen = true; } else if ( element && element.mozRequestFullScreen ) { element.mozRequestFullScreen(); $element.add($body).addClass('apo-fullscreen-element'); prepareBodyAfterEscapeFullScreenMode(); isFullScreen = true; } else if ( element && element.msRequestFullscreen ) { element.msRequestFullscreen(); $element.add($body).addClass('apo-fullscreen-element'); prepareBodyAfterEscapeFullScreenMode(); isFullScreen = true; } }); if(controlsClose && controlsClose.length) { controlsClose.on('click.ApolaFullScreen', function(e) { if (document.exitFullscreen) { document.exitFullscreen(); $('.apo-fullscreen-element').add($body).removeClass('apo-fullscreen-element'); setTimeout(function(){ if($.Apola.jQueryRevSlider && $.Apola.jQueryRevSlider.revredraw) { $.Apola.jQueryRevSlider.revredraw(); } }, 500); isFullScreen = false; } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); $('.apo-fullscreen-element').add($body).removeClass('apo-fullscreen-element'); setTimeout(function(){ if($.Apola.jQueryRevSlider && $.Apola.jQueryRevSlider.revredraw) { $.Apola.jQueryRevSlider.revredraw(); } }, 500); isFullScreen = false; } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); $('.apo-fullscreen-element').add($body).removeClass('apo-fullscreen-element'); setTimeout(function(){ if($.Apola.jQueryRevSlider && $.Apola.jQueryRevSlider.revredraw) { $.Apola.jQueryRevSlider.revredraw(); } }, 500); isFullScreen = false; } else if (document.msExitFullscreen) { document.msExitFullscreen(); $('.apo-fullscreen-element').add($body).removeClass('apo-fullscreen-element'); setTimeout(function(){ if($.Apola.jQueryRevSlider && $.Apola.jQueryRevSlider.revredraw) { $.Apola.jQueryRevSlider.revredraw(); } }, 500); isFullScreen = false; } }); } function prepareBodyAfterEscapeFullScreenMode() { bodyIntervalIdTimeout = setInterval(function(){ if(!controlsClose.is(':visible') && $body.hasClass('apo-fullscreen-element')) { isFullScreen = false; $body.removeClass('apo-fullscreen-element'); if($.Apola.jQueryRevSlider && $.Apola.jQueryRevSlider.revredraw) { $.Apola.jQueryRevSlider.revredraw(); } clearInterval(bodyIntervalIdTimeout); } }, 500); } }, hiddenSideColumn: { config: { position: 'left', invokerSelector: '.apo-hidden-column-invoker', closingSelector: '.apo-hidden-column-closing' }, init: function(config) { config = $.isPlainObject(config) ? $.extend(true, {}, this.config, config) : config; this.body = $('body'); this.body .addClass('apo-hidden-column-initialized'); this._bindEvents(config); }, _bindEvents: function(config) { var _self = this; if(config.invokerSelector) { this.body.on('click.ApolaSideHiddenColumn', config.invokerSelector, function(e){ _self.body.addClass('apo-hidden-column-opened'); $(document).trigger('apo.hidden-column.opened'); e.preventDefault(); }); } if(config.closingSelector) { this.body.on('click.ApolaSideHiddenColumn', config.closingSelector, function(e){ _self.body.removeClass('apo-hidden-column-opened'); $(document).trigger('apo.hidden-column.closed'); e.preventDefault(); }); } } }, arcticModals: { _config: { type: 'html', closeOnOverlayClick: true, overlay: { css: { opacity: .7, backgroundColor: '#000000' } }, clickableElements: null }, _collection: $(), init: function( collection, config ) { if( !collection || !collection.length ) return; config = $.isPlainObject( config ) ? $.extend(true, {}, this._config, config) : this._config; config = this._prepareCallbacks( config ); if( config.clickableElements ) { $('body').on('click.ApolaArcticModals', '.arcticmodal-container', function(e){ var $target = $(e.target); if( !$target.closest( config.clickableElements ).length ) { $.arcticmodal('close'); } }); } collection.on('click.ApolaArcticModals', function(e) { var $this = $(this); if( $this.data('arctic-modal-type') == 'ajax' ) { if(!$this.data('arctic-modal-ajax-action')) { return; } $.arcticmodal($.extend(true, {}, config, { type: 'ajax', url: ApolaAJAXData.url, ajax: { cache: false, dataType: 'html', data: { action: $this.data('arctic-modal-ajax-action'), data: $this.data('arctic-modal-ajax-data'), AJAX_token: ApolaAJAXData.AJAX_token }, success: function(data, el, response) { data.body.html( response ); } } })); } else { $($this.data('arctic-modal')).arcticmodal(config); } e.preventDefault(); }); }, _prepareCallbacks: function(config) { var beforeOpenCallback = config.beforeOpen || function(){}, beforeCloseCallback = config.beforeClose || function(){}, afterOpenCallback = config.afterOpen || function(){}, $page = $('.apo-page'), $header = $('#apo-header'), $footer = $('#apo-footer'), $fpNav = $('#fp-nav > ul'); if(!$page.length) return; config.beforeOpen = function() { $page.add($header).add($footer).add($fpNav).addClass('apo-blured'); beforeOpenCallback.apply(this, Array.prototype.slice(arguments, 0)); }; config.afterOpen = function () { if($.Apola && $.Apola.helpers && $.Apola.helpers.linksUnderline) { $.Apola.helpers.linksUnderline.init(this.body.find('a')); } afterOpenCallback.apply(this, Array.prototype.slice(arguments, 0)); }; config.beforeClose = function() { var $openedHamburgers = $('.hamburger.is-active[data-arctic-modal]'); $page.add($header).add($footer).add($fpNav).removeClass('apo-blured'); beforeCloseCallback.apply(this, Array.prototype.slice(arguments, 0)); if($openedHamburgers.length) { $openedHamburgers.removeClass('is-active'); } }; return config; } } }, helpers: { hideVCFrontendEditorButton: function() { var $wpAdminBar = $('#wpadminbar'), $FPContainer = $('.apo-full-page-container'), $VClink = $('#wp-admin-bar-vc_inline-admin-bar-link'); if($wpAdminBar.length && $FPContainer.length && $VClink.length) { $VClink.remove(); } }, fullHeightPage: { init: function() { var _self = this; this.$bodyWrapper = $('body'); this.$pageWrapper = $('.apo-page-content-wrap'); this.$document = $(document); this.$wpAdminBar = $('#wpadminbar'); if( !this.$bodyWrapper.length || !this.$pageWrapper.length ) return; this.$bodyWrapper.apoImagesLoaded().then(function() { _self.updateDocumentState().rebuild(); }); $(window).on('resize.ApolaFullHeightPage', function(){ if( _self.resizeTimeoutId ) clearTimeout( _self.resizeTimeoutId ); _self.resizeTimeoutId = setTimeout(function() { _self.updateDocumentState().rebuild(); }, 100); }); }, updateDocumentState: function() { if( !this.$bodyWrapper || !this.$pageWrapper || !this.$bodyWrapper.length || !this.$pageWrapper.length ) return this; this.$pageWrapper.css( 'padding-bottom', 0 ); this.documentHeight = this.$document.height(); if(this.$wpAdminBar.length) this.documentHeight -= this.$wpAdminBar.outerHeight(); this.pageHeight = this.$bodyWrapper.outerHeight(); this.heightDiff = this.documentHeight - this.pageHeight; return this; }, rebuild: function() { if( !this.$bodyWrapper || !this.$pageWrapper || !this.$bodyWrapper.length || !this.$pageWrapper.length ) return this; var _self = this; if( this.heightDiff <= 0 ) return; this.$pageWrapper.css( 'padding-bottom', _self.heightDiff ); return this; } }, footerWidgetGeometry: function($container, itemSelector, data) { if(!$container || !$container.length || !data || undefined === data.length ) return; var $items = $container.find(itemSelector); if(!$items.length) return; $items.each(function(index, item){ var $item = $(item); if(data[index] !== undefined) { $item.css({ 'width': data[index]['width'] + '%', 'padding-top': data[index]['padding-top'], 'padding-bottom': data[index]['padding-bottom'], }); } }); }, wrapYoutube: function( collection ) { if( !collection || !collection.length ) return; return collection.each(function(i, el){ var $el = $(el), $parent = $el.parent(); if( !$parent.hasClass('apo-responsive-iframe') ) { $el.wrap('
'); } }); }, stretchedEntryImages: { _collection: $(), init: function($container, config) { var _self = this; if(!$.isjQuery($container) || !$container.length || !config.imageSelector || !config.activeClass || !config.containerSelector) return; if(this._collection.filter($container).length) return; $container.data('stretched-entry-image-config', config); $container.each(function(index, element){ var $element = $(element); _self._collection = _self._collection.add($element); }); if(!this._onceBindedeEvents) this._bindEvents(); this.stretchImages(); return $container; }, _bindEvents: function() { var _self = this; $(window).on('resize.ApolaStretchedEntryImages', function(){ if(_self.resizeTimeOutId) clearTimeout(_self.resizeTimeOutId); _self.resizeTimeOutId = setTimeout(function(){ _self.reset().stretchImages(); }, 100); }); this._onceBindedeEvents = true; }, reset: function() { this._collection.each(function(index, element){ var $element = $(element), config = $element.data('stretched-entry-image-config'), $items = $element.find('.' + config.activeClass); if($items.length) { $items.css({ 'margin-left': '', 'margin-right': '', 'width': '' }).removeClass(config.activeClass).each(function(index, item){ var $item = $(item); if($item.get(0).tagName.toUpperCase() == 'IMG') { $item.css({'max-width': ''}); } }) } }); return this; }, stretchImages: function() { this._collection.each(function(index, element) { var $element = $(element), config = $element.data('stretched-entry-image-config'), $items = $element.find(config.imageSelector), elementWidth = $element.outerWidth(), $topContainer = $element.closest(config.containerSelector), topContainerWidth, diff; if(!$topContainer.length || !$items.length) return; topContainerWidth = $topContainer.outerWidth(); diff = topContainerWidth - elementWidth > 0 ? topContainerWidth - elementWidth : 0; $items.each(function(index, item) { var $item = $(item), image = $item.get(0); if(image.tagName.toUpperCase() == 'IMG') { if(image.naturalWidth >= (elementWidth + diff)) { $(image).addClass(config.activeClass).css({ 'margin-left': diff / -2, 'margin-right': diff / -2, 'max-width': topContainerWidth }); } } else { image = $item.find('img'); if(!image.length) return; image = image.get(0); if(image.naturalWidth >= (elementWidth + diff)) { $item.addClass(config.activeClass).css({ 'margin-left': diff / -2, 'margin-right': diff / -2 }); } } }); }); return this; } }, removeExcessiveElements: function($container, exceptSelector) { var $children; if(!$container || !$container.length) return; $children = $container.children(); if(!$children.length) return; $children = $children.not(exceptSelector); if(!$children.length) return; return $children.remove(); }, linksUnderline: { _$collection: $(), init: function($collection) { var self = this, $currentFilteredCollection; if(!$.isjQuery($collection) || !$collection.length) return; if(!this._bindedEvents) this._bindEvents(); $currentFilteredCollection = $(); $collection.each(function(index, element){ var $element = $(element); if(self._$collection.filter($element).length) return; self._$collection = self._$collection.add($element); $currentFilteredCollection = $currentFilteredCollection.add($element); }); return this.toUnderline($currentFilteredCollection); }, isRTL: function() { return getComputedStyle(document.body).direction === 'rtl'; }, _bindEvents: function() { var self = this; $(window).on('resize.ApolaLinksUnderline', function() { if(self.resizeTimeOutId) clearTimeout(self.resizeTimeOutId); self.resizeTimeOutId = setTimeout(function(){ self.toUnderline(self._$collection); }, 100); }); }, toUnderline: function($collection) { var self = this; if(!$.isjQuery($collection) || !$collection.length) return; return $collection.each(function(index, element){ var $element = $(element), transitionDuration = getComputedStyle($element.get(0)).transitionDuration, transitionDurationMS = parseFloat(transitionDuration, 10) * 1000; if(transitionDurationMS) { setTimeout(function(){ self.setUnderlineToElement($element); }, transitionDurationMS); } else { self.setUnderlineToElement($element); } }); }, setUnderlineToElement: function($element) { var backgroundPosition = $element.css('background-position').split(' '), resultLineHeight; $element.css('white-space', 'nowrap'); resultLineHeight = $element.outerHeight() - 1; $element.css('white-space', ''); if(this.isRTL() && backgroundPosition[0]) backgroundPosition[0] = '100%'; if(backgroundPosition[1]) backgroundPosition[1] = resultLineHeight + 'px'; $element.css('background-position', backgroundPosition.join(' ')); } }, revSliderItemsControls: function(RevSlider, data){ if(!RevSlider || !$.isArray(data) || !data.length) return; RevSlider.on('revolution.slide.onchange', function(event, eventData) { var $slide = eventData.currentslide; $.each(data, function(i, obj) { var $target = obj.targetElement, $htmlTarget, $sync = obj.syncWith, $htmlTargetSync; if(!$target || !$target.length) return; if($sync && $sync.length) { $target = $target.add($sync); $sync.data('liked-ids', $target.data('liked-ids')); } for(var targetData in obj.data) { if(!$slide || !$slide.length) return false; $target.data(targetData, $slide.data(obj.data[targetData])) .attr('data-' + targetData, $slide.attr('data-' + obj.data[targetData])); } if(obj.html) { for(var selector in obj.html) { if(!$slide || !$slide.length) return false; $htmlTarget = $target.find(selector); if($sync && $sync.length) { $htmlTargetSync = $sync.find(selector); } if(!$htmlTarget.length) continue; if($htmlTargetSync && $htmlTargetSync.length) { $htmlTargetSync.text($slide.data(obj.html[selector])); } if(obj.html[selector].indexOf('|') != -1) { var htmlDataObject = obj.html[selector].split('|'); if($.isPlainObject($slide.data(htmlDataObject[0])) && (htmlDataObject[1] in $slide.data(htmlDataObject[0]))){ $htmlTarget.text($slide.data(htmlDataObject[0])[htmlDataObject[1]]); } } else { $htmlTarget.text($slide.data(obj.html[selector])); } } } }); }); }, isotopeMasonry: { _collection: $(), _config: { target: '.apo-item', className: 'apo-item-size-2x' }, init: function(collection, config) { if(!collection || !collection.length) return; var _self = this; return collection.each(function(index, element) { var $container = $(element), containerConfig = $.isPlainObject(config) ? $.extend(true, {}, _self._config, config) : _self.config; if( $container.data('apolaIsotopeMasonry') ) return; _self.initContainer($container, containerConfig); }); }, initContainer: function($container, config) { $container.data('apolaIsotopeMasonry', true); this._collection = this._collection.add($container); this.setSize($container, config); }, setSize: function($container, config) { var $items = $container.find(config.target), currentCounter = 0, columns, itemsPerPage, firstInt, secondInt, nextInt, nextIntValue; if(!$items.length) return; $items.removeClass(config.className); columns = this.getColumnsCount($container, $items); if(columns < 3) return; switch(columns) { case 3 : firstInt = 2; currentCounter = 2; secondInt = 4; break; case 4 : firstInt = 3; currentCounter = 3; secondInt = 7; break; } nextIntValue = firstInt; nextInt = 'first'; $items.eq(currentCounter - 1).addClass(config.className); while(currentCounter < $items.length) { if(nextInt == 'first') { currentCounter += nextIntValue; $items.eq(currentCounter - 1).addClass(config.className); nextInt = 'second'; nextIntValue = secondInt; } else if(nextInt == 'second') { currentCounter += nextIntValue; $items.eq(currentCounter - 1).addClass(config.className); nextInt = 'first'; nextIntValue = firstInt; } } if(currentCounter >= $items.length) { setTimeout(function(){ $container.trigger('apola.isotopeMasonryReady'); }, 400); } }, getColumnsCount: function($container, $items){ return Math.ceil($container.outerWidth() / $items.first().outerWidth()); } }, movedLabel: function(selector) { var collection = $(selector); if( !collection.length ) return; var fields = collection.find('input, textarea'); if(!fields.length) return; fields.on('focus', function(event) { $(this).closest(selector).addClass('apo-label-up'); }) .on('focusout', function(event){ if( !$(this).val() ) $(this).closest(selector).removeClass('apo-label-up'); }); }, hamburgers: function() { $('body').on('click.hamburgers', '.hamburger.apo-hamburger-clickable', function(e) { $(this).toggleClass( 'is-active' ); e.preventDefault(); }); }, dynamicBgImage: function(collection) { collection = $.isjQuery(collection) ? collection : $('[data-bg-img-src]'); if(!collection.length) return; return collection.each(function(i, el){ var $this = $(el); if( !$this.data('bg-img-src') ) return; $this.css('background-image', 'url("'+ $this.data('bg-img-src') +'")'); }); }, portfolioTriangles: { collection: $(), init: function($container) { if(!$.isjQuery($container) || !$container.length) return; var triangles = $container.find('.apo-project-triangle'); if(!triangles.length) return; this.collection = this.collection.add(triangles); var _self = this; this.$w = $(window); this.$w.off('resize.ApolaPortfolioTriangles').on( 'resize.ApolaPortfolioTriangles', function() { if( _self.resizeTimeOutId ) clearTimeout( _self.resizeTimeOutId ); _self.resizeTimeOutId = setTimeout( function(){ _self.setBorder(); }, 150 ); } ); this.collection.closest('.apo-project').off('mouseenter.ApolaPortfolioTriangles').on('mouseenter.ApolaPortfolioTriangles', function(e) { var $project = $(this), $triangle = $project.find('.apo-project-triangle'); $project.addClass('apo-project--hover-state'); $triangle.css('border-bottom-width', $triangle.data('border-bottom-width')); }) .off('mouseleave.ApolaPortfolioTriangles').on('mouseleave.ApolaPortfolioTriangles', function(e) { var $project = $(this), $triangle = $project.find('.apo-project-triangle'); $project.removeClass('apo-project--hover-state'); $triangle.css('border-bottom-width', 0); }); this.setBorder(); }, setBorder: function() { this.collection.each(function( index, element ){ var $element = $(element), $container = $element.closest('.apo-project'), containerHeight, containerWidth; if(!$container.length) return; containerHeight = $container.outerHeight(); containerWidth = $container.outerWidth(); $element.data('border-bottom-width', containerHeight * 0.9); $element.css( $.Apola.RTL ? 'border-left-width' : 'border-right-width', containerWidth ); }); $(document).trigger('apola.portfolioTrianglesReady'); } }, fixedContent: { init: function(config) { var _self = this; if(!$.isjQuery(config.movableElement, true) || !$.isjQuery(config.dependElement, true) || !$.isjQuery(config.breakpointElement, true)) return; this.$w = $(window); this.$movable = config.movableElement; this.$depend = config.dependElement; this.$breakpoint = config.breakpointElement; this._movedFromBreakpointElement = 0; setTimeout(function(){ _self.reset().prepareDependColumn().updateDocumentState(); }, 50); this.$w.on('scroll.ApolaFixedContent', function() { if(_self.needScrollMovable()) { _self.scrollMovable(); } if(_self.needMoveMovable()) { _self.moveMovable(); } }) .on('resize.ApolaFixedContent', function() { if(_self.resizeTimeOutId) clearTimeout(_self.resizeTimeOutId); _self.resizeTimeOutId = setTimeout(function() { _self.reset().prepareDependColumn().updateDocumentState(); if(_self.needScrollMovable()) { _self.scrollMovable(); } if(_self.needMoveMovable()) { _self.moveMovable(); } }, 300); }); }, reset: function() { this.$movable.css({ 'top': 'auto', 'margin-top': 'auto' }); window.scroll(0, 0); return this; }, updateDocumentState: function() { this.windowHeight = this.$w.height(); this.breakpoint = this.$breakpoint.offset().top; this.movableHeight = this.$movable.outerHeight(); this.dependHeight = this.$depend.outerHeight(); return this; }, needScrollMovable: function() { return this.movableHeight > this.windowHeight && (this.$w.scrollTop() + this.windowHeight < this.movableHeight); }, scrollMovable: function() { this.$movable.css('top', this.$w.scrollTop() * -1); return this; }, prepareDependColumn: function() { this.$depend.css('height', 'auto'); if(this.$movable.outerHeight() > this.$depend.outerHeight()) { this.$depend.css('height', this.$movable.outerHeight()); } if(this.$depend.outerHeight() < this.$w.height()) { this.$depend.css('height', this.$w.height()); } return this; }, getCurrentMovableTop: function() { return parseInt(this.$movable.css('top'), 10); }, needMoveMovable: function() { var windowScrollTop = this.$w.scrollTop() + this.windowHeight; return windowScrollTop >= this.breakpoint; }, moveMovable: function() { var windowScrollTop = this.$w.scrollTop() + this.windowHeight; this.$movable.css('margin-top', (windowScrollTop - this.breakpoint) * -1 ); } }, fullHeight: { collection: $(), init: function( collection ) { if(!collection || !collection.length) return; var _self = this; this.collection = this.collection.add( collection ); this.$window = $(window); this.$adminBar = $('#wpadminbar'); this.$body = $('body'); this.$html = $('html'); this.updateDocumentInfo().setHeight(); this.$window.on('resize.ApolaFullHeight', function(e) { if( _self.resizeTimeOutId ) clearTimeout( _self.resizeTimeOutId ); _self.resizeTimeOutId = setTimeout( function() { _self.updateDocumentInfo().setHeight(); }, 50 ); }); }, updateDocumentInfo: function() { this.wHeight = this.$window.height(); return this; }, setHeight: function() { this.collection.css('height', this.wHeight); this.$html.addClass('apo-document-scroll-locked'); return this; } }, owlSingleHower: function( container ) { if( !container || !container.length ) return false; container.on('mouseenter.ApolaOwlSingleHover', '.owl-item', function(e){ $(this) .removeClass('owl-item-unfocused') .addClass('owl-item-focused') .siblings('.owl-item.active') .addClass('owl-item-unfocused'); }).on('mouseleave.ApolaOwlSingleHover', '.owl-item', function(e) { $(this) .removeClass('owl-item-focused') .siblings('.owl-item.active') .removeClass('owl-item-unfocused'); }); }, stripedPhotosCarouselHover: { collection: $(), config: { easing: 'linear', duration: 500, coefficient: 2 }, init: function( containers, config ) { if( !containers || !containers.length ) return; var _self = this; this.$window = $(window); config = $.isPlainObject( config ) ? $.extend(true, {}, this.config, config ) : this.config; this.collection = this.collection.add( containers ); this.updateItemsInfo(); this._bindEvents( containers, config ); this.collection.on('resized.owl.carousel', function(){ _self.updateItemsInfo(); }); }, updateItemsInfo: function() { this.collection.each( function(index, element) { var $element = $(element); $element.data( 'stripedItemWidth', $element.find('.owl-item:not(.active)').outerWidth() ); } ); return this; }, _bindEvents: function( containers, config ) { containers.on( 'mouseenter.ApolaStripedPhotosCarouselHover', '.owl-item', function() { var $this = $(this), $container = $this.closest('.owl-carousel'); if( !$container.data('owl.carousel').settings.itemsGrow ) return false; var baseWidth = $container.data('stripedItemWidth'), width = baseWidth * config.coefficient, amountOfActiveItems = $this.siblings('.owl-item.active').length; $this.stop().animate({ width: width }, { easing: config.easing, duration: config.duration }) .siblings('.owl-item.active') .stop() .animate({ width: baseWidth - ( (width - baseWidth) / amountOfActiveItems ) }, { easing: config.easing, duration: config.duration }) } ).on('mouseleave.ApolaStripedPhotosCarouselHover', '.owl-item', function() { var $this = $(this), $container = $this.closest('.owl-carousel'); if( !$container.data('owl.carousel').settings.itemsGrow ) return false; var baseWidth = $container.data('stripedItemWidth'); $this.add($this.siblings('.owl-item')).stop().animate({ width: baseWidth }, { duration: config.duration, easeing: config.easeing }); } ) } }, revThumbs: { config: { revAPI: null, target: '.apo-slider-thumb' }, _collection: $(), init: function( container, config ) { if( !container || !container.length || this._collection.has(container).length ) return; var _self = this; config = $.isPlainObject(config) ? $.extend(true, {}, this.config, config) : this.config; if( !config.revAPI ) return; container.each( function( index, element ) { _self.initInstance( $(element), config ); _self._collection = _self._collection.add( $(element) ); } ); }, initInstance: function($container, config) { var $items = $container.find( config.target ); config.revAPI.on('revolution.slide.onchange', function(event, data) { $items.closest('.swiper-slide') .eq( data.slideIndex - 1 ) .children() .addClass('apo-active') .parent() .siblings() .children() .removeClass('apo-active'); }); $container.on( 'click.ApolaRevThumbs', config.target, function(e) { var $current = $(this), index = $current.closest('.swiper-slide').index() + 1; config.revAPI.revshowslide(index); e.preventDefault(); }); } }, OWLImageThumbs: function(container, imageSelector){ if(!container || !container.length || !imageSelector) return; container.each(function(i, el){ var $this = $(el), $dots = $this.find('.owl-dot'); $this.find('.owl-item').each(function(i, el){ var authorBox = $(this).find(imageSelector); $dots.eq(i).append(authorBox); }); }); }, fullPageSlideNumbers: { init: function( $element ) { if( !$element || !$element.length ) return; this.$element = $element; this._generateElements(); this._bindEvents(); }, _generateElements: function() { this.$currentSlide = $('', { class: 'apo-fp-slide-numbers-current', text: '00' }); this.$amount = $('', { class: 'apo-fp-slide-numbers-amount', text: '00' }); }, _bindEvents: function() { var $d = $(document), _self = this; $d.on('render.apola.fullpage', function(event, data){ var $container = data.$container, sections = $container.find('.fp-section'), currentSection = $container.find('.fp-section.active'); if( sections.length ) { _self.$currentSlide.text(_self._prepareNumber( currentSection.index() + 1) ); _self.$amount.text( _self._prepareNumber( sections.length) ); } _self.$element.append(_self.$currentSlide).append(_self.$amount); }); $d.on('leave.apola.fullpage', function(event, data){ _self.$currentSlide.text( _self._prepareNumber( data.nextIndex) ); }); }, _prepareNumber: function( number ) { return (('' + number).length == 1) ? '0' + number : number; } }, fancybox: function() { $.fancybox.defaults.infobar = false; $.fancybox.defaults.afterClose = function() { if($.fn.fullpage) $.fn.fullpage.reBuild(); }; $(document).on('beforeClose', function(event) { if($(event.target).hasClass('apo-modal')) { event.stopImmediatePropagation(); } }); $.fancybox.defaults.lang = "en"; $.fancybox.defaults.i18n = { en: window.ApolaFancyboxI18N || { CLOSE: "Close", NEXT: "Next", PREV: "Previous", ERROR: "The requested content cannot be loaded. Please try again later.", PLAY_START: "Start slideshow", PLAY_STOP: "Pause slideshow", FULL_SCREEN: "Full screen", THUMBS: "Thumbnails", DOWNLOAD: "Download", SHARE: "Share", ZOOM: "Zoom" } }; }, photoStream: { init: function() { this.photoInfoBtn = $('.apo-photo-info-invoker'); this.photoLikesBtn = $('.apo-photo-likes-btn'); var _self = this, timeOutId; $(document).on('leave.apola.fullpage', function(event, eventData){ var likesTarget; if(!eventData.$element || !eventData.$element) return; if(timeOutId) clearTimeout(timeOutId); timeOutId = setTimeout(function(){ var $currentSlide = eventData.$element.siblings('.active'), postData = $currentSlide.data('post-data'); if( !postData || !postData.item_id ) return; if(_self.photoInfoBtn.length) { _self.photoInfoBtn.data('arctic-modal-ajax-data', postData) .attr('data-arctic-modal-ajax-data', JSON.stringify(postData)); } if(_self.photoLikesBtn.length) { _self.photoLikesBtn.data('item-likes-data', postData) .attr('data-item-likes-data', JSON.stringify(postData)); likesTarget = _self.photoLikesBtn.find('.apo-item-likes'); if(likesTarget.length) { likesTarget.text(postData.likes ? postData.likes : 0); } } }, 10) }); } }, touchHover: { _selector: null, _config: { prefix: 'apo-', activeClass: 'touch-state-hover' }, init: function(selector, options) { if( !selector ) return; if(!this.body) this.$body = $('body'); options = $.isPlainObject(options) ? $.extend(true, {}, this._config, options) : this._config; this.bindSelector(selector).bindEvent(options); }, bindSelector: function(selector) { if( !selector ) return this; if( this._selector ) { this._selector += ',' + selector; this._selector = this._selector.replace(new RegExp(' ' , 'g'), ''); } else { this._selector = selector; } return this; }, bindEvent: function(options) { var _self = this; if(!options) options = this._config; this.$body .off('.touchHover') .on('mouseenter.touchHover', this._selector, function(e){ $(this).addClass(options.prefix + options.activeClass); }).on('mouseleave.touchHover', this._selector, function(e){ $(this).removeClass(options.prefix + options.activeClass); }); } }, fullWidthSections: { _$w: $(window), _collection: $(), _config: { containerSelector: '.apo-page' }, init: function(collection, config) { var _self = this; if(!collection || !collection.length) return; collection.each(function(index, section){ var $section = $(section), sectionConfig = $.isPlainObject(config) ? $.extend(true, {}, _self._config, config) : _self._config; _self._initSection($section, sectionConfig); }); if(!this._globalEventsBinded) { this._bindGlobalEvents(); } this.reBuild(); return collection; }, _bindGlobalEvents: function() { var _self = this; this._$w.on('resize.ApolaFullWidthSection', function(){ if(_self.resizeTimeOutId) clearTimeout(_self.resizeTimeOutId); _self.resizeTimeOutId = setTimeout(function(){ _self.reBuild(); }, 50); }); this._globalEventsBinded = true; }, _initSection: function(section, config){ section.data('ApolaFullWidthSectionConfig', config); if(!this._collection.filter(section).length) { this._collection = this._collection.add(section); } }, reBuild: function() { this._collection.each(function(index, section){ var $section = $(section), config = $section.data('ApolaFullWidthSectionConfig'), $container = $(config.containerSelector).length ? $(config.containerSelector) : $('body'), sectionWidth, containerWidth; $container.apoImagesLoaded().then(function(){ containerWidth = $container.outerWidth(); $section.css({ 'margin-left': 'auto', 'margin-right': 'auto' }); sectionWidth = $section.outerWidth(); if(sectionWidth < containerWidth) { $section.css({ 'margin-left': Math.abs(containerWidth - sectionWidth) / -2, 'margin-right': Math.abs(containerWidth - sectionWidth) / -2 }); $('body').trigger('apola.fullwidthsections.rebuild'); } }); }); return this; } } }, extendjQuery: { isjQuery: function(element, elementExists) { if(element === undefined || element === null) return false; if(elementExists === undefined) { return element instanceof jQuery; } else { return $.isjQuery(element) && element.length; } } }, extendjQueryFN: { apoImagesLoaded : function () { var $imgs = this.find('img[src!=""]'); if (!$imgs.length) {return $.Deferred().resolve().promise();} var dfds = []; $imgs.each(function(){ var dfd = $.Deferred(); dfds.push(dfd); var img = new Image(); img.onload = function(){dfd.resolve();}; img.onerror = function(){dfd.resolve();}; img.src = this.src; }); return $.when.apply($,dfds); } } }; $.Apola.DOMReady = function(){ $.Apola.helpers.dynamicBgImage(); $.Apola.helpers.hamburgers(); $.Apola.modules.languageSwitcher(); if($.Apola.helpers.fullWidthSections && $('.apo-section.apo-full-width').length) { $.Apola.helpers.fullWidthSections.init($('.apo-section.apo-full-width')); } // back to top button init $.Apola.modules.backToTop.init( $('.apo-back-to-top-button') , { easing: 'easeOutQuint', duration: 700 }); $.Apola.modules.fullScreen( $('.apo-fullscreen-control'), $('.apo-fullscreen-control-close'), '.rev_slider_wrapper.fullscreen-container' ); $.Apola.modules.hiddenSideColumn.init({ position: 'left', invokerSelector: '.apo-hidden-column-invoker', closingSelector: '.apo-hidden-column-closing' }); $.Apola.helpers.fullPageSlideNumbers.init( $('.apo-fp-slide-numbers') ); $.Apola.modules.arcticModals.init( $('[data-arctic-modal]'), { clickableElements: '.apo-oneline-form, .apo-fullscreen-nav-pages, .apo-modal-photo-info-title, .apo-photo-stream-category, .apo-extended-info-list-item' } ); $.Apola.helpers.fancybox(); $.Apola.helpers.photoStream.init(); $.Apola.helpers.movedLabel('.apo-moved-label'); if( $.Apola.modules.isotope && $.Apola.helpers.isotopeMasonry ) { var $isotopeMasonryContainers = $('.apo-isotope.apo-entries-container.apo-style-1[data-isotope-layout="masonry"]:not(.apo-shortcode-container), .apo-isotope.apo-isotope-masonry-chess[data-isotope-layout="masonry"]:not(.apo-shortcode-container)'); $isotopeMasonryContainers.on('apola.isotopeMasonryReady', function(){ if($.Apola.helpers.linksUnderline) { $.Apola.helpers.linksUnderline.init($(this).find('a')); } }); $.Apola.helpers.isotopeMasonry.init( $isotopeMasonryContainers, { target: '.apo-item' }); } if( $.Apola.isTouch ) { $.Apola.helpers.touchHover.init('.apo-portfolio-container .apo-project', { prefix: 'apo-' }); $('.apo-portfolio-container').on('click', function(e){ $(this).css({ 'border-style': 'solid', 'border-color': 'transparent', 'border-width': '0 1px 0 0' }); }); } if($('.apo-entry-content iframe[src*="youtube.com"]')) $.Apola.helpers.wrapYoutube( $('.apo-entry-content iframe[src*="youtube.com"]') ); if(window.ApolaFooterWidgetsGeometry !== undefined && $('#apo-footer .apo-widget-area').length) { $.Apola.helpers.footerWidgetGeometry($('#apo-footer .apo-widget-area'), '.apo-widget', window.ApolaFooterWidgetsGeometry); } if($.Apola.helpers.hideVCFrontendEditorButton) { $.Apola.helpers.hideVCFrontendEditorButton(); } }; $.fn.extend( $.Apola.extendjQueryFN ); $.extend($.Apola.extendjQuery ); $.Apola.outerResourcesReady = function(){ $.Apola.modules.pageLoader(1500); $.Apola.modules.sameHeight( $('.apo-same-height-container') ); $.Apola.modules.sameHeight( $('.apo-striped-photos:not(.owl-carousel)'), { targetSelector: '.apo-striped-photo' } ); if($.fn.WATSameHeight) { var $entriesContainerStyle4 = $('.apo-entries-container.apo-style-4, .apo-entries-container.apo-style-5').not('.apo-shortcode-container'), $entriesItemsStyle4; if( $entriesContainerStyle4.length ) { $entriesItemsStyle4 = $entriesContainerStyle4.find('.apo-item'); if($entriesItemsStyle4.length) { $entriesContainerStyle4.WATSameHeight({ target: '.apo-entry .apo-aligner-inner', isIsotope: $entriesContainerStyle4.filter('.apo-isotope').length, columns: $entriesContainerStyle4.length ? Math.ceil( $entriesContainerStyle4.outerWidth() / $entriesItemsStyle4.first().outerWidth() ) : null }); } } } if($.Apola.modules.animatedContent && $('.apo-cssanimations [data-animation]').length) { $.Apola.modules.animatedContent(200); } $.Apola.helpers.owlSingleHower( $('.apo-striped-photos.owl-carousel') ); $.Apola.helpers.fullHeight.init( $('.apo-striped-photos.apo-full-height .apo-striped-photo') ); if( $.Apola.modules.isotope ) { var $isoContainer = $('.apo-isotope').not('.apo-shortcode-container'); if($isoContainer.length) { $.Apola.modules.isotope( $isoContainer, { itemSelector: '.apo-item' }); } /** * This initialization must be before the initialization of ParallaxGrid module */ if($.Apola.modules.isotopeEffect) { var $isotopeSlideEffectContainer = $('.apo-isotope.apo-isotope-has-slide-effect'), $parallaxGridSlideEffectContainer = $('.apo-parallax-grid.apo-parallax-grid-has-slide-effect'), slideEffectConfiguration = { itemTarget: '.apo-project, .apo-entry', itemBaseElement: '.apo-project-media, .apo-entry-media', timeout: (ApolaOptions && ApolaOptions.preloader && ApolaOptions.preloader == '1') ? 1600 : 100 }; // Isotope if($isotopeSlideEffectContainer.not('.apo-shortcode-container').length) { // Blog if($isotopeSlideEffectContainer.hasClass('apo-entries-container')) { if($isotopeSlideEffectContainer.filter('.apo-style-1, .apo-style-2, .apo-style-3').length) { if(!$isotopeSlideEffectContainer.hasClass('apo-style-1')) { slideEffectConfiguration = $.extend(true, {}, slideEffectConfiguration, { itemBaseElement: '.apo-entry-inner' }); } $.Apola.modules.isotopeEffect.init( $isotopeSlideEffectContainer, null, slideEffectConfiguration ); } } // Portfolio/Gallery if($isotopeSlideEffectContainer.hasClass('apo-portfolio-container') && $isotopeSlideEffectContainer.filter('.apo-style-2, .apo-style-3, .apo-style-4').length) { $.Apola.modules.isotopeEffect.init( $isotopeSlideEffectContainer, null, slideEffectConfiguration ); } } // Parallax Grid if($parallaxGridSlideEffectContainer.not('.apo-shortcode-container').length) { // Portfolio/Gallery if($parallaxGridSlideEffectContainer.hasClass('apo-portfolio-container') && $parallaxGridSlideEffectContainer.filter('.apo-style-2, .apo-style-3, .apo-style-4').length) { $parallaxGridSlideEffectContainer.on('apola.parallaxGridReady', function() { if($parallaxGridSlideEffectContainer.hasClass('apo-style-4')) { $.Apola.helpers.portfolioTriangles.init($parallaxGridSlideEffectContainer); $(document).on('apola.portfolioTrianglesReady', function() { setTimeout(function(){ $.Apola.modules.isotopeEffect.init( $parallaxGridSlideEffectContainer, $parallaxGridSlideEffectContainer.data('items'), slideEffectConfiguration ); }, 50); }); } else { $.Apola.modules.isotopeEffect.init( $parallaxGridSlideEffectContainer, $parallaxGridSlideEffectContainer.data('items'), slideEffectConfiguration ); } }); } } } } $(window).on('resized.apola.sameheight', function() { var $isotope = $('.apo-isotope'); if($isotope.length) { $isotope.each(function(index, isotope){ $(isotope).data('IsotopeWrapper').relayout(); }); } }); if( $('#apo-fixed-content-fixed-col').length ) { $.Apola.helpers.fixedContent.init({ movableElement: $('#apo-fixed-content-fixed-col'), dependElement: $('.apo-fixed-content-scroll-col'), breakpointElement: $('#apo-footer'), }); } if( $('.apo-portfolio-container.apo-style-4:not(.apo-parallax-grid)').length ) { $.Apola.helpers.portfolioTriangles.init($('.apo-portfolio-container.apo-style-4:not(.apo-parallax-grid)')); } if( $.Apola.modules.parallaxGrid ) { $.Apola.modules.parallaxGrid( $('.apo-parallax-grid'), { breakpointElement: $('#apo-footer') } ); } // sticky section init if($('.apo-sticky').length) $.Apola.modules.stickySection.init(); if($.Apola.helpers.revSliderItemsControls) { setTimeout(function(){ $.Apola.helpers.revSliderItemsControls($.Apola.jQueryRevSlider, [ { targetElement: $('#apo-header [data-item-likes-data]'), data: { 'item-likes-data': 'post-data' }, html: { '.apo-item-likes': 'post-data|likes' }, syncWith: $('.apo-slider-fullscreen-controls [data-item-likes-data]') }, { targetElement: $('#apo-header .apo-modal-info-invoker'), data: { 'arctic-modal-ajax-data': 'post-data' } } ]); }, 50); } if($.Apola.helpers.composerRTLFix && $.Apola.RTL) { $.Apola.helpers.composerRTLFix.init($('.vc_row[data-vc-full-width-init="true"], .vc_section[data-vc-full-width-init="true"]')); } if( $.Apola.modules.fullpage ) { $.Apola.modules.fullpage( $('.apo-full-page-container'), { sectionSelector: '.vc_section' } ); if($.Apola.helpers.VCFrontEndEditor && $.Apola.helpers.VCFrontEndEditor.stretchScrollableContainers) { $.Apola.helpers.VCFrontEndEditor.stretchScrollableContainers.init($('.apo-full-page-container')); } $(document).on('resize.apola.fullpage', function() { $.Apola.helpers.fullHeightPage.updateDocumentState().rebuild(); setTimeout(function() { if(window.vc_rowBehaviour) window.vc_rowBehaviour(); setTimeout(function(){ if($.Apola.RTL) $.Apola.helpers.composerRTLFix.setOffset(); }, 200); }, 200); }); } if($.Apola.helpers.stretchedEntryImages) { $.Apola.helpers.stretchedEntryImages.init($('.apo-entry.apo-single .apo-entry-content'), { imageSelector: '.wp-caption:not(.alignleft):not(.alignright), img.alignnone, img.aligncenter', containerSelector: '.apo-section-thin', activeClass: 'apo-image-stretched' }); } if($.Apola.helpers.linksUnderline && $('a').length) { $.Apola.helpers.linksUnderline.init($('a').add($('.apo-pagination .current, .nav-links .current'))); } if($.fn.apoImagesLoaded) { $('body').apoImagesLoaded().then(function(){ $(window).trigger('resize'); }); } if( $.Apola.helpers.fullHeightPage ) $.Apola.helpers.fullHeightPage.init(); if(window.vcParallaxSkroll && window.vcParallaxSkroll.refresh) window.vcParallaxSkroll.refresh(); }; $(function(){ $.Apola.DOMReady(); }); $(window).on('load', function(e){ $.Apola.outerResourcesReady(); }); })(window.jQuery);