File: /var/www/vhost/www.mocrea.it/wp-content/themes/ottar/assets/js/modules.js
(function ($) {
"use strict";
window.edgtf = {};
edgtf.modules = {};
edgtf.scroll = 0;
edgtf.window = $(window);
edgtf.document = $(document);
edgtf.windowWidth = $(window).width();
edgtf.windowHeight = $(window).height();
edgtf.body = $('body');
edgtf.html = $('html, body');
edgtf.htmlEl = $('html');
edgtf.menuDropdownHeightSet = false;
edgtf.defaultHeaderStyle = '';
edgtf.minVideoWidth = 1500;
edgtf.videoWidthOriginal = 1280;
edgtf.videoHeightOriginal = 720;
edgtf.videoRatio = 1.61;
edgtf.animationEnd = animationEventEnd();
edgtf.transitionEnd = transitionEventEnd();
edgtf.edgtfOnDocumentReady = edgtfOnDocumentReady;
edgtf.edgtfOnWindowLoad = edgtfOnWindowLoad;
edgtf.edgtfOnWindowResize = edgtfOnWindowResize;
edgtf.edgtfOnWindowScroll = edgtfOnWindowScroll;
$(document).ready(edgtfOnDocumentReady);
$(window).on('load', edgtfOnWindowLoad);
$(window).resize(edgtfOnWindowResize);
$(window).scroll(edgtfOnWindowScroll);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtf.scroll = $(window).scrollTop();
//set global variable for header style which we will use in various functions
if (edgtf.body.hasClass('edgtf-dark-header')) {
edgtf.defaultHeaderStyle = 'edgtf-dark-header';
}
if (edgtf.body.hasClass('edgtf-light-header')) {
edgtf.defaultHeaderStyle = 'edgtf-light-header';
}
}
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
}
/*
All functions to be called on $(window).resize() should be in this function
*/
function edgtfOnWindowResize() {
edgtf.windowWidth = $(window).width();
edgtf.windowHeight = $(window).height();
}
/*
All functions to be called on $(window).scroll() should be in this function
*/
function edgtfOnWindowScroll() {
edgtf.scroll = $(window).scrollTop();
}
//set boxed layout width variable for various calculations
switch (true) {
case edgtf.body.hasClass('edgtf-grid-1300'):
edgtf.boxedLayoutWidth = 1350;
//edgtf.gridWidth = 1300;
break;
case edgtf.body.hasClass('edgtf-grid-1200'):
edgtf.boxedLayoutWidth = 1250;
//edgtf.gridWidth = 1200;
break;
case edgtf.body.hasClass('edgtf-grid-1000'):
edgtf.boxedLayoutWidth = 1050;
//edgtf.gridWidth = 1000;
break;
case edgtf.body.hasClass('edgtf-grid-800'):
edgtf.boxedLayoutWidth = 850;
//edgtf.gridWidth = 800;
break;
default :
edgtf.boxedLayoutWidth = 1150;
//edgtf.gridWidth = 1100;
break;
}
edgtf.gridWidth = function () {
var gridWidth = 1100;
switch (true) {
case edgtf.body.hasClass('edgtf-grid-1300') && edgtf.windowWidth > 1400:
gridWidth = 1300;
break;
case edgtf.body.hasClass('edgtf-grid-1200') && edgtf.windowWidth > 1300:
gridWidth = 1200;
break;
case edgtf.body.hasClass('edgtf-grid-1000') && edgtf.windowWidth > 1200:
gridWidth = 1200;
break;
case edgtf.body.hasClass('edgtf-grid-800') && edgtf.windowWidth > 1024:
gridWidth = 800;
default :
break;
}
return gridWidth;
};
function animationEventEnd() {
var el = document.createElement("animationDetector");
var animations = {
"animation": "animationend",
"OAnimation": "oAnimationEnd",
"MozAnimation": "animationend",
"WebkitAnimation": "webkitAnimationEnd"
}
for (var t in animations) {
if (el.style[t] !== undefined) {
return animations[t];
}
}
}
function transitionEventEnd() {
var el = document.createElement('transitionDetector'),
transEndEventNames = {
'WebkitTransition': 'webkitTransitionEnd',// Saf 6, Android Browser
'MozTransition': 'transitionend', // only for FF < 15
'transition': 'transitionend' // IE10, Opera, Chrome, FF 15+, Saf 7+
};
for (var t in transEndEventNames) {
if (el.style[t] !== undefined) {
return transEndEventNames[t];
}
}
}
})(jQuery);
(function ($) {
"use strict";
var common = {};
edgtf.modules.common = common;
common.edgtfFluidVideo = edgtfFluidVideo;
common.edgtfEnableScroll = edgtfEnableScroll;
common.edgtfDisableScroll = edgtfDisableScroll;
common.edgtfOwlSlider = edgtfOwlSlider;
common.edgtfInitParallax = edgtfInitParallax;
common.edgtfInitSelfHostedVideoPlayer = edgtfInitSelfHostedVideoPlayer;
common.edgtfSelfHostedVideoSize = edgtfSelfHostedVideoSize;
common.edgtfPrettyPhoto = edgtfPrettyPhoto;
common.edgtfStickySidebarWidget = edgtfStickySidebarWidget;
common.getLoadMoreData = getLoadMoreData;
common.setLoadMoreAjaxData = setLoadMoreAjaxData;
common.setFixedImageProportionSize = setFixedImageProportionSize;
common.edgtfInitCustomCursor = edgtfInitCustomCursor;
common.edgtfOnDocumentReady = edgtfOnDocumentReady;
common.edgtfOnWindowLoad = edgtfOnWindowLoad;
common.edgtfOnWindowResize = edgtfOnWindowResize;
$(document).ready(edgtfOnDocumentReady);
$(window).on('load', edgtfOnWindowLoad);
$(window).resize(edgtfOnWindowResize);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitCustomCursor();
edgtfIconWithHover().init();
edgtfDisableSmoothScrollForMac();
edgtfInitAnchor().init();
edgtfInitBackToTop();
edgtfBackButtonShowHide();
edgtfInitSelfHostedVideoPlayer();
edgtfSelfHostedVideoSize();
edgtfFluidVideo();
edgtfOwlSlider();
edgtfPreloadBackgrounds();
edgtfPrettyPhoto();
edgtfSearchPostTypeWidget();
edgtfDashboardForm();
edgtfInitGridMasonryListLayout();
edgtfSmoothTransition();
}
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
edgtfInitParallax();
edgtfStickySidebarWidget().init();
}
/*
All functions to be called on $(window).resize() should be in this function
*/
function edgtfOnWindowResize() {
edgtfInitGridMasonryListLayout();
edgtfSelfHostedVideoSize();
}
/*
** Disable smooth scroll for mac if smooth scroll is enabled
*/
function edgtfDisableSmoothScrollForMac() {
var os = navigator.appVersion.toLowerCase();
if (os.indexOf('mac') > -1 && edgtf.body.hasClass('edgtf-smooth-scroll')) {
edgtf.body.removeClass('edgtf-smooth-scroll');
}
}
function edgtfDisableScroll() {
if (window.addEventListener) {
window.addEventListener('wheel', edgtfWheel, {passive: false});
}
// window.onmousewheel = document.onmousewheel = edgtfWheel;
document.onkeydown = edgtfKeydown;
}
function edgtfEnableScroll() {
if (window.removeEventListener) {
window.removeEventListener('wheel', edgtfWheel, {passive: false});
}
window.onmousewheel = document.onmousewheel = document.onkeydown = null;
}
function edgtfWheel(e) {
edgtfPreventDefaultValue(e);
}
function edgtfKeydown(e) {
var keys = [37, 38, 39, 40];
for (var i = keys.length; i--;) {
if (e.keyCode === keys[i]) {
edgtfPreventDefaultValue(e);
return;
}
}
}
function edgtfPreventDefaultValue(e) {
e = e || window.event;
if (e.preventDefault) {
e.preventDefault();
}
e.returnValue = false;
}
/*
** Anchor functionality
*/
var edgtfInitAnchor = function () {
/**
* Set active state on clicked anchor
* @param anchor, clicked anchor
*/
var setActiveState = function (anchor) {
var headers = $('.edgtf-main-menu, .edgtf-mobile-nav, .edgtf-fullscreen-menu');
headers.each(function () {
var currentHeader = $(this);
if (anchor.parents(currentHeader).length) {
currentHeader.find('.edgtf-active-item').removeClass('edgtf-active-item');
anchor.parent().addClass('edgtf-active-item');
currentHeader.find('a').removeClass('current');
anchor.addClass('current');
}
});
};
/**
* Check anchor active state on scroll
*/
var checkActiveStateOnScroll = function () {
var anchorData = $('[data-edgtf-anchor]'),
anchorElement,
siteURL = window.location.href.split('#')[0];
if (siteURL.substr(-1) !== '/') {
siteURL += '/';
}
anchorData.waypoint(function (direction) {
if (direction === 'down') {
if ($(this.element).length > 0) {
anchorElement = $(this.element).data("edgtf-anchor");
} else {
anchorElement = $(this).data("edgtf-anchor");
}
setActiveState($("a[href='" + siteURL + "#" + anchorElement + "']"));
}
}, {offset: '50%'});
anchorData.waypoint(function (direction) {
if (direction === 'up') {
if ($(this.element).length > 0) {
anchorElement = $(this.element).data("edgtf-anchor");
} else {
anchorElement = $(this).data("edgtf-anchor");
}
setActiveState($("a[href='" + siteURL + "#" + anchorElement + "']"));
}
}, {
offset: function () {
return -($(this.element).outerHeight() - 150);
}
});
};
/**
* Check anchor active state on load
*/
var checkActiveStateOnLoad = function () {
var hash = window.location.hash.split('#')[1];
if (hash !== "" && $('[data-edgtf-anchor="' + hash + '"]').length > 0) {
anchorClickOnLoad(hash);
}
};
/**
* Handle anchor on load
*/
var anchorClickOnLoad = function ($this) {
var scrollAmount,
anchor = $('.edgtf-main-menu a, .edgtf-mobile-nav a, .edgtf-fullscreen-menu a'),
hash = $this,
anchorData = hash !== '' ? $('[data-edgtf-anchor="' + hash + '"]') : '';
if (hash !== '' && anchorData.length > 0) {
var anchoredElementOffset = anchorData.offset().top;
scrollAmount = anchoredElementOffset - headerHeightToSubtract(anchoredElementOffset) - edgtfGlobalVars.vars.edgtfAddForAdminBar;
if (anchor.length) {
anchor.each(function () {
var thisAnchor = $(this);
if (thisAnchor.attr('href').indexOf(hash) > -1) {
setActiveState(thisAnchor);
}
});
}
edgtf.html.stop().animate({
scrollTop: Math.round(scrollAmount)
}, 1000, function () {
//change hash tag in url
if (history.pushState) {
history.pushState(null, '', '#' + hash);
}
});
return false;
}
};
/**
* Calculate header height to be substract from scroll amount
* @param anchoredElementOffset, anchorded element offset
*/
var headerHeightToSubtract = function (anchoredElementOffset) {
if (edgtf.modules.stickyHeader.behaviour === 'edgtf-sticky-header-on-scroll-down-up') {
edgtf.modules.stickyHeader.isStickyVisible = (anchoredElementOffset > edgtf.modules.header.stickyAppearAmount);
}
if (edgtf.modules.stickyHeader.behaviour === 'edgtf-sticky-header-on-scroll-up') {
if ((anchoredElementOffset > edgtf.scroll)) {
edgtf.modules.stickyHeader.isStickyVisible = false;
}
}
var headerHeight = edgtf.modules.stickyHeader.isStickyVisible ? edgtfGlobalVars.vars.edgtfStickyHeaderTransparencyHeight : edgtfPerPageVars.vars.edgtfHeaderTransparencyHeight;
if (edgtf.windowWidth < 1025) {
headerHeight = 0;
}
return headerHeight;
};
/**
* Handle anchor click
*/
var anchorClick = function () {
edgtf.document.on("click", ".edgtf-main-menu a, .edgtf-fullscreen-menu a, .edgtf-btn, .edgtf-anchor, .edgtf-mobile-nav a", function () {
var scrollAmount,
anchor = $(this),
hash = anchor.prop("hash").split('#')[1],
anchorData = hash !== '' ? $('[data-edgtf-anchor="' + hash + '"]') : '';
if (hash !== '' && anchorData.length > 0) {
var anchoredElementOffset = anchorData.offset().top;
scrollAmount = anchoredElementOffset - headerHeightToSubtract(anchoredElementOffset) - edgtfGlobalVars.vars.edgtfAddForAdminBar;
setActiveState(anchor);
edgtf.html.stop().animate({
scrollTop: Math.round(scrollAmount)
}, 1000, function () {
//change hash tag in url
if (history.pushState) {
history.pushState(null, '', '#' + hash);
}
});
return false;
}
});
};
return {
init: function () {
if ($('[data-edgtf-anchor]').length) {
anchorClick();
checkActiveStateOnScroll();
$(window).on('load', function () {
checkActiveStateOnLoad();
});
}
}
};
};
function edgtfInitBackToTop() {
var backToTopButton = $('#edgtf-back-to-top');
backToTopButton.on('click', function (e) {
e.preventDefault();
edgtf.html.animate({scrollTop: 0}, edgtf.window.scrollTop() / 5, 'easeOutQuint');
});
}
function edgtfBackButtonShowHide() {
edgtf.window.scroll(function () {
var b = $(this).scrollTop(),
c = $(this).height(),
d;
if (b > 0) {
d = b + c / 2;
} else {
d = 1;
}
if (d < 1e3) {
edgtfToTopButton('off');
} else {
edgtfToTopButton('on');
}
});
}
function edgtfToTopButton(a) {
var b = $("#edgtf-back-to-top");
b.removeClass('off on');
if (a === 'on') {
b.addClass('on');
} else {
b.addClass('off');
}
}
function edgtfInitSelfHostedVideoPlayer() {
var players = $('.edgtf-self-hosted-video');
if (players.length) {
players.mediaelementplayer({
audioWidth: '100%'
});
}
}
function edgtfSelfHostedVideoSize() {
var selfVideoHolder = $('.edgtf-self-hosted-video-holder .edgtf-video-wrap');
if (selfVideoHolder.length) {
selfVideoHolder.each(function () {
var thisVideo = $(this),
videoWidth = thisVideo.closest('.edgtf-self-hosted-video-holder').outerWidth(),
videoHeight = videoWidth / edgtf.videoRatio;
if (navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)) {
thisVideo.parent().width(videoWidth);
thisVideo.parent().height(videoHeight);
}
thisVideo.width(videoWidth);
thisVideo.height(videoHeight);
thisVideo.find('video, .mejs-overlay, .mejs-poster').width(videoWidth);
thisVideo.find('video, .mejs-overlay, .mejs-poster').height(videoHeight);
});
}
}
function edgtfFluidVideo() {
fluidvids.init({
selector: ['iframe'],
players: ['www.youtube.com', 'player.vimeo.com']
});
}
function edgtfSmoothTransition() {
if (edgtf.body.hasClass('edgtf-smooth-page-transitions')) {
//check for preload animation
if (edgtf.body.hasClass('edgtf-smooth-page-transitions-preloader')) {
var loader = $('body > .edgtf-smooth-transition-loader.edgtf-mimic-ajax'),
revSlider = $('#edgtf-main-rev-holder .rev_slider'),
title = $('.edgtf-loading-title-text'),
cursorDot = $('#edgtf-cursor-dot'),
withCustomCursor = ($('.edgtf-custom-cursor-enabled').length && !edgtf.htmlEl.hasClass('touch')) ? true : false;
if (title.length) {
var newTxt = title.text().replace(/\w|\W/g, function (c) {
return '<span class="edgtf-char-el">' + c + '</span>';
});
title.html(newTxt).append('<span class="edgtf-char-dot">.</span>');
}
var animateTitle = function (callback) {
title.css('visibility', 'visible');
var els = title.find('.edgtf-char-el'),
dot = title.find('.edgtf-char-dot');
els.each(function (i) {
var charEl = $(this);
setTimeout(function () {
charEl.addClass('edgtf-show');
}, i * 150);
});
els
.last()
.one(edgtf.transitionEnd, function () {
dot
.addClass('edgtf-show')
.one(edgtf.transitionEnd, function () {
if (typeof callback !== 'undefined') {
callback();
} else {
loader.fadeOut(500, 'easeOutCubic');
}
})
});
}
var cursorMorph = function () {
cursorDot.css('visibility', 'visible');
loader.fadeOut(100);
cursorDot
.addClass('edgtf-transition-in')
.removeClass('edgtf-scale-up edgtf-block')
.on(edgtf.transitionEnd, function () {
cursorDot.removeClass('edgtf-transition-in');
})
}
var hideLoader = function () {
if (withCustomCursor) {
cursorDot.addClass('edgtf-scale-up').css('visibility', 'hidden');
if (title.length) {
animateTitle(cursorMorph);
} else {
if (revSlider.length) {
revSlider.on('revolution.slide.onloaded', function () {
cursorMorph();
});
} else {
setTimeout(function() {
cursorMorph();
}, 500);
}
}
} else {
if (title.length) {
animateTitle();
} else {
$(window).on('load', function () {
loader.fadeOut(500, 'easeOutCubic');
});
}
}
}
var removeLoader = function () {
hideLoader();
$(window).on('pageshow', function (event) {
if (event.originalEvent.persisted) {
hideLoader();
if (withCustomCursor) {
$('#edgtf-cursor-dot').removeClass('edgtf-fade-cursor edgtf-transition-in edgtf-transition-out edgtf-scale-up edgtf-block');
}
}
});
}
removeLoader();
}
// if back button is pressed, show the custom cursor to avoid state where cursor has 'visibility: hidden;'
window.addEventListener( "pageshow", function ( event ) {
var historyPath = event.persisted || ( typeof window.performance != "undefined" && window.performance.navigation.type === 2 );
if ( historyPath ) {
$('#edgtf-cursor-dot').css('visibility', 'visible');
}
});
//check for fade out animation
if (edgtf.body.hasClass('edgtf-smooth-page-transitions-fadeout')) {
var linkItem = $('a'),
withCustomCursor = ($('.edgtf-custom-cursor-enabled').length && !edgtf.htmlEl.hasClass('touch')) ? true : false;
linkItem.on('click', function (e) {
var a = $(this);
if ((a.parents('.edgtf-shopping-cart-dropdown').length || a.parent('.product-remove').length) && a.hasClass('remove')) {
return;
}
if (
e.which === 1 && // check if the left mouse button has been pressed
a.attr('href').indexOf(window.location.host) >= 0 && // check if the link is to the same domain
(typeof a.data('rel') === 'undefined') && //Not pretty photo link
(typeof a.attr('rel') === 'undefined') && //Not VC pretty photo link
(!a.hasClass('lightbox-active')) && //Not lightbox plugin active
(typeof a.attr('target') === 'undefined' || a.attr('target') === '_self') && // check if the link opens in the same window
(a.attr('href').split('#')[0] !== window.location.href.split('#')[0]) // check if it is an anchor aiming for a different page
) {
e.preventDefault();
if (withCustomCursor) {
$('#edgtf-cursor-dot')
.removeClass('edgtf-fade-cursor')
.addClass('edgtf-transition-out edgtf-scale-up edgtf-block')
.one(edgtf.transitionEnd, function () {
window.location = a.attr('href');
})
} else {
$('.edgtf-wrapper-inner').fadeOut(1000, function () {
window.location = a.attr('href');
});
}
}
});
}
}
}
/*
* Preload background images for elements that have 'edgtf-preload-background' class
*/
function edgtfPreloadBackgrounds() {
var preloadBackHolder = $('.edgtf-preload-background');
if (preloadBackHolder.length) {
preloadBackHolder.each(function () {
var preloadBackground = $(this);
if (preloadBackground.css('background-image') !== '' && preloadBackground.css('background-image') !== 'none') {
var bgUrl = preloadBackground.attr('style');
bgUrl = bgUrl.match(/url\(["']?([^'")]+)['"]?\)/);
bgUrl = bgUrl ? bgUrl[1] : "";
if (bgUrl) {
var backImg = new Image();
backImg.src = bgUrl;
$(backImg).on('load', function () {
preloadBackground.removeClass('edgtf-preload-background');
});
}
} else {
$(window).on('load', function () {
preloadBackground.removeClass('edgtf-preload-background');
}); //make sure that edgtf-preload-background class is removed from elements with forced background none in css
}
});
}
}
function edgtfPrettyPhoto() {
/*jshint multistr: true */
var markupWhole = '<div class="pp_pic_holder"> \
<div class="ppt"> </div> \
<div class="pp_top"> \
<div class="pp_left"></div> \
<div class="pp_middle"></div> \
<div class="pp_right"></div> \
</div> \
<div class="pp_content_container"> \
<div class="pp_left"> \
<div class="pp_right"> \
<div class="pp_content"> \
<div class="pp_loaderIcon"></div> \
<div class="pp_fade"> \
<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
<div class="pp_hoverContainer"> \
<a class="pp_next" href="#"><span class="fa fa-angle-right"></span></a> \
<a class="pp_previous" href="#"><span class="fa fa-angle-left"></span></a> \
</div> \
<div id="pp_full_res"></div> \
<div class="pp_details"> \
<div class="pp_nav"> \
<a href="#" class="pp_arrow_previous">Previous</a> \
<p class="currentTextHolder">0/0</p> \
<a href="#" class="pp_arrow_next">Next</a> \
</div> \
<p class="pp_description"></p> \
{pp_social} \
<a class="pp_close" href="#">Close</a> \
</div> \
</div> \
</div> \
</div> \
</div> \
</div> \
<div class="pp_bottom"> \
<div class="pp_left"></div> \
<div class="pp_middle"></div> \
<div class="pp_right"></div> \
</div> \
</div> \
<div class="pp_overlay"></div>';
$("a[data-rel^='prettyPhoto']").prettyPhoto({
hook: 'data-rel',
animation_speed: 'normal', /* fast/slow/normal */
slideshow: false, /* false OR interval time in ms */
autoplay_slideshow: false, /* true/false */
opacity: 0.80, /* Value between 0 and 1 */
show_title: true, /* true/false */
allow_resize: true, /* Resize the photos bigger than viewport. true/false */
horizontal_padding: 0,
default_width: 960,
default_height: 540,
counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
wmode: 'opaque', /* Set the flash wmode attribute */
autoplay: true, /* Automatically start videos: True/False */
modal: false, /* If set to true, only the close button will close the window */
overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
deeplinking: false,
custom_markup: '',
social_tools: false,
markup: markupWhole
});
}
function edgtfSearchPostTypeWidget() {
var searchPostTypeHolder = $('.edgtf-search-post-type');
if (searchPostTypeHolder.length) {
searchPostTypeHolder.each(function () {
var thisSearch = $(this),
searchField = thisSearch.find('.edgtf-post-type-search-field'),
resultsHolder = thisSearch.siblings('.edgtf-post-type-search-results'),
searchLoading = thisSearch.find('.edgtf-search-loading'),
searchIcon = thisSearch.find('.edgtf-search-icon');
searchLoading.addClass('edgtf-hidden');
var postType = thisSearch.data('post-type'),
keyPressTimeout;
searchField.on('keyup paste', function () {
var field = $(this);
field.attr('autocomplete', 'off');
searchLoading.removeClass('edgtf-hidden');
searchIcon.addClass('edgtf-hidden');
clearTimeout(keyPressTimeout);
keyPressTimeout = setTimeout(function () {
var searchTerm = field.val();
if (searchTerm.length < 3) {
resultsHolder.html('');
resultsHolder.fadeOut();
searchLoading.addClass('edgtf-hidden');
searchIcon.removeClass('edgtf-hidden');
} else {
var ajaxData = {
action: 'ottar_edge_search_post_types',
term: searchTerm,
postType: postType,
search_post_types_nonce: $('input[name="edgtf_search_post_types_nonce"]').val()
};
$.ajax({
type: 'POST',
data: ajaxData,
url: edgtfGlobalVars.vars.edgtfAjaxUrl,
success: function (data) {
var response = JSON.parse(data);
if (response.status === 'success') {
searchLoading.addClass('edgtf-hidden');
searchIcon.removeClass('edgtf-hidden');
resultsHolder.html(response.data.html);
resultsHolder.fadeIn();
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
console.log("Status: " + textStatus);
console.log("Error: " + errorThrown);
searchLoading.addClass('edgtf-hidden');
searchIcon.removeClass('edgtf-hidden');
resultsHolder.fadeOut();
}
});
}
}, 500);
});
searchField.on('focusout', function () {
searchLoading.addClass('edgtf-hidden');
searchIcon.removeClass('edgtf-hidden');
resultsHolder.fadeOut();
});
});
}
}
/**
* Initializes load more data params
* @param container with defined data params
* return array
*/
function getLoadMoreData(container) {
var dataList = container.data(),
returnValue = {};
for (var property in dataList) {
if (dataList.hasOwnProperty(property)) {
if (typeof dataList[property] !== 'undefined' && dataList[property] !== false) {
returnValue[property] = dataList[property];
}
}
}
return returnValue;
}
/**
* Sets load more data params for ajax function
* @param container with defined data params
* @param action with defined action name
* return array
*/
function setLoadMoreAjaxData(container, action) {
var returnValue = {
action: action
};
for (var property in container) {
if (container.hasOwnProperty(property)) {
if (typeof container[property] !== 'undefined' && container[property] !== false) {
returnValue[property] = container[property];
}
}
}
return returnValue;
}
/*
** Init Masonry List Layout
*/
function edgtfInitGridMasonryListLayout() {
var holder = $('.edgtf-grid-masonry-list');
if (holder.length) {
holder.each(function () {
var thisHolder = $(this),
masonry = thisHolder.find('.edgtf-masonry-list-wrapper'),
size = thisHolder.find('.edgtf-masonry-grid-sizer').width();
masonry.waitForImages(function () {
masonry.isotope({
layoutMode: 'packery',
itemSelector: '.edgtf-item-space',
percentPosition: true,
masonry: {
columnWidth: '.edgtf-masonry-grid-sizer',
gutter: '.edgtf-masonry-grid-gutter'
}
});
if (thisHolder.find('.edgtf-fixed-masonry-item').length || thisHolder.hasClass('edgtf-fixed-masonry-items')) {
setFixedImageProportionSize(masonry, masonry.find('.edgtf-item-space'), size, true);
}
setTimeout(function () {
edgtfInitParallax();
}, 600);
masonry.isotope('layout').css('opacity', 1);
});
});
}
}
/**
* Initializes size for fixed image proportion - masonry layout
*/
function setFixedImageProportionSize(container, item, size, isFixedEnabled) {
if (container.hasClass('edgtf-masonry-images-fixed') || isFixedEnabled === true) {
var padding = parseInt(item.css('paddingLeft'), 10),
newSize = size - 2 * padding,
defaultMasonryItem = container.find('.edgtf-masonry-size-small'),
largeWidthMasonryItem = container.find('.edgtf-masonry-size-large-width'),
largeHeightMasonryItem = container.find('.edgtf-masonry-size-large-height'),
largeWidthHeightMasonryItem = container.find('.edgtf-masonry-size-large-width-height');
defaultMasonryItem.css('height', newSize);
largeHeightMasonryItem.css('height', Math.round(2 * (newSize + padding)));
if (edgtf.windowWidth > 680) {
largeWidthMasonryItem.css('height', newSize);
largeWidthHeightMasonryItem.css('height', Math.round(2 * (newSize + padding)));
} else {
largeWidthMasonryItem.css('height', Math.round(newSize / 2));
largeWidthHeightMasonryItem.css('height', newSize);
}
}
}
/**
* Object that represents icon with hover data
* @returns {{init: Function}} function that initializes icon's functionality
*/
var edgtfIconWithHover = function () {
//get all icons on page
var icons = $('.edgtf-icon-has-hover');
/**
* Function that triggers icon hover color functionality
*/
var iconHoverColor = function (icon) {
if (typeof icon.data('hover-color') !== 'undefined') {
var changeIconColor = function (event) {
event.data.icon.css('color', event.data.color);
};
var hoverColor = icon.data('hover-color'),
originalColor = icon.css('color');
if (hoverColor !== '') {
icon.on('mouseenter', {icon: icon, color: hoverColor}, changeIconColor);
icon.on('mouseleave', {icon: icon, color: originalColor}, changeIconColor);
}
}
};
return {
init: function () {
if (icons.length) {
icons.each(function () {
iconHoverColor($(this));
});
}
}
};
};
/*
** Init parallax
*/
function edgtfInitParallax() {
var parallaxHolder = $('.edgtf-parallax-row-holder');
if (parallaxHolder.length) {
parallaxHolder.each(function () {
var parallaxElement = $(this),
image = parallaxElement.data('parallax-bg-image'),
speed = parallaxElement.data('parallax-bg-speed') * 0.4,
height = 0;
if (typeof parallaxElement.data('parallax-bg-height') !== 'undefined' && parallaxElement.data('parallax-bg-height') !== false) {
height = parseInt(parallaxElement.data('parallax-bg-height'));
}
parallaxElement.css({'background-image': 'url(' + image + ')'});
if (height > 0) {
parallaxElement.css({'min-height': height + 'px', 'height': height + 'px'});
}
parallaxElement.parallax('50%', speed);
});
}
}
/*
** Init sticky sidebar widget
*/
function edgtfStickySidebarWidget() {
var sswHolder = $('.edgtf-widget-sticky-sidebar'),
headerHolder = $('.edgtf-page-header'),
headerHeight = headerHolder.length ? headerHolder.outerHeight() : 0,
widgetTopOffset = 0,
widgetTopPosition = 0,
sidebarHeight = 0,
sidebarWidth = 0,
objectsCollection = [];
function addObjectItems() {
if (sswHolder.length) {
sswHolder.each(function () {
var thisSswHolder = $(this),
mainSidebarHolder = thisSswHolder.parents('aside.edgtf-sidebar'),
widgetiseSidebarHolder = thisSswHolder.parents('.wpb_widgetised_column'),
sidebarHolder = '',
sidebarHolderHeight = 0;
widgetTopOffset = thisSswHolder.offset().top;
widgetTopPosition = thisSswHolder.position().top;
sidebarHeight = 0;
sidebarWidth = 0;
if (mainSidebarHolder.length) {
sidebarHeight = mainSidebarHolder.outerHeight();
sidebarWidth = mainSidebarHolder.outerWidth();
sidebarHolder = mainSidebarHolder;
sidebarHolderHeight = mainSidebarHolder.parent().parent().outerHeight();
var blogHolder = mainSidebarHolder.parent().parent().find('.edgtf-blog-holder');
if (blogHolder.length) {
sidebarHolderHeight -= parseInt(blogHolder.css('marginBottom'));
}
} else if (widgetiseSidebarHolder.length) {
sidebarHeight = widgetiseSidebarHolder.outerHeight();
sidebarWidth = widgetiseSidebarHolder.outerWidth();
sidebarHolder = widgetiseSidebarHolder;
sidebarHolderHeight = widgetiseSidebarHolder.parents('.vc_row').outerHeight();
}
objectsCollection.push({
'object': thisSswHolder,
'offset': widgetTopOffset,
'position': widgetTopPosition,
'height': sidebarHeight,
'width': sidebarWidth,
'sidebarHolder': sidebarHolder,
'sidebarHolderHeight': sidebarHolderHeight
});
});
}
}
function initStickySidebarWidget() {
if (objectsCollection.length) {
$.each(objectsCollection, function (i) {
var thisSswHolder = objectsCollection[i]['object'],
thisWidgetTopOffset = objectsCollection[i]['offset'],
thisWidgetTopPosition = objectsCollection[i]['position'],
thisSidebarHeight = objectsCollection[i]['height'],
thisSidebarWidth = objectsCollection[i]['width'],
thisSidebarHolder = objectsCollection[i]['sidebarHolder'],
thisSidebarHolderHeight = objectsCollection[i]['sidebarHolderHeight'];
if (edgtf.body.hasClass('edgtf-fixed-on-scroll')) {
var fixedHeader = $('.edgtf-fixed-wrapper.fixed');
if (fixedHeader.length) {
headerHeight = fixedHeader.outerHeight() + edgtfGlobalVars.vars.edgtfAddForAdminBar;
}
} else if (edgtf.body.hasClass('edgtf-no-behavior')) {
headerHeight = edgtfGlobalVars.vars.edgtfAddForAdminBar;
}
if (edgtf.windowWidth > 1024 && thisSidebarHolder.length) {
var sidebarPosition = -(thisWidgetTopPosition - headerHeight),
sidebarHeight = thisSidebarHeight - thisWidgetTopPosition - 40; // 40 is bottom margin of widget holder
//move sidebar up when hits the end of section row
var rowSectionEndInViewport = thisSidebarHolderHeight + thisWidgetTopOffset - headerHeight - thisWidgetTopPosition - edgtfGlobalVars.vars.edgtfTopBarHeight;
if ((edgtf.scroll >= thisWidgetTopOffset - headerHeight) && thisSidebarHeight < thisSidebarHolderHeight) {
if (thisSidebarHolder.hasClass('edgtf-sticky-sidebar-appeared')) {
thisSidebarHolder.css({'top': sidebarPosition + 'px'});
} else {
thisSidebarHolder.addClass('edgtf-sticky-sidebar-appeared').css({
'position': 'fixed',
'top': sidebarPosition + 'px',
'width': thisSidebarWidth,
'margin-top': '-10px'
}).animate({'margin-top': '0'}, 200);
}
if (edgtf.scroll + sidebarHeight >= rowSectionEndInViewport) {
var absBottomPosition = thisSidebarHolderHeight - sidebarHeight + sidebarPosition - headerHeight;
thisSidebarHolder.css({
'position': 'absolute',
'top': absBottomPosition + 'px'
});
} else {
if (thisSidebarHolder.hasClass('edgtf-sticky-sidebar-appeared')) {
thisSidebarHolder.css({
'position': 'fixed',
'top': sidebarPosition + 'px'
});
}
}
} else {
thisSidebarHolder.removeClass('edgtf-sticky-sidebar-appeared').css({
'position': 'relative',
'top': '0',
'width': 'auto'
});
}
} else {
thisSidebarHolder.removeClass('edgtf-sticky-sidebar-appeared').css({
'position': 'relative',
'top': '0',
'width': 'auto'
});
}
});
}
}
return {
init: function () {
addObjectItems();
initStickySidebarWidget();
$(window).scroll(function () {
initStickySidebarWidget();
});
},
reInit: initStickySidebarWidget
};
}
/**
* Init Owl Carousel
*/
function edgtfOwlSlider() {
var sliders = $('.edgtf-owl-slider');
if (sliders.length) {
sliders.each(function () {
var slider = $(this),
owlSlider = $(this),
slideItemsNumber = slider.children().length,
numberOfItems = 1,
loop = true,
autoplay = true,
autoplayHoverPause = true,
sliderSpeed = 5000,
sliderSpeedAnimation = 600,
margin = 0,
responsiveMargin = 0,
responsiveMargin1 = 0,
stagePadding = 0,
stagePaddingEnabled = false,
center = false,
autoWidth = false,
animateInClass = false, // keyframe css animation
animateOutClass = false, // keyframe css animation
navigation = true,
pagination = false,
thumbnail = false,
thumbnailSlider,
sliderIsCPTList = !!slider.hasClass('edgtf-list-is-slider'),
sliderDataHolder = sliderIsCPTList ? slider.parent() : slider, // this is condition for cpt to set list to be slider
idle = true;
if (typeof slider.data('number-of-items') !== 'undefined' && slider.data('number-of-items') !== false && !sliderIsCPTList) {
numberOfItems = slider.data('number-of-items');
}
if (typeof sliderDataHolder.data('number-of-columns') !== 'undefined' && sliderDataHolder.data('number-of-columns') !== false && sliderIsCPTList) {
switch (sliderDataHolder.data('number-of-columns')) {
case 'one':
numberOfItems = 1;
break;
case 'two':
numberOfItems = 2;
break;
case 'three':
numberOfItems = 3;
break;
case 'four':
numberOfItems = 4;
break;
case 'five':
numberOfItems = 5;
break;
case 'six':
numberOfItems = 6;
break;
default :
numberOfItems = 4;
break;
}
}
if (sliderDataHolder.data('enable-loop') === 'no') {
loop = false;
}
if (sliderDataHolder.data('enable-autoplay') === 'no') {
autoplay = false;
}
if (sliderDataHolder.data('enable-autoplay-hover-pause') === 'no') {
autoplayHoverPause = false;
}
if (typeof sliderDataHolder.data('slider-speed') !== 'undefined' && sliderDataHolder.data('slider-speed') !== false) {
sliderSpeed = sliderDataHolder.data('slider-speed');
}
if (typeof sliderDataHolder.data('slider-speed-animation') !== 'undefined' && sliderDataHolder.data('slider-speed-animation') !== false) {
sliderSpeedAnimation = sliderDataHolder.data('slider-speed-animation');
}
if (typeof sliderDataHolder.data('slider-margin') !== 'undefined' && sliderDataHolder.data('slider-margin') !== false) {
if (sliderDataHolder.data('slider-margin') === 'no') {
margin = 0;
} else {
margin = sliderDataHolder.data('slider-margin');
}
} else {
if (slider.parent().hasClass('edgtf-huge-space')) {
margin = 60;
} else if (slider.parent().hasClass('edgtf-large-space')) {
margin = 50;
} else if (slider.parent().hasClass('edgtf-medium-space')) {
margin = 40;
} else if (slider.parent().hasClass('edgtf-normal-space')) {
margin = 30;
} else if (slider.parent().hasClass('edgtf-small-space')) {
margin = 20;
} else if (slider.parent().hasClass('edgtf-tiny-space')) {
margin = 10;
}
}
if (sliderDataHolder.data('slider-padding') === 'yes') {
stagePaddingEnabled = true;
stagePadding = parseInt(slider.outerWidth() * 0.28);
margin = 50;
}
if (sliderDataHolder.data('enable-center') === 'yes') {
center = true;
}
if (sliderDataHolder.data('enable-auto-width') === 'yes') {
autoWidth = true;
}
if (typeof sliderDataHolder.data('slider-animate-in') !== 'undefined' && sliderDataHolder.data('slider-animate-in') !== false) {
animateInClass = sliderDataHolder.data('slider-animate-in');
}
if (typeof sliderDataHolder.data('slider-animate-out') !== 'undefined' && sliderDataHolder.data('slider-animate-out') !== false) {
animateOutClass = sliderDataHolder.data('slider-animate-out');
}
if (sliderDataHolder.data('enable-navigation') === 'no') {
navigation = false;
}
if (sliderDataHolder.data('enable-pagination') === 'yes') {
pagination = true;
}
if (sliderDataHolder.data('enable-thumbnail') === 'yes') {
thumbnail = true;
}
if (thumbnail && !pagination) {
/* page.index works only when pagination is enabled, so we add through html, but hide via css */
pagination = true;
owlSlider.addClass('edgtf-slider-hide-pagination');
}
if (navigation && pagination) {
slider.addClass('edgtf-slider-has-both-nav');
}
if (slideItemsNumber <= 1) {
loop = false;
autoplay = false;
navigation = false;
pagination = false;
}
var responsiveNumberOfItems1 = 1,
responsiveNumberOfItems2 = 2,
responsiveNumberOfItems3 = 3,
responsiveNumberOfItems4 = numberOfItems,
responsiveNumberOfItems5 = numberOfItems;
if (numberOfItems < 3) {
responsiveNumberOfItems2 = numberOfItems;
responsiveNumberOfItems3 = numberOfItems;
}
if (numberOfItems > 4) {
responsiveNumberOfItems4 = 4;
}
if (numberOfItems > 5) {
responsiveNumberOfItems5 = 5;
}
if (stagePaddingEnabled || margin > 30) {
responsiveMargin = 20;
responsiveMargin1 = 30;
}
if (margin > 0 && margin <= 30) {
responsiveMargin = margin;
responsiveMargin1 = margin;
}
slider.waitForImages(function () {
owlSlider = slider.owlCarousel({
items: numberOfItems,
loop: loop,
autoplay: autoplay,
autoplayHoverPause: autoplayHoverPause,
autoplayTimeout: sliderSpeed,
smartSpeed: sliderSpeedAnimation,
margin: margin,
stagePadding: stagePadding,
center: center,
autoWidth: autoWidth,
animateIn: animateInClass,
animateOut: animateOutClass,
dots: pagination,
nav: navigation,
navText: [
'<span class="edgtf-arrow"></span>',
'<span class="edgtf-arrow"></span>'
],
responsive: {
0: {
items: responsiveNumberOfItems1,
margin: responsiveMargin,
stagePadding: 0,
center: false,
autoWidth: false
},
681: {
items: responsiveNumberOfItems2,
margin: responsiveMargin1
},
769: {
items: responsiveNumberOfItems3,
margin: responsiveMargin1
},
1025: {
items: responsiveNumberOfItems4
},
1281: {
items: responsiveNumberOfItems5
},
1367: {
items: numberOfItems
}
},
onInitialize: function () {
slider.css('visibility', 'visible');
edgtfInitParallax();
if (thumbnail) {
thumbnailSlider.find('.edgtf-slider-thumbnail-item:first-child').addClass('active');
}
},
onTranslate: function (e) {
if (thumbnail) {
var index = e.page.index + 1;
thumbnailSlider.find('.edgtf-slider-thumbnail-item.active').removeClass('active');
thumbnailSlider.find('.edgtf-slider-thumbnail-item:nth-child(' + index + ')').addClass('active');
}
idle = false;
},
onTranslated: function () {
idle = true;
},
onDrag: function (e) {
if (edgtf.body.hasClass('edgtf-smooth-page-transitions-fadeout')) {
var sliderIsMoving = e.isTrigger > 0;
if (sliderIsMoving) {
slider.addClass('edgtf-slider-is-moving');
}
}
},
onDragged: function () {
if (edgtf.body.hasClass('edgtf-smooth-page-transitions-fadeout') && slider.hasClass('edgtf-slider-is-moving')) {
setTimeout(function () {
slider.removeClass('edgtf-slider-is-moving');
}, 500);
}
}
});
if (sliderDataHolder.data('enable-mousewheel-scroll') === 'yes') {
owlSlider.on('mousewheel', '.owl-stage', function (e) {
if (idle) {
var pos = e.deltaY;
if (pos > 0) {
owlSlider.trigger('prev.owl.carousel');
} else {
owlSlider.trigger('next.owl.carousel');
}
// Trigger event.
$(document.body).trigger('owl_mouseweel_slider_trigger');
e.preventDefault();
}
});
}
});
if (thumbnail) {
thumbnailSlider = slider.parent().find('.edgtf-slider-thumbnail');
var numberOfThumbnails = parseInt(thumbnailSlider.data('thumbnail-count'));
var numberOfThumbnailsClass = '';
switch (numberOfThumbnails % 6) {
case 2 :
numberOfThumbnailsClass = 'two';
break;
case 3 :
numberOfThumbnailsClass = 'three';
break;
case 4 :
numberOfThumbnailsClass = 'four';
break;
case 5 :
numberOfThumbnailsClass = 'five';
break;
case 0 :
numberOfThumbnailsClass = 'six';
break;
default :
numberOfThumbnailsClass = 'six';
break;
}
if (numberOfThumbnailsClass !== '') {
thumbnailSlider.addClass('edgtf-slider-columns-' + numberOfThumbnailsClass)
}
thumbnailSlider.find('.edgtf-slider-thumbnail-item').on('click', function () {
$(this).siblings('.active').removeClass('active');
$(this).addClass('active');
owlSlider.trigger('to.owl.carousel', [$(this).index(), sliderSpeedAnimation]);
});
}
});
}
}
function edgtfDashboardForm() {
var forms = $('.edgtf-dashboard-form');
if (forms.length) {
forms.each(function () {
var thisForm = $(this),
btnText = thisForm.find('button'),
updatingBtnText = btnText.data('updating-text'),
updatedBtnText = btnText.data('updated-text'),
actionName = thisForm.data('action');
thisForm.on('submit', function (e) {
e.preventDefault();
var prevBtnText = btnText.html(),
gallery = $(this).find('.edgtf-dashboard-gallery-upload-hidden'),
namesArray = [];
btnText.html(updatingBtnText);
//get data
var formData = new FormData();
//get files
gallery.each(function () {
var thisGallery = $(this),
thisName = thisGallery.attr('name'),
thisRepeaterID = thisGallery.attr('id'),
thisFiles = thisGallery[0].files,
newName;
//this part is needed for repeater with image uploads
//adding specific names so they can be sorted in regular files and files in repeater
if (thisName.indexOf("[") !== '-1') {
newName = thisName.substring(0, thisName.indexOf("[")) + '_edgtf_regarray_';
var firstIndex = thisRepeaterID.indexOf('['),
lastIndex = thisRepeaterID.indexOf(']'),
index = thisRepeaterID.substring(firstIndex + 1, lastIndex);
namesArray.push(newName);
newName = newName + index + '_';
} else {
newName = thisName + '_edgtf_reg_';
}
//if file not sent, send dummy file - so repeater fields are sent
if (thisFiles.length === 0) {
formData.append(newName, new File([""], "edgtf-dummy-file.txt", {
type: "text/plain"
}));
}
for (var i = 0; i < thisFiles.length; i++) {
var allowedTypes = ['image/png', 'image/jpg', 'image/jpeg', 'application/pdf'];
//security purposed - check if there is more than one dot in file name, also check whether the file type is in allowed types
if (thisFiles[i].name.match(/\./g).length === 1 && $.inArray(thisFiles[i].type, allowedTypes) !== -1) {
formData.append(newName + i, thisFiles[i]);
}
}
});
formData.append('action', actionName);
//get data from form
var otherData = $(this).serialize();
formData.append('data', otherData);
$.ajax({
type: 'POST',
data: formData,
contentType: false,
processData: false,
url: edgtfGlobalVars.vars.edgtfAjaxUrl,
success: function (data) {
var response;
response = JSON.parse(data);
// append ajax response html
edgtf.modules.socialLogin.edgtfRenderAjaxResponseMessage(response);
if (response.status === 'success') {
btnText.html(updatedBtnText);
window.location = response.redirect;
} else {
btnText.html(prevBtnText);
}
}
});
return false;
});
});
}
}
function edgtfInitCustomCursor() {
if (edgtf.body.hasClass('edgtf-custom-cursor-enabled') && !edgtf.htmlEl.hasClass('touch')) {
edgtf.body.append(' <div id="edgtf-cursor-dot-holder"><span id="edgtf-cursor-dot"></span></div>');
var cursorDotHolder = $('#edgtf-cursor-dot-holder'),
cursorDot = $('#edgtf-cursor-dot'),
invertElements = $('.edgtf-fullscreen-menu-holder-outer, #edgtf-back-to-top, footer, .edgtf-side-menu, .edgtf-main-menu .inner, \
.edgtf-btn-outline:not(.edgtf-btn-custom-hover-bg), .single_add_to_cart_button, .edgtf-shopping-cart-dropdown, \
ul.products>.product .edgtf-pl-inner>a, div.edgtf-pli .edgtf-pli-link, .widget.woocommerce .button, \
.wpcf7-submit, .edgtf-custom-cursor-invert'),
fadeOutElements = $('.edgtf-pl-gallery-info-follow-cursor article, .edgtf-pl-fullheight-gallery, \
.edgtf-blog-video-holder, .edgtf-iframe-video-holder, .edgtf-iwt-text-follow-cursor');
cursorDotHolder.css({
transform: "matrix(1, 0, 0, 1, " + edgtf.windowWidth / 2 + ", " + edgtf.windowHeight / 2 + ")"
});
//cursor move
$(document)
.on('mousemove', function (e) {
if (!cursorDot.hasClass('edgtf-block')) {
cursorDotHolder.css({
transform: "matrix(1, 0, 0, 1, " + e.clientX + ", " + e.clientY + ")"
});
}
})
.on('mouseleave', function () {
if (!cursorDot.hasClass('edgtf-block')) {
cursorDot.addClass('edgtf-fade-cursor');
}
})
.on('mouseenter', function () {
if (!cursorDot.hasClass('edgtf-block')) {
cursorDot.removeClass('edgtf-fade-cursor');
}
});
//links hovering
$('a')
.on("mouseenter", function () {
if (!cursorDot.hasClass('edgtf-block')) {
cursorDotHolder.addClass('edgtf-hovering');
}
})
.on("mouseleave", function () {
if (!cursorDot.hasClass('edgtf-block')) {
cursorDotHolder.removeClass('edgtf-hovering');
}
});
//invert color
if (invertElements.length) {
invertElements
.on('mousemove', function () {
if (!cursorDot.hasClass('edgtf-block')) {
cursorDot.addClass('edgtf-invert');
}
})
.on("mouseleave", function () {
if (!cursorDot.hasClass('edgtf-block')) {
cursorDot.removeClass('edgtf-invert');
}
});
}
//fade out cursor
if (fadeOutElements.length) {
fadeOutElements
.on('mouseenter', function () {
if (!cursorDot.hasClass('edgtf-block')) {
cursorDot.addClass('edgtf-fade-cursor');
}
})
.on("mouseleave", function () {
if (!cursorDot.hasClass('edgtf-block')) {
cursorDot.removeClass('edgtf-fade-cursor');
}
});
}
}
}
})(jQuery);
(function ($) {
"use strict";
var blog = {};
edgtf.modules.blog = blog;
blog.edgtfOnDocumentReady = edgtfOnDocumentReady;
blog.edgtfOnWindowLoad = edgtfOnWindowLoad;
blog.edgtfOnWindowScroll = edgtfOnWindowScroll;
$(document).ready(edgtfOnDocumentReady);
$(window).on('load', edgtfOnWindowLoad)
$(window).scroll(edgtfOnWindowScroll);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitAudioPlayer();
}
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
edgtfInitBlogPagination().init();
}
/*
All functions to be called on $(window).scroll() should be in this function
*/
function edgtfOnWindowScroll() {
edgtfInitBlogPagination().scroll();
}
/**
* Init audio player for Blog list and single pages
*/
function edgtfInitAudioPlayer() {
var players = $('audio.edgtf-blog-audio');
if (players.length) {
players.mediaelementplayer({
audioWidth: '100%'
});
}
}
/**
* Initializes blog pagination functions
*/
function edgtfInitBlogPagination() {
var holder = $('.edgtf-blog-holder');
var initLoadMorePagination = function (thisHolder) {
var loadMoreButton = thisHolder.find('.edgtf-blog-pag-load-more a');
loadMoreButton.on('click', function (e) {
e.preventDefault();
e.stopPropagation();
initMainPagFunctionality(thisHolder);
});
};
var initInifiteScrollPagination = function (thisHolder) {
var blogListHeight = thisHolder.outerHeight(),
blogListTopOffest = thisHolder.offset().top,
blogListPosition = blogListHeight + blogListTopOffest - edgtfGlobalVars.vars.edgtfAddForAdminBar;
if (!thisHolder.hasClass('edgtf-blog-pagination-infinite-scroll-started') && edgtf.scroll + edgtf.windowHeight > blogListPosition) {
initMainPagFunctionality(thisHolder);
}
};
var initMainPagFunctionality = function (thisHolder) {
var thisHolderInner = thisHolder.children('.edgtf-blog-holder-inner'),
nextPage,
maxNumPages;
if (typeof thisHolder.data('max-num-pages') !== 'undefined' && thisHolder.data('max-num-pages') !== false) {
maxNumPages = thisHolder.data('max-num-pages');
}
if (thisHolder.hasClass('edgtf-blog-pagination-infinite-scroll')) {
thisHolder.addClass('edgtf-blog-pagination-infinite-scroll-started');
}
var loadMoreDatta = edgtf.modules.common.getLoadMoreData(thisHolder),
loadingItem = thisHolder.find('.edgtf-blog-pag-loading');
nextPage = loadMoreDatta.nextPage;
var nonceHolder = thisHolder.find('input[name*="edgtf_blog_load_more_nonce_"]');
loadMoreDatta.blog_load_more_id = nonceHolder.attr('name').substring(nonceHolder.attr('name').length - 4, nonceHolder.attr('name').length);
loadMoreDatta.blog_load_more_nonce = nonceHolder.val();
if (nextPage <= maxNumPages) {
loadingItem.addClass('edgtf-showing');
var ajaxData = edgtf.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'ottar_edge_blog_load_more');
$.ajax({
type: 'POST',
data: ajaxData,
url: edgtfGlobalVars.vars.edgtfAjaxUrl,
success: function (data) {
nextPage++;
thisHolder.data('next-page', nextPage);
var response = $.parseJSON(data),
responseHtml = response.html;
thisHolder.waitForImages(function () {
if (thisHolder.hasClass('edgtf-grid-masonry-list')) {
edgtfInitAppendIsotopeNewContent(thisHolderInner, loadingItem, responseHtml);
edgtf.modules.common.setFixedImageProportionSize(thisHolder, thisHolder.find('article'), thisHolderInner.find('.edgtf-masonry-grid-sizer').width());
} else {
edgtfInitAppendGalleryNewContent(thisHolderInner, loadingItem, responseHtml);
}
setTimeout(function () {
edgtfInitAudioPlayer();
edgtf.modules.common.edgtfOwlSlider();
edgtf.modules.common.edgtfFluidVideo();
edgtf.modules.common.edgtfInitSelfHostedVideoPlayer();
edgtf.modules.common.edgtfSelfHostedVideoSize();
if (typeof edgtf.modules.common.edgtfStickySidebarWidget === 'function') {
edgtf.modules.common.edgtfStickySidebarWidget().reInit();
}
// Trigger event.
$(document.body).trigger('blog_list_load_more_trigger');
}, 400);
});
if (thisHolder.hasClass('edgtf-blog-pagination-infinite-scroll-started')) {
thisHolder.removeClass('edgtf-blog-pagination-infinite-scroll-started');
}
}
});
}
if (nextPage === maxNumPages) {
thisHolder.find('.edgtf-blog-pag-load-more').hide();
}
};
var edgtfInitAppendIsotopeNewContent = function (thisHolderInner, loadingItem, responseHtml) {
thisHolderInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'});
loadingItem.removeClass('edgtf-showing');
setTimeout(function () {
thisHolderInner.isotope('layout');
}, 600);
};
var edgtfInitAppendGalleryNewContent = function (thisHolderInner, loadingItem, responseHtml) {
loadingItem.removeClass('edgtf-showing');
thisHolderInner.append(responseHtml);
};
return {
init: function () {
if (holder.length) {
holder.each(function () {
var thisHolder = $(this);
if (thisHolder.hasClass('edgtf-blog-pagination-load-more')) {
initLoadMorePagination(thisHolder);
}
if (thisHolder.hasClass('edgtf-blog-pagination-infinite-scroll')) {
initInifiteScrollPagination(thisHolder);
}
});
}
},
scroll: function () {
if (holder.length) {
holder.each(function () {
var thisHolder = $(this);
if (thisHolder.hasClass('edgtf-blog-pagination-infinite-scroll')) {
initInifiteScrollPagination(thisHolder);
}
});
}
}
};
}
})(jQuery);
(function ($) {
"use strict";
var footer = {};
edgtf.modules.footer = footer;
footer.edgtfOnWindowLoad = edgtfOnWindowLoad;
$(window).on('load', edgtfOnWindowLoad);
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
uncoveringFooter();
}
function uncoveringFooter() {
var uncoverFooter = $('body:not(.error404) .edgtf-footer-uncover');
if (uncoverFooter.length && !edgtf.htmlEl.hasClass('touch')) {
var footer = $('footer'),
footerHeight = footer.outerHeight(),
content = $('.edgtf-content');
var uncoveringCalcs = function () {
content.css('margin-bottom', footerHeight);
footer.css('height', footerHeight);
};
//set
uncoveringCalcs();
$(window).resize(function () {
//recalc
footerHeight = footer.find('.edgtf-footer-inner').outerHeight();
uncoveringCalcs();
});
}
}
})(jQuery);
(function ($) {
"use strict";
var header = {};
edgtf.modules.header = header;
header.edgtfSetDropDownMenuPosition = edgtfSetDropDownMenuPosition;
header.edgtfSetDropDownWideMenuPosition = edgtfSetDropDownWideMenuPosition;
header.edgtfOnDocumentReady = edgtfOnDocumentReady;
header.edgtfOnWindowLoad = edgtfOnWindowLoad;
$(document).ready(edgtfOnDocumentReady);
$(window).on('load', edgtfOnWindowLoad);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfSetDropDownMenuPosition();
setTimeout(function () {
edgtfDropDownMenu();
}, 100);
}
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
edgtfSetDropDownWideMenuPosition();
}
/**
* Set dropdown position
*/
function edgtfSetDropDownMenuPosition() {
var menuItems = $('.edgtf-drop-down > ul > li.narrow.menu-item-has-children');
if (menuItems.length) {
menuItems.each(function (i) {
var thisItem = $(this),
menuItemPosition = thisItem.offset().left,
dropdownHolder = thisItem.find('.second'),
dropdownMenuItem = dropdownHolder.find('.inner ul'),
dropdownMenuWidth = dropdownMenuItem.outerWidth(),
menuItemFromLeft = edgtf.windowWidth - menuItemPosition;
if (edgtf.body.hasClass('edgtf-boxed')) {
menuItemFromLeft = edgtf.boxedLayoutWidth - (menuItemPosition - (edgtf.windowWidth - edgtf.boxedLayoutWidth) / 2);
}
var dropDownMenuFromLeft; //has to stay undefined because 'dropDownMenuFromLeft < dropdownMenuWidth' conditional will be true
if (thisItem.find('li.sub').length > 0) {
dropDownMenuFromLeft = menuItemFromLeft - dropdownMenuWidth;
}
dropdownHolder.removeClass('right');
dropdownMenuItem.removeClass('right');
if (menuItemFromLeft < dropdownMenuWidth || dropDownMenuFromLeft < dropdownMenuWidth) {
dropdownHolder.addClass('right');
dropdownMenuItem.addClass('right');
}
});
}
}
/**
* Set dropdown wide position
*/
function edgtfSetDropDownWideMenuPosition() {
var menuItems = $(".edgtf-drop-down > ul > li.wide");
if (menuItems.length) {
menuItems.each(function (i) {
var menuItem = $(this);
var menuItemSubMenu = menuItem.find('.second');
if (menuItemSubMenu.length && !menuItemSubMenu.hasClass('left_position') && !menuItemSubMenu.hasClass('right_position')) {
menuItemSubMenu.css('left', 0);
var left_position = menuItemSubMenu.offset().left;
if (edgtf.body.hasClass('edgtf-boxed')) {
//boxed layout case
var boxedWidth = $('.edgtf-boxed .edgtf-wrapper .edgtf-wrapper-inner').outerWidth();
left_position = left_position - (edgtf.windowWidth - boxedWidth) / 2;
menuItemSubMenu.css({'left': -left_position, 'width': boxedWidth});
} else if (edgtf.body.hasClass('edgtf-wide-dropdown-menu-in-grid')) {
//wide dropdown in grid case
menuItemSubMenu.css({
'left': -left_position + (edgtf.windowWidth - edgtf.gridWidth()) / 2,
'width': edgtf.gridWidth()
});
}
else {
//wide dropdown full width case
menuItemSubMenu.css({'left': -left_position, 'width': edgtf.windowWidth});
}
}
});
}
}
function edgtfDropDownMenu() {
var menu_items = $('.edgtf-drop-down > ul > li');
menu_items.each(function () {
var thisItem = $(this);
if (thisItem.find('.second').length) {
thisItem.waitForImages(function () {
var dropDownHolder = thisItem.find('.second'),
dropDownHolderHeight = !edgtf.menuDropdownHeightSet ? dropDownHolder.outerHeight() : 0;
if (thisItem.hasClass('wide')) {
var tallest = 0,
dropDownSecondItem = dropDownHolder.find('> .inner > ul > li');
dropDownSecondItem.each(function () {
var thisHeight = $(this).outerHeight();
if (thisHeight > tallest) {
tallest = thisHeight;
}
});
dropDownSecondItem.css('height', '').height(tallest);
if (!edgtf.menuDropdownHeightSet) {
dropDownHolderHeight = dropDownHolder.outerHeight();
}
}
if (!edgtf.menuDropdownHeightSet) {
dropDownHolder.height(0);
}
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
thisItem.on("touchstart mouseenter", function () {
dropDownHolder.css({
'height': dropDownHolderHeight,
'overflow': 'visible',
'visibility': 'visible',
'opacity': '1'
});
}).on("mouseleave", function () {
dropDownHolder.css({
'height': '0px',
'overflow': 'hidden',
'visibility': 'hidden',
'opacity': '0'
});
});
} else {
if (edgtf.body.hasClass('edgtf-dropdown-animate-height')) {
var animateConfig = {
interval: 0,
over: function () {
setTimeout(function () {
dropDownHolder.addClass('edgtf-drop-down-start').css({
'visibility': 'visible',
'height': '0',
'opacity': '1'
});
dropDownHolder.stop().animate({
'height': dropDownHolderHeight
}, 400, 'easeInOutQuint', function () {
dropDownHolder.css('overflow', 'visible');
});
}, 100);
},
timeout: 100,
out: function () {
dropDownHolder.stop().animate({
'height': '0',
'opacity': 0
}, 100, function () {
dropDownHolder.css({
'overflow': 'hidden',
'visibility': 'hidden'
});
});
dropDownHolder.removeClass('edgtf-drop-down-start');
}
};
thisItem.hoverIntent(animateConfig);
} else {
var config = {
interval: 0,
over: function () {
setTimeout(function () {
dropDownHolder.addClass('edgtf-drop-down-start').stop().css({'height': dropDownHolderHeight});
}, 150);
},
timeout: 150,
out: function () {
dropDownHolder.stop().css({'height': '0'}).removeClass('edgtf-drop-down-start');
}
};
thisItem.hoverIntent(config);
}
}
});
}
});
$('.edgtf-drop-down ul li.wide ul li a').on('click', function (e) {
if (e.which === 1) {
var $this = $(this);
setTimeout(function () {
$this.mouseleave();
}, 500);
}
});
edgtf.menuDropdownHeightSet = true;
}
})(jQuery);
(function ($) {
"use strict";
var sidearea = {};
edgtf.modules.sidearea = sidearea;
sidearea.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfSideArea();
edgtfSideAreaScroll();
}
/**
* Show/hide side area
*/
function edgtfSideArea() {
var wrapper = $('.edgtf-wrapper'),
sideMenu = $('.edgtf-side-menu'),
sideMenuButtonOpen = $('a.edgtf-side-menu-button-opener'),
cssClass,
//Flags
slideFromRight = false,
slideWithContent = false,
slideUncovered = false;
if (edgtf.body.hasClass('edgtf-side-menu-slide-from-right')) {
$('.edgtf-cover').remove();
cssClass = 'edgtf-right-side-menu-opened';
wrapper.prepend('<div class="edgtf-cover"/>');
slideFromRight = true;
} else if (edgtf.body.hasClass('edgtf-side-menu-slide-with-content')) {
cssClass = 'edgtf-side-menu-open';
slideWithContent = true;
} else if (edgtf.body.hasClass('edgtf-side-area-uncovered-from-content')) {
cssClass = 'edgtf-right-side-menu-opened';
slideUncovered = true;
}
$('a.edgtf-side-menu-button-opener, a.edgtf-close-side-menu').on('click', function (e) {
e.preventDefault();
if (!sideMenuButtonOpen.hasClass('opened')) {
sideMenuButtonOpen.addClass('opened');
edgtf.body.addClass(cssClass);
if (slideFromRight) {
$('.edgtf-wrapper .edgtf-cover').on('click', function () {
edgtf.body.removeClass('edgtf-right-side-menu-opened');
sideMenuButtonOpen.removeClass('opened');
});
}
if (slideUncovered) {
sideMenu.css({
'visibility': 'visible'
});
}
var currentScroll = $(window).scrollTop();
$(window).scroll(function () {
if (Math.abs(edgtf.scroll - currentScroll) > 400) {
edgtf.body.removeClass(cssClass);
sideMenuButtonOpen.removeClass('opened');
if (slideUncovered) {
var hideSideMenu = setTimeout(function () {
sideMenu.css({'visibility': 'hidden'});
clearTimeout(hideSideMenu);
}, 400);
}
}
});
} else {
sideMenuButtonOpen.removeClass('opened');
edgtf.body.removeClass(cssClass);
if (slideUncovered) {
var hideSideMenu = setTimeout(function () {
sideMenu.css({'visibility': 'hidden'});
clearTimeout(hideSideMenu);
}, 400);
}
}
if (slideWithContent) {
e.stopPropagation();
wrapper.on('click', function () {
e.preventDefault();
sideMenuButtonOpen.removeClass('opened');
edgtf.body.removeClass('edgtf-side-menu-open');
});
}
});
}
/*
** Smooth scroll functionality for Side Area
*/
function edgtfSideAreaScroll() {
var sideMenu = $('.edgtf-side-menu');
if (sideMenu.length) {
sideMenu.perfectScrollbar({
wheelSpeed: 0.6,
suppressScrollX: true
});
}
}
})(jQuery);
(function ($) {
"use strict";
var title = {};
edgtf.modules.title = title;
title.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfParallaxTitle();
}
/*
** Title image with parallax effect
*/
function edgtfParallaxTitle() {
var parallaxBackground = $('.edgtf-title-holder.edgtf-bg-parallax');
if (parallaxBackground.length > 0 && edgtf.windowWidth > 1024) {
var parallaxBackgroundWithZoomOut = parallaxBackground.hasClass('edgtf-bg-parallax-zoom-out'),
titleHeight = parseInt(parallaxBackground.data('height')),
imageWidth = parseInt(parallaxBackground.data('background-width')),
parallaxRate = titleHeight / 10000 * 7,
parallaxYPos = -(edgtf.scroll * parallaxRate),
adminBarHeight = edgtfGlobalVars.vars.edgtfAddForAdminBar;
parallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'});
if (parallaxBackgroundWithZoomOut) {
parallaxBackground.css({'background-size': imageWidth - edgtf.scroll + 'px auto'});
}
//set position of background on window scroll
$(window).scroll(function () {
parallaxYPos = -(edgtf.scroll * parallaxRate);
parallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'});
if (parallaxBackgroundWithZoomOut) {
parallaxBackground.css({'background-size': imageWidth - edgtf.scroll + 'px auto'});
}
});
}
}
})(jQuery);
(function ($) {
'use strict';
var woocommerce = {};
edgtf.modules.woocommerce = woocommerce;
woocommerce.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitQuantityButtons();
edgtfInitSelect2();
edgtfInitSingleProductLightbox();
}
/*
** Init quantity buttons to increase/decrease products for cart
*/
function edgtfInitQuantityButtons() {
$(document).on('click', '.edgtf-quantity-minus, .edgtf-quantity-plus', function (e) {
e.stopPropagation();
var button = $(this),
inputField = button.siblings('.edgtf-quantity-input'),
step = parseFloat(inputField.data('step')),
max = parseFloat(inputField.data('max')),
minus = false,
inputValue = parseFloat(inputField.val()),
newInputValue;
if (button.hasClass('edgtf-quantity-minus')) {
minus = true;
}
if (minus) {
newInputValue = inputValue - step;
if (newInputValue >= 1) {
inputField.val(newInputValue);
} else {
inputField.val(0);
}
} else {
newInputValue = inputValue + step;
if (max === undefined) {
inputField.val(newInputValue);
} else {
if (newInputValue >= max) {
inputField.val(max);
} else {
inputField.val(newInputValue);
}
}
}
inputField.trigger('change');
});
}
/*
** Init select2 script for select html dropdowns
*/
function edgtfInitSelect2() {
var orderByDropDown = $('.woocommerce-ordering .orderby');
if (orderByDropDown.length) {
orderByDropDown.select2({
minimumResultsForSearch: Infinity
});
}
var variableProducts = $('.edgtf-woocommerce-page .edgtf-content .variations td.value select');
if (variableProducts.length) {
variableProducts.select2();
}
var shippingCountryCalc = $('#calc_shipping_country');
if (shippingCountryCalc.length) {
shippingCountryCalc.select2();
}
var shippingStateCalc = $('.cart-collaterals .shipping select#calc_shipping_state');
if (shippingStateCalc.length) {
shippingStateCalc.select2();
}
}
/*
** Init Product Single Pretty Photo attributes
*/
function edgtfInitSingleProductLightbox() {
var item = $('.edgtf-woo-single-page.edgtf-woo-single-has-pretty-photo .images .woocommerce-product-gallery__image');
if (item.length) {
item.children('a').attr('data-rel', 'prettyPhoto[woo_single_pretty_photo]');
if (typeof edgtf.modules.common.edgtfPrettyPhoto === "function") {
edgtf.modules.common.edgtfPrettyPhoto();
}
}
}
})(jQuery);
(function ($) {
"use strict";
var blogListSC = {};
edgtf.modules.blogListSC = blogListSC;
blogListSC.edgtfOnWindowLoad = edgtfOnWindowLoad;
blogListSC.edgtfOnWindowScroll = edgtfOnWindowScroll;
$(window).on('load', edgtfOnWindowLoad);
$(window).scroll(edgtfOnWindowScroll);
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
edgtfInitBlogListShortcodePagination().init();
}
/*
All functions to be called on $(window).scroll() should be in this function
*/
function edgtfOnWindowScroll() {
edgtfInitBlogListShortcodePagination().scroll();
}
/**
* Init blog list shortcode pagination functions
*/
function edgtfInitBlogListShortcodePagination() {
var holder = $('.edgtf-blog-list-holder');
var initStandardPagination = function (thisHolder) {
var standardLink = thisHolder.find('.edgtf-bl-standard-pagination li');
if (standardLink.length) {
standardLink.each(function () {
var thisLink = $(this).children('a'),
pagedLink = 1;
thisLink.on('click', function (e) {
e.preventDefault();
e.stopPropagation();
if (typeof thisLink.data('paged') !== 'undefined' && thisLink.data('paged') !== false) {
pagedLink = thisLink.data('paged');
}
initMainPagFunctionality(thisHolder, pagedLink);
});
});
}
};
var initLoadMorePagination = function (thisHolder) {
var loadMoreButton = thisHolder.find('.edgtf-blog-pag-load-more a');
loadMoreButton.on('click', function (e) {
e.preventDefault();
e.stopPropagation();
initMainPagFunctionality(thisHolder);
});
};
var initInifiteScrollPagination = function (thisHolder) {
var blogListHeight = thisHolder.outerHeight(),
blogListTopOffest = thisHolder.offset().top,
blogListPosition = blogListHeight + blogListTopOffest - edgtfGlobalVars.vars.edgtfAddForAdminBar;
if (!thisHolder.hasClass('edgtf-bl-pag-infinite-scroll-started') && edgtf.scroll + edgtf.windowHeight > blogListPosition) {
initMainPagFunctionality(thisHolder);
}
};
var initMainPagFunctionality = function (thisHolder, pagedLink) {
var thisHolderInner = thisHolder.find('.edgtf-blog-list'),
nextPage,
maxNumPages;
if (typeof thisHolder.data('max-num-pages') !== 'undefined' && thisHolder.data('max-num-pages') !== false) {
maxNumPages = thisHolder.data('max-num-pages');
}
if (thisHolder.hasClass('edgtf-bl-pag-standard-shortcodes')) {
thisHolder.data('next-page', pagedLink);
}
if (thisHolder.hasClass('edgtf-bl-pag-infinite-scroll')) {
thisHolder.addClass('edgtf-bl-pag-infinite-scroll-started');
}
var loadMoreDatta = edgtf.modules.common.getLoadMoreData(thisHolder),
loadingItem = thisHolder.find('.edgtf-blog-pag-loading');
nextPage = loadMoreDatta.nextPage;
var nonceHolder = thisHolder.find('input[name*="edgtf_blog_load_more_nonce_"]');
loadMoreDatta.blog_load_more_id = nonceHolder.attr('name').substring(nonceHolder.attr('name').length - 4, nonceHolder.attr('name').length);
loadMoreDatta.blog_load_more_nonce = nonceHolder.val();
if (nextPage <= maxNumPages) {
if (thisHolder.hasClass('edgtf-bl-pag-standard-shortcodes')) {
loadingItem.addClass('edgtf-showing edgtf-standard-pag-trigger');
thisHolder.addClass('edgtf-bl-pag-standard-shortcodes-animate');
} else {
loadingItem.addClass('edgtf-showing');
}
var ajaxData = edgtf.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'ottar_edge_blog_shortcode_load_more');
$.ajax({
type: 'POST',
data: ajaxData,
url: edgtfGlobalVars.vars.edgtfAjaxUrl,
success: function (data) {
if (!thisHolder.hasClass('edgtf-bl-pag-standard-shortcodes')) {
nextPage++;
}
thisHolder.data('next-page', nextPage);
var response = $.parseJSON(data),
responseHtml = response.html;
if (thisHolder.hasClass('edgtf-bl-pag-standard-shortcodes')) {
edgtfInitStandardPaginationLinkChanges(thisHolder, maxNumPages, nextPage);
thisHolder.waitForImages(function () {
if (thisHolder.hasClass('edgtf-bl-masonry')) {
edgtfInitHtmlIsotopeNewContent(thisHolder, thisHolderInner, loadingItem, responseHtml);
} else {
edgtfInitHtmlGalleryNewContent(thisHolder, thisHolderInner, loadingItem, responseHtml);
if (typeof edgtf.modules.common.edgtfStickySidebarWidget === 'function') {
edgtf.modules.common.edgtfStickySidebarWidget().reInit();
}
}
});
} else {
thisHolder.waitForImages(function () {
if (thisHolder.hasClass('edgtf-bl-masonry')) {
edgtfInitAppendIsotopeNewContent(thisHolderInner, loadingItem, responseHtml);
} else {
edgtfInitAppendGalleryNewContent(thisHolderInner, loadingItem, responseHtml);
if (typeof edgtf.modules.common.edgtfStickySidebarWidget === 'function') {
edgtf.modules.common.edgtfStickySidebarWidget().reInit();
}
}
});
}
if (thisHolder.hasClass('edgtf-bl-pag-infinite-scroll-started')) {
thisHolder.removeClass('edgtf-bl-pag-infinite-scroll-started');
}
}
});
}
if (nextPage === maxNumPages) {
thisHolder.find('.edgtf-blog-pag-load-more').hide();
}
};
var edgtfInitStandardPaginationLinkChanges = function (thisHolder, maxNumPages, nextPage) {
var standardPagHolder = thisHolder.find('.edgtf-bl-standard-pagination'),
standardPagNumericItem = standardPagHolder.find('li.edgtf-bl-pag-number'),
standardPagPrevItem = standardPagHolder.find('li.edgtf-bl-pag-prev a'),
standardPagNextItem = standardPagHolder.find('li.edgtf-bl-pag-next a');
standardPagNumericItem.removeClass('edgtf-bl-pag-active');
standardPagNumericItem.eq(nextPage - 1).addClass('edgtf-bl-pag-active');
standardPagPrevItem.data('paged', nextPage - 1);
standardPagNextItem.data('paged', nextPage + 1);
if (nextPage > 1) {
standardPagPrevItem.css({'opacity': '1'});
} else {
standardPagPrevItem.css({'opacity': '0'});
}
if (nextPage === maxNumPages) {
standardPagNextItem.css({'opacity': '0'});
} else {
standardPagNextItem.css({'opacity': '1'});
}
};
var edgtfInitHtmlIsotopeNewContent = function (thisHolder, thisHolderInner, loadingItem, responseHtml) {
thisHolderInner.html(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'});
loadingItem.removeClass('edgtf-showing edgtf-standard-pag-trigger');
thisHolder.removeClass('edgtf-bl-pag-standard-shortcodes-animate');
setTimeout(function () {
thisHolderInner.isotope('layout');
if (typeof edgtf.modules.common.edgtfStickySidebarWidget === 'function') {
edgtf.modules.common.edgtfStickySidebarWidget().reInit();
}
}, 600);
};
var edgtfInitHtmlGalleryNewContent = function (thisHolder, thisHolderInner, loadingItem, responseHtml) {
loadingItem.removeClass('edgtf-showing edgtf-standard-pag-trigger');
thisHolder.removeClass('edgtf-bl-pag-standard-shortcodes-animate');
thisHolderInner.html(responseHtml);
};
var edgtfInitAppendIsotopeNewContent = function (thisHolderInner, loadingItem, responseHtml) {
thisHolderInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'});
loadingItem.removeClass('edgtf-showing');
setTimeout(function () {
thisHolderInner.isotope('layout');
if (typeof edgtf.modules.common.edgtfStickySidebarWidget === 'function') {
edgtf.modules.common.edgtfStickySidebarWidget().reInit();
}
}, 600);
};
var edgtfInitAppendGalleryNewContent = function (thisHolderInner, loadingItem, responseHtml) {
loadingItem.removeClass('edgtf-showing');
thisHolderInner.append(responseHtml);
};
return {
init: function () {
if (holder.length) {
holder.each(function () {
var thisHolder = $(this);
if (thisHolder.hasClass('edgtf-bl-pag-standard-shortcodes')) {
initStandardPagination(thisHolder);
}
if (thisHolder.hasClass('edgtf-bl-pag-load-more')) {
initLoadMorePagination(thisHolder);
}
if (thisHolder.hasClass('edgtf-bl-pag-infinite-scroll')) {
initInifiteScrollPagination(thisHolder);
}
});
}
},
scroll: function () {
if (holder.length) {
holder.each(function () {
var thisHolder = $(this);
if (thisHolder.hasClass('edgtf-bl-pag-infinite-scroll')) {
initInifiteScrollPagination(thisHolder);
}
});
}
}
};
}
})(jQuery);
(function ($) {
"use strict";
var headerMinimal = {};
edgtf.modules.headerMinimal = headerMinimal;
headerMinimal.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfFullscreenMenu();
}
/**
* Init Fullscreen Menu
*/
function edgtfFullscreenMenu() {
var popupMenuOpener = $('a.edgtf-fullscreen-menu-opener');
if (popupMenuOpener.length) {
var popupMenuHolderOuter = $(".edgtf-fullscreen-menu-holder-outer"),
cssClass,
//Flags for type of animation
fadeRight = false,
fadeTop = false,
//Widgets
widgetAboveNav = $('.edgtf-fullscreen-above-menu-widget-holder'),
widgetBelowNav = $('.edgtf-fullscreen-below-menu-widget-holder'),
//Menu
menuItems = $('.edgtf-fullscreen-menu-holder-outer nav > ul > li > a'),
menuItemWithChild = $('.edgtf-fullscreen-menu > ul li.has_sub > a'),
menuItemWithoutChild = $('.edgtf-fullscreen-menu ul li:not(.has_sub) a');
//set height of popup holder and initialize perfectScrollbar
popupMenuHolderOuter.perfectScrollbar({
wheelSpeed: 0.6,
suppressScrollX: true
});
//set height of popup holder on resize
$(window).resize(function () {
popupMenuHolderOuter.height(edgtf.windowHeight);
});
if (edgtf.body.hasClass('edgtf-fade-push-text-right')) {
cssClass = 'edgtf-push-nav-right';
fadeRight = true;
} else if (edgtf.body.hasClass('edgtf-fade-push-text-top')) {
cssClass = 'edgtf-push-text-top';
fadeTop = true;
}
//Appearing animation
if (fadeRight || fadeTop) {
if (widgetAboveNav.length) {
widgetAboveNav.children().css({
'-webkit-animation-delay': 0 + 'ms',
'-moz-animation-delay': 0 + 'ms',
'animation-delay': 0 + 'ms'
});
}
menuItems.each(function (i) {
$(this).css({
'-webkit-animation-delay': (i + 1) * 70 + 'ms',
'-moz-animation-delay': (i + 1) * 70 + 'ms',
'animation-delay': (i + 1) * 70 + 'ms'
});
});
if (widgetBelowNav.length) {
widgetBelowNav.children().css({
'-webkit-animation-delay': (menuItems.length + 1) * 70 + 'ms',
'-moz-animation-delay': (menuItems.length + 1) * 70 + 'ms',
'animation-delay': (menuItems.length + 1) * 70 + 'ms'
});
}
}
// Open popup menu
popupMenuOpener.on('click', function (e) {
e.preventDefault();
if (!popupMenuOpener.hasClass('edgtf-fm-opened')) {
popupMenuOpener.addClass('edgtf-fm-opened');
edgtf.body.removeClass('edgtf-fullscreen-fade-out').addClass('edgtf-fullscreen-menu-opened edgtf-fullscreen-fade-in');
edgtf.body.removeClass(cssClass);
edgtf.modules.common.edgtfDisableScroll();
$(document).keyup(function (e) {
if (e.keyCode === 27) {
popupMenuOpener.removeClass('edgtf-fm-opened');
edgtf.body.removeClass('edgtf-fullscreen-menu-opened edgtf-fullscreen-fade-in').addClass('edgtf-fullscreen-fade-out');
edgtf.body.addClass(cssClass);
edgtf.modules.common.edgtfEnableScroll();
$("nav.edgtf-fullscreen-menu ul.sub_menu").slideUp(200);
}
});
} else {
popupMenuOpener.removeClass('edgtf-fm-opened');
edgtf.body.removeClass('edgtf-fullscreen-menu-opened edgtf-fullscreen-fade-in').addClass('edgtf-fullscreen-fade-out');
edgtf.body.addClass(cssClass);
edgtf.modules.common.edgtfEnableScroll();
$("nav.edgtf-fullscreen-menu ul.sub_menu").slideUp(200);
}
});
//logic for open sub menus in popup menu
// menuItemWithChild.on('tap click', function (e) {
// e.preventDefault();
//
// var thisItem = $(this),
// thisItemParent = thisItem.parent(),
// thisItemParentSiblingsWithDrop = thisItemParent.siblings('.menu-item-has-children');
//
// if (thisItemParent.hasClass('has_sub')) {
// var submenu = thisItemParent.find('> ul.sub_menu');
//
// if (submenu.is(':visible')) {
// submenu.slideUp(450, 'easeInOutQuint');
// thisItemParent.removeClass('open_sub');
// } else {
// thisItemParent.addClass('open_sub');
//
// if (thisItemParentSiblingsWithDrop.length === 0) {
// submenu.slideDown(400, 'easeInOutQuint');
// } else {
// thisItemParent.closest('li.menu-item').siblings().find('.menu-item').removeClass('open_sub');
// thisItemParent.siblings().removeClass('open_sub').find('.sub_menu').slideUp(400, 'easeInOutQuint', function () {
// submenu.slideDown(400, 'easeInOutQuint');
// });
// }
// }
// }
//
// return false;
// });
menuItemWithChild.on('tap click', function(e) {
e.preventDefault();
var thisItem = $(this),
thisItemParent = thisItem.parent(),
thisItemParentSiblingsWithDrop = thisItemParent.siblings('.menu-item-has-children');
if (thisItemParent.hasClass('has_sub')) {
var submenu = thisItemParent.find('> ul.sub_menu');
if (submenu.is(':visible')) {
submenu.slideUp(450, 'easeInOutQuint');
thisItemParent.removeClass('open_sub');
} else {
thisItemParent.addClass('open_sub');
if(thisItemParentSiblingsWithDrop.length === 0) {
submenu.slideDown(400, 'easeInOutQuint');
} else {
thisItemParent.closest('li.menu-item').siblings().find('.menu-item').removeClass('open_sub');
thisItemParent.siblings().removeClass('open_sub').find('.sub_menu').slideUp(400, 'easeInOutQuint', function() {
submenu.slideDown(400, 'easeInOutQuint');
});
}
}
}
return false;
});
//if link has no submenu and if it's not dead, than open that link
menuItemWithoutChild.on('click', function (e) {
if (($(this).attr('href') !== "http://#") && ($(this).attr('href') !== "#")) {
if (e.which === 1) {
popupMenuOpener.removeClass('edgtf-fm-opened');
edgtf.body.removeClass('edgtf-fullscreen-menu-opened');
edgtf.body.removeClass('edgtf-fullscreen-fade-in').addClass('edgtf-fullscreen-fade-out');
edgtf.body.addClass(cssClass);
$("nav.edgtf-fullscreen-menu ul.sub_menu").slideUp(200);
edgtf.modules.common.edgtfEnableScroll();
}
} else {
return false;
}
});
}
}
})(jQuery);
(function ($) {
"use strict";
var mobileHeader = {};
edgtf.modules.mobileHeader = mobileHeader;
mobileHeader.edgtfOnDocumentReady = edgtfOnDocumentReady;
mobileHeader.edgtfOnWindowResize = edgtfOnWindowResize;
$(document).ready(edgtfOnDocumentReady);
$(window).resize(edgtfOnWindowResize);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitMobileNavigation();
edgtfInitMobileNavigationScroll();
edgtfMobileHeaderBehavior();
}
/*
All functions to be called on $(window).resize() should be in this function
*/
function edgtfOnWindowResize() {
edgtfInitMobileNavigationScroll();
}
function edgtfInitMobileNavigation() {
var navigationOpener = $('.edgtf-mobile-header .edgtf-mobile-menu-opener'),
navigationHolder = $('.edgtf-mobile-header .edgtf-mobile-nav'),
dropdownOpener = $('.edgtf-mobile-nav .mobile_arrow, .edgtf-mobile-nav h6, .edgtf-mobile-nav a.edgtf-mobile-no-link');
//whole mobile menu opening / closing
if (navigationOpener.length && navigationHolder.length) {
navigationOpener.on('tap click', function (e) {
e.stopPropagation();
e.preventDefault();
if (navigationHolder.is(':visible')) {
navigationHolder.slideUp(450, 'easeInOutQuint');
navigationOpener.removeClass('edgtf-mobile-menu-opened');
} else {
navigationHolder.slideDown(450, 'easeInOutQuint');
navigationOpener.addClass('edgtf-mobile-menu-opened');
}
});
}
//dropdown opening / closing
if (dropdownOpener.length) {
dropdownOpener.each(function () {
var thisItem = $(this);
thisItem.on('tap click', function (e) {
var thisItemParent = thisItem.parent('li'),
thisItemParentSiblingsWithDrop = thisItemParent.siblings('.menu-item-has-children');
if (thisItemParent.hasClass('has_sub')) {
var submenu = thisItemParent.find('> ul.sub_menu');
if (submenu.is(':visible')) {
submenu.slideUp(450, 'easeInOutQuint');
thisItemParent.removeClass('edgtf-opened');
} else {
thisItemParent.addClass('edgtf-opened');
if (thisItemParentSiblingsWithDrop.length === 0) {
thisItemParent.find('.sub_menu').slideUp(400, 'easeInOutQuint', function () {
submenu.slideDown(400, 'easeInOutQuint');
});
} else {
thisItemParent.siblings().removeClass('edgtf-opened').find('.sub_menu').slideUp(400, 'easeInOutQuint', function () {
submenu.slideDown(400, 'easeInOutQuint');
});
}
}
}
});
});
}
$('.edgtf-mobile-nav a, .edgtf-mobile-logo-wrapper a').on('click tap', function (e) {
if ($(this).attr('href') !== 'http://#' && $(this).attr('href') !== '#') {
navigationHolder.slideUp(450, 'easeInOutQuint');
navigationOpener.removeClass("edgtf-mobile-menu-opened");
}
});
}
function edgtfInitMobileNavigationScroll() {
if (edgtf.windowWidth <= 1024) {
var mobileHeader = $('.edgtf-mobile-header'),
mobileHeaderHeight = mobileHeader.length ? mobileHeader.height() : 0,
navigationHolder = mobileHeader.find('.edgtf-mobile-nav'),
navigationHeight = navigationHolder.outerHeight(),
windowHeight = edgtf.windowHeight - 100;
//init scrollable menu
var scrollHeight = mobileHeaderHeight + navigationHeight > windowHeight ? windowHeight - mobileHeaderHeight : navigationHeight;
navigationHolder.height(scrollHeight).perfectScrollbar({
wheelSpeed: 0.6,
suppressScrollX: true
});
}
}
function edgtfMobileHeaderBehavior() {
var mobileHeader = $('.edgtf-mobile-header'),
mobileMenuOpener = mobileHeader.find('.edgtf-mobile-menu-opener'),
mobileHeaderHeight = mobileHeader.length ? mobileHeader.outerHeight() : 0;
if (edgtf.body.hasClass('edgtf-content-is-behind-header') && mobileHeaderHeight > 0 && edgtf.windowWidth <= 1024) {
$('.edgtf-content').css('marginTop', -mobileHeaderHeight);
}
if (edgtf.body.hasClass('edgtf-sticky-up-mobile-header')) {
var stickyAppearAmount,
adminBar = $('#wpadminbar');
var docYScroll1 = $(document).scrollTop();
stickyAppearAmount = mobileHeaderHeight + edgtfGlobalVars.vars.edgtfAddForAdminBar;
$(window).scroll(function () {
var docYScroll2 = $(document).scrollTop();
if (docYScroll2 > stickyAppearAmount) {
mobileHeader.addClass('edgtf-animate-mobile-header');
} else {
mobileHeader.removeClass('edgtf-animate-mobile-header');
}
if ((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount && !mobileMenuOpener.hasClass('edgtf-mobile-menu-opened')) || (docYScroll2 < stickyAppearAmount)) {
mobileHeader.removeClass('mobile-header-appear');
mobileHeader.css('margin-bottom', 0);
if (adminBar.length) {
mobileHeader.find('.edgtf-mobile-header-inner').css('top', 0);
}
} else {
mobileHeader.addClass('mobile-header-appear');
mobileHeader.css('margin-bottom', stickyAppearAmount);
}
docYScroll1 = $(document).scrollTop();
});
}
}
})(jQuery);
(function ($) {
"use strict";
var headerVertical = {};
edgtf.modules.headerVertical = headerVertical;
headerVertical.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfVerticalMenu().init();
}
/**
* Function object that represents vertical menu area.
* @returns {{init: Function}}
*/
var edgtfVerticalMenu = function () {
var verticalMenuObject = $('.edgtf-vertical-menu-area');
/**
* Checks if vertical area is scrollable (if it has edgtf-with-scroll class)
*
* @returns {bool}
*/
var verticalAreaScrollable = function () {
return verticalMenuObject.hasClass('edgtf-with-scroll');
};
/**
* Initialzes navigation functionality. It checks navigation type data attribute and calls proper functions
*/
var initNavigation = function () {
var verticalNavObject = verticalMenuObject.find('.edgtf-vertical-menu');
if (verticalNavObject.hasClass('edgtf-vertical-dropdown-below')) {
dropdownClickToggle();
} else if (verticalNavObject.hasClass('edgtf-vertical-dropdown-side')) {
dropdownFloat();
}
/**
* Initializes click toggle navigation type. Works the same for touch and no-touch devices
*/
function dropdownClickToggle() {
var menuItems = verticalNavObject.find('ul li.menu-item-has-children');
menuItems.each(function () {
var elementToExpand = $(this).find(' > .second, > ul');
var menuItem = this;
var dropdownOpener = $(this).find('> a');
var slideUpSpeed = 'fast';
var slideDownSpeed = 'fast';
dropdownOpener.on('click tap', function (e) {
e.preventDefault();
e.stopPropagation();
if (elementToExpand.is(':visible')) {
$(menuItem).removeClass('open');
elementToExpand.slideUp(slideUpSpeed);
} else if (dropdownOpener.parent().parent().children().hasClass('open') && dropdownOpener.parent().parent().parent().hasClass('edgtf-vertical-menu')) {
$(this).parent().parent().children().removeClass('open');
$(this).parent().parent().children().find(' > .second').slideUp(slideUpSpeed);
$(menuItem).addClass('open');
elementToExpand.slideDown(slideDownSpeed);
} else {
if (!$(this).parents('li').hasClass('open')) {
menuItems.removeClass('open');
menuItems.find(' > .second, > ul').slideUp(slideUpSpeed);
}
if ($(this).parent().parent().children().hasClass('open')) {
$(this).parent().parent().children().removeClass('open');
$(this).parent().parent().children().find(' > .second, > ul').slideUp(slideUpSpeed);
}
$(menuItem).addClass('open');
elementToExpand.slideDown(slideDownSpeed);
}
});
});
}
/**
* Initializes click float navigation type
*/
function dropdownFloat() {
var menuItems = verticalNavObject.find('ul li.menu-item-has-children');
var allDropdowns = menuItems.find(' > .second > .inner > ul, > ul');
menuItems.each(function () {
var elementToExpand = $(this).find(' > .second > .inner > ul, > ul');
var menuItem = this;
if (Modernizr.touch) {
var dropdownOpener = $(this).find('> a');
dropdownOpener.on('click tap', function (e) {
e.preventDefault();
e.stopPropagation();
if (elementToExpand.hasClass('edgtf-float-open')) {
elementToExpand.removeClass('edgtf-float-open');
$(menuItem).removeClass('open');
} else {
if (!$(this).parents('li').hasClass('open')) {
menuItems.removeClass('open');
allDropdowns.removeClass('edgtf-float-open');
}
elementToExpand.addClass('edgtf-float-open');
$(menuItem).addClass('open');
}
});
} else {
//must use hoverIntent because basic hover effect doesn't catch dropdown
//it doesn't start from menu item's edge
$(this).hoverIntent({
over: function () {
elementToExpand.addClass('edgtf-float-open');
$(menuItem).addClass('open');
},
out: function () {
elementToExpand.removeClass('edgtf-float-open');
$(menuItem).removeClass('open');
},
timeout: 300
});
}
});
}
};
/**
* Initializes scrolling in vertical area. It checks if vertical area is scrollable before doing so
*/
var initVerticalAreaScroll = function () {
if (verticalAreaScrollable()) {
verticalMenuObject.perfectScrollbar({
wheelSpeed: 0.6,
suppressScrollX: true
});
}
};
return {
/**
* Calls all necessary functionality for vertical menu area if vertical area object is valid
*/
init: function () {
if (verticalMenuObject.length) {
initNavigation();
initVerticalAreaScroll();
}
}
};
};
})(jQuery);
(function ($) {
"use strict";
var stickyHeader = {};
edgtf.modules.stickyHeader = stickyHeader;
stickyHeader.isStickyVisible = false;
stickyHeader.stickyAppearAmount = 0;
stickyHeader.behaviour = '';
stickyHeader.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
if (edgtf.windowWidth > 1024) {
edgtfHeaderBehaviour();
}
}
/*
** Show/Hide sticky header on window scroll
*/
function edgtfHeaderBehaviour() {
var header = $('.edgtf-page-header'),
stickyHeader = $('.edgtf-sticky-header'),
fixedHeaderWrapper = $('.edgtf-fixed-wrapper'),
fixedMenuArea = fixedHeaderWrapper.children('.edgtf-menu-area'),
fixedMenuAreaHeight = fixedMenuArea.outerHeight(),
sliderHolder = $('.edgtf-slider'),
revSliderHeight = sliderHolder.length ? sliderHolder.outerHeight() : 0,
stickyAppearAmount,
headerAppear;
var headerMenuAreaOffset = fixedHeaderWrapper.length ? fixedHeaderWrapper.offset().top - edgtfGlobalVars.vars.edgtfAddForAdminBar : 0;
switch (true) {
// sticky header that will be shown when user scrolls up
case edgtf.body.hasClass('edgtf-sticky-header-on-scroll-up'):
edgtf.modules.stickyHeader.behaviour = 'edgtf-sticky-header-on-scroll-up';
var docYScroll1 = $(document).scrollTop();
stickyAppearAmount = parseInt(edgtfGlobalVars.vars.edgtfTopBarHeight) + parseInt(edgtfGlobalVars.vars.edgtfLogoAreaHeight) + parseInt(edgtfGlobalVars.vars.edgtfMenuAreaHeight) + parseInt(edgtfGlobalVars.vars.edgtfStickyHeaderHeight);
headerAppear = function () {
var docYScroll2 = $(document).scrollTop();
if ((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount) || (docYScroll2 < stickyAppearAmount)) {
edgtf.modules.stickyHeader.isStickyVisible = false;
stickyHeader.removeClass('header-appear').find('.edgtf-main-menu .second').removeClass('edgtf-drop-down-start');
edgtf.body.removeClass('edgtf-sticky-header-appear');
} else {
edgtf.modules.stickyHeader.isStickyVisible = true;
stickyHeader.addClass('header-appear');
edgtf.body.addClass('edgtf-sticky-header-appear');
}
docYScroll1 = $(document).scrollTop();
};
headerAppear();
$(window).scroll(function () {
headerAppear();
});
break;
// sticky header that will be shown when user scrolls both up and down
case edgtf.body.hasClass('edgtf-sticky-header-on-scroll-down-up'):
edgtf.modules.stickyHeader.behaviour = 'edgtf-sticky-header-on-scroll-down-up';
if (edgtfPerPageVars.vars.edgtfStickyScrollAmount !== 0) {
edgtf.modules.stickyHeader.stickyAppearAmount = parseInt(edgtfPerPageVars.vars.edgtfStickyScrollAmount);
} else {
edgtf.modules.stickyHeader.stickyAppearAmount = parseInt(edgtfGlobalVars.vars.edgtfTopBarHeight) + parseInt(edgtfGlobalVars.vars.edgtfLogoAreaHeight) + parseInt(edgtfGlobalVars.vars.edgtfMenuAreaHeight) + parseInt(revSliderHeight);
}
headerAppear = function () {
if (edgtf.scroll < edgtf.modules.stickyHeader.stickyAppearAmount) {
edgtf.modules.stickyHeader.isStickyVisible = false;
stickyHeader.removeClass('header-appear').find('.edgtf-main-menu .second').removeClass('edgtf-drop-down-start');
edgtf.body.removeClass('edgtf-sticky-header-appear');
} else {
edgtf.modules.stickyHeader.isStickyVisible = true;
stickyHeader.addClass('header-appear');
edgtf.body.addClass('edgtf-sticky-header-appear');
}
};
headerAppear();
$(window).scroll(function () {
headerAppear();
});
break;
// on scroll down, part of header will be sticky
case edgtf.body.hasClass('edgtf-fixed-on-scroll'):
edgtf.modules.stickyHeader.behaviour = 'edgtf-fixed-on-scroll';
var headerFixed = function () {
if (edgtf.scroll <= headerMenuAreaOffset) {
fixedHeaderWrapper.removeClass('fixed');
edgtf.body.removeClass('edgtf-fixed-header-appear');
header.css('margin-bottom', '0');
} else {
fixedHeaderWrapper.addClass('fixed');
edgtf.body.addClass('edgtf-fixed-header-appear');
header.css('margin-bottom', fixedMenuAreaHeight + 'px');
}
};
headerFixed();
$(window).scroll(function () {
headerFixed();
});
break;
}
}
})(jQuery);
(function ($) {
"use strict";
var searchCoversHeader = {};
edgtf.modules.searchCoversHeader = searchCoversHeader;
searchCoversHeader.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfSearchCoversHeader();
}
/**
* Init Search Types
*/
function edgtfSearchCoversHeader() {
if (edgtf.body.hasClass('edgtf-search-covers-header')) {
var searchOpener = $('a.edgtf-search-opener');
if (searchOpener.length > 0) {
searchOpener.each(function () {
var thisOpener = $(this);
thisOpener.on('click', function (e) {
e.preventDefault();
var thisSearchOpener = $(this),
searchFormHeight,
searchFormHeaderHolder = $('.edgtf-page-header'),
searchFormTopHeaderHolder = $('.edgtf-top-bar'),
searchFormFixedHeaderHolder = searchFormHeaderHolder.find('.edgtf-fixed-wrapper.fixed'),
searchFormMobileHeaderHolder = $('.edgtf-mobile-header'),
searchForm = $('.edgtf-search-cover'),
searchFormIsInTopHeader = !!thisSearchOpener.parents('.edgtf-top-bar').length,
searchFormIsInFixedHeader = !!thisSearchOpener.parents('.edgtf-fixed-wrapper.fixed').length,
searchFormIsInStickyHeader = !!thisSearchOpener.parents('.edgtf-sticky-header').length,
searchFormIsInMobileHeader = !!thisSearchOpener.parents('.edgtf-mobile-header').length;
searchForm.removeClass('edgtf-is-active');
//Find search form position in header and height
if (searchFormIsInTopHeader) {
searchFormHeight = edgtfGlobalVars.vars.edgtfTopBarHeight;
searchFormTopHeaderHolder.find('.edgtf-search-cover').addClass('edgtf-is-active');
} else if (searchFormIsInFixedHeader) {
searchFormHeight = searchFormFixedHeaderHolder.outerHeight();
searchFormHeaderHolder.children('.edgtf-search-cover').addClass('edgtf-is-active');
} else if (searchFormIsInStickyHeader) {
searchFormHeight = searchFormHeaderHolder.find('.edgtf-sticky-header').outerHeight();
searchFormHeaderHolder.children('.edgtf-search-cover').addClass('edgtf-is-active');
} else if (searchFormIsInMobileHeader) {
if (searchFormMobileHeaderHolder.hasClass('mobile-header-appear')) {
searchFormHeight = searchFormMobileHeaderHolder.children('.edgtf-mobile-header-inner').outerHeight();
} else {
searchFormHeight = searchFormMobileHeaderHolder.outerHeight();
}
searchFormMobileHeaderHolder.find('.edgtf-search-cover').addClass('edgtf-is-active');
} else {
searchFormHeight = searchFormHeaderHolder.outerHeight();
searchFormHeaderHolder.children('.edgtf-search-cover').addClass('edgtf-is-active');
}
if (searchForm.hasClass('edgtf-is-active')) {
searchForm.height(searchFormHeight).stop(true).fadeIn(600).find('input[type="text"]').focus();
}
searchForm.find('.edgtf-search-close').on('click', function (e) {
e.preventDefault();
searchForm.stop(true).fadeOut(450);
});
searchForm.blur(function () {
searchForm.stop(true).fadeOut(450);
});
$(window).scroll(function () {
searchForm.stop(true).fadeOut(450);
});
});
});
}
}
}
})(jQuery);
(function ($) {
'use strict';
var portfolio = {};
edgtf.modules.portfolio = portfolio;
portfolio.edgtfOnDocumentReady = edgtfOnDocumentReady;
portfolio.edgtfOnWindowLoad = edgtfOnWindowLoad;
portfolio.edgtfOnWindowResize = edgtfOnWindowResize;
$(document).ready(edgtfOnDocumentReady);
$(window).on('load', edgtfOnWindowLoad);
$(window).resize(edgtfOnWindowResize);
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
edgtfPortfolioSingleFollow().init();
edgtfInitPortfolioFollowsInfo();
edgtfInitPortfolioFullheightSlider();
}
function edgtfOnDocumentReady() {
edgtfPortfolioFullScreenSlider().init();
}
function edgtfOnWindowResize() {
edgtfInitPortfolioFullheightSlider();
}
var edgtfPortfolioSingleFollow = function () {
var info = $('.edgtf-follow-portfolio-info .edgtf-portfolio-single-holder .edgtf-ps-info-sticky-holder');
if (info.length) {
var infoHolder = info.parent(),
infoHolderOffset = infoHolder.offset().top,
infoHolderHeight = infoHolder.height(),
mediaHolder = $('.edgtf-ps-image-holder'),
mediaHolderHeight = mediaHolder.height(),
header = $('.header-appear, .edgtf-fixed-wrapper'),
headerHeight = (header.length) ? header.height() : 0,
constant = 30; //30 to prevent mispositioned
}
var infoHolderPosition = function () {
if (info.length && mediaHolderHeight >= infoHolderHeight) {
if (edgtf.scroll >= infoHolderOffset - headerHeight - edgtfGlobalVars.vars.edgtfAddForAdminBar - constant) {
var marginTop = edgtf.scroll - infoHolderOffset + edgtfGlobalVars.vars.edgtfAddForAdminBar + headerHeight + constant;
// if scroll is initially positioned below mediaHolderHeight
if (marginTop + infoHolderHeight > mediaHolderHeight) {
marginTop = mediaHolderHeight - infoHolderHeight + constant;
}
info.stop().animate({
marginTop: marginTop
});
}
}
};
var recalculateInfoHolderPosition = function () {
if (info.length && mediaHolderHeight >= infoHolderHeight) {
//Calculate header height if header appears
if (edgtf.scroll > 0 && header.length) {
headerHeight = header.height();
}
var headerMixin = headerHeight + edgtfGlobalVars.vars.edgtfAddForAdminBar + constant;
if (edgtf.scroll >= infoHolderOffset - headerMixin) {
if (edgtf.scroll + infoHolderHeight + headerMixin + 2 * constant < infoHolderOffset + mediaHolderHeight) {
info.stop().animate({
marginTop: (edgtf.scroll - infoHolderOffset + headerMixin + 2 * constant)
});
//Reset header height
headerHeight = 0;
} else {
info.stop().animate({
marginTop: mediaHolderHeight - infoHolderHeight
});
}
} else {
info.stop().animate({
marginTop: 0
});
}
}
};
return {
init: function () {
infoHolderPosition();
$(window).scroll(function () {
recalculateInfoHolderPosition();
});
}
};
};
/**
* Init Full Screen Slider
*/
var edgtfPortfolioFullScreenSlider = function () {
var sliderHolder = $('.edgtf-fullscreen-slider-holder');
var content = $('.edgtf-wrapper .edgtf-content');
var sliders = $('.edgtf-portfolio-fullscreen-slider');
var fullScreenSliderHolder = $('.fullscreen-slider');
var edgtfFullScreenSliderHeight = function () {
if (sliderHolder.length) {
var contentMargin = parseInt(content.css('margin-top')),
imageHolder = sliderHolder.find('.edgtf-portfolio-single-media'),
title = $('.edgtf-title'),
paspartuHeight = 0,
sliderHeight = edgtf.windowHeight;
if (edgtf.body.hasClass('edgtf-passepartout')) {
var paspartu = $('.edgtf-passepartout-top');
paspartuHeight = paspartu.outerHeight() * 2;
sliderHeight -= paspartuHeight;
}
if (title.length) {
sliderHeight -= title.height();
}
if (edgtf.windowWidth > 1024) {
if (contentMargin >= 0) {
sliderHeight -= edgtfGlobalVars.vars.edgtfMenuAreaHeight;
}
}
else {
sliderHeight -= edgtfGlobalVars.vars.edgtfMobileHeaderHeight;
}
fullScreenSliderHolder.css("height", sliderHeight);
sliderHolder.css("height", sliderHeight);
imageHolder.css("height", sliderHeight);
}
};
var edgtfFullScreenSlider = function () {
if (sliderHolder.length) {
sliders.each(function () {
var slider = $(this);
slider.on('init', function (slick) {
var activeSlide = slider.find('.slick-active.edgtf-portfolio-single-media');
if (activeSlide.hasClass('edgtf-slide-dark-skin')) {
slider.removeClass('edgtf-slide-light-skin').addClass('edgtf-slide-dark-skin');
edgtf.body.removeClass('edgtf-light-header').addClass('edgtf-dark-header');
} else {
slider.removeClass('edgtf-slide-dark-skin').addClass('edgtf-slide-light-skin');
edgtf.body.removeClass('edgtf-dark-header').addClass('edgtf-light-header');
}
});
slider.on('afterChange', function (slick, currentSlide) {
var activeSlide = slider.find('.slick-active.edgtf-portfolio-single-media');
if (activeSlide.hasClass('edgtf-slide-dark-skin')) {
slider.removeClass('edgtf-slide-light-skin').addClass('edgtf-slide-dark-skin');
edgtf.body.removeClass('edgtf-light-header').addClass('edgtf-dark-header');
} else {
slider.removeClass('edgtf-slide-dark-skin').addClass('edgtf-slide-light-skin');
edgtf.body.removeClass('edgtf-dark-header').addClass('edgtf-light-header');
}
});
slider.slick({
vertical: true,
verticalSwiping: true,
infinite: true,
slidesToShow: 1,
arrows: false,
dots: true,
easing: 'easeOutQuart',
dotsClass: 'edgtf-slick-dots',
customPaging: function (slider, i) {
return '<span class="edgtf-slick-dot-inner"></span>';
}
}).animate({'opacity': 1}, 600);
// slick wheel
slider.on('mousewheel', function (event) {
event.preventDefault();
if (event.deltaX > 0 || event.deltaY < 0) {
$(this).slick('slickNext');
} else if (event.deltaX < 0 || event.deltaY > 0) {
$(this).slick('slickPrev');
}
});
// slick wheel
});
}
};
var edgtfFullScreenSliderInfo = function () {
if (sliderHolder.length) {
var sliderContent = $('.edgtf-portfolio-slider-content');
var close = $('.edgtf-control.edgtf-close');
var description = $('.edgtf-description');
var info = $('.edgtf-portfolio-slider-content-info');
sliderContent.on('click', function (e) {
e.preventDefault();
if (!sliderContent.hasClass('opened')) {
description.fadeOut(400, function () {
sliderContent.addClass('opened');
setTimeout(function () {
info.fadeIn(400);
}, 400);
});
}
});
close.on('click', function (e) {
e.preventDefault();
e.stopPropagation();
info.fadeOut(400, function () {
sliderContent.removeClass('opened');
setTimeout(function () {
description.fadeIn(400);
}, 400);
});
});
}
};
return {
init: function () {
edgtfFullScreenSliderHeight();
edgtfFullScreenSlider();
edgtfFullScreenSliderInfo();
$(window).resize(function () {
edgtfFullScreenSliderHeight();
});
}
};
};
/**
* Initializes portfolio list follow info hover
*/
function edgtfInitPortfolioFollowsInfo() {
var portList = $('.edgtf-portfolio-list-holder.edgtf-pl-gallery-info-follow-cursor .edgtf-pl-inner, .edgtf-portfolio-list-holder.edgtf-pl-fullheight-gallery .edgtf-pl-inner');
if (portList.length) {
edgtf.body.append('<div class="edgtf-pl-follow-info-holder">\
<span class="edgtf-pl-follow-info-title-holder"></span>\
<span class="edgtf-pl-follow-info-category-holder"></span>\
</div>');
var followInfoHolder = $('.edgtf-pl-follow-info-holder'),
followInfoCategory = followInfoHolder.find('.edgtf-pl-follow-info-category-holder'),
followInfoTitle = followInfoHolder.find('.edgtf-pl-follow-info-title-holder');
portList.each(function () {
var thisPortList = $(this);
//info element position
thisPortList.on('mousemove', function (e) {
followInfoHolder.css({
top: e.clientY,
left: e.clientX
});
});
//show/hide info element
thisPortList.find('.edgtf-pl-item').on('mouseenter', function () {
var thisArticleItem = $(this),
thisArticleItemTitle = thisArticleItem.find('.edgtf-pli-title-holder'),
thisArticleItemCategory = thisArticleItem.find('.edgtf-pli-category-holder'),
modifiedCategoryText = '';
if (thisArticleItemTitle.length) {
followInfoTitle.html(thisArticleItemTitle.html());
}
if (thisArticleItemCategory.length) {
followInfoCategory.html(thisArticleItemCategory.html());
}
if (!followInfoHolder.hasClass('edgtf-is-active')) {
followInfoHolder.addClass('edgtf-is-active');
}
}).on('mouseleave', function () {
if (followInfoHolder.hasClass('edgtf-is-active')) {
followInfoHolder.removeClass('edgtf-is-active');
}
});
//check if info element is below or above the targeted portfolio list
$(window).scroll(function () {
if (followInfoHolder.hasClass('edgtf-is-active')) {
if (followInfoHolder.offset().top < thisPortList.offset().top || followInfoHolder.offset().top > thisPortList.offset().top + thisPortList.outerHeight()) {
followInfoHolder.removeClass('edgtf-is-active');
}
}
});
});
}
}
/**
* Initializes portfolio fullheight slider
*/
function edgtfInitPortfolioFullheightSlider() {
var holder = $('.edgtf-portfolio-slider-holder .edgtf-pl-fullheight-gallery');
if (holder.length && edgtf.windowWidth > 768) {
holder.each(function () {
var thisHolder = $(this),
owlStage = thisHolder.find('.owl-stage'),
// article = thisHolder.find('article'),
oldHeight = owlStage.height(),
newHeight = edgtf.windowHeight - edgtf.body.height() + oldHeight;
owlStage.css('height', newHeight);
});
}
}
})(jQuery);
(function ($) {
'use strict';
var accordions = {};
edgtf.modules.accordions = accordions;
accordions.edgtfInitAccordions = edgtfInitAccordions;
accordions.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitAccordions();
}
/**
* Init accordions shortcode
*/
function edgtfInitAccordions() {
var accordion = $('.edgtf-accordion-holder');
if (accordion.length) {
accordion.each(function () {
var thisAccordion = $(this);
if (thisAccordion.hasClass('edgtf-accordion')) {
thisAccordion.accordion({
animate: "swing",
collapsible: true,
active: 0,
icons: "",
heightStyle: "content"
});
}
if (thisAccordion.hasClass('edgtf-toggle')) {
var toggleAccordion = $(this),
toggleAccordionTitle = toggleAccordion.find('.edgtf-accordion-title'),
toggleAccordionContent = toggleAccordionTitle.next();
toggleAccordion.addClass("accordion ui-accordion ui-accordion-icons ui-widget ui-helper-reset");
toggleAccordionTitle.addClass("ui-accordion-header ui-state-default ui-corner-top ui-corner-bottom");
toggleAccordionContent.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide();
toggleAccordionTitle.each(function () {
var thisTitle = $(this);
thisTitle.on('mouseenter mouseleave', function () {
thisTitle.toggleClass("ui-state-hover");
});
thisTitle.on('click', function () {
thisTitle.toggleClass('ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom');
thisTitle.next().toggleClass('ui-accordion-content-active').slideToggle(400);
});
});
}
});
}
}
})(jQuery);
(function ($) {
'use strict';
var animationHolder = {};
edgtf.modules.animationHolder = animationHolder;
animationHolder.edgtfInitAnimationHolder = edgtfInitAnimationHolder;
animationHolder.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitAnimationHolder();
}
/*
* Init animation holder shortcode
*/
function edgtfInitAnimationHolder() {
var elements = $('.edgtf-grow-in, .edgtf-fade-in-down, .edgtf-element-from-fade, .edgtf-element-from-left, .edgtf-element-from-right, .edgtf-element-from-top, .edgtf-element-from-bottom, .edgtf-flip-in, .edgtf-x-rotate, .edgtf-z-rotate, .edgtf-y-translate, .edgtf-fade-in, .edgtf-fade-in-left-x-rotate'),
animationClass,
animationData,
animationDelay;
if (elements.length) {
elements.each(function () {
var thisElement = $(this);
thisElement.appear(function () {
animationData = thisElement.data('animation');
animationDelay = parseInt(thisElement.data('animation-delay'));
if (typeof animationData !== 'undefined' && animationData !== '') {
animationClass = animationData;
var newClass = animationClass + '-on';
setTimeout(function () {
thisElement.addClass(newClass);
}, animationDelay);
}
}, {accX: 0, accY: edgtfGlobalVars.vars.edgtfElementAppearAmount});
});
}
}
})(jQuery);
(function ($) {
'use strict';
var button = {};
edgtf.modules.button = button;
button.edgtfButton = edgtfButton;
button.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfButton().init();
}
/**
* Button object that initializes whole button functionality
* @type {Function}
*/
var edgtfButton = function () {
//all buttons on the page
var buttons = $('.edgtf-btn');
/**
* Initializes button hover color
* @param button current button
*/
var buttonHoverColor = function (button) {
if (typeof button.data('hover-color') !== 'undefined') {
var changeButtonColor = function (event) {
event.data.button.css('color', event.data.color);
};
var originalColor = button.css('color');
var hoverColor = button.data('hover-color');
button.on('mouseenter', {button: button, color: hoverColor}, changeButtonColor);
button.on('mouseleave', {button: button, color: originalColor}, changeButtonColor);
}
};
/**
* Initializes button hover background color
* @param button current button
*/
var buttonHoverBgColor = function (button) {
if (typeof button.data('hover-bg-color') !== 'undefined') {
var changeButtonBg = function (event) {
event.data.button.css('background-color', event.data.color);
};
var originalBgColor = button.css('background-color');
var hoverBgColor = button.data('hover-bg-color');
button.on('mouseenter', {button: button, color: hoverBgColor}, changeButtonBg);
button.on('mouseleave', {button: button, color: originalBgColor}, changeButtonBg);
}
};
/**
* Initializes button border color
* @param button
*/
var buttonHoverBorderColor = function (button) {
if (typeof button.data('hover-border-color') !== 'undefined') {
var changeBorderColor = function (event) {
event.data.button.css('border-color', event.data.color);
};
var originalBorderColor = button.css('borderTopColor'); //take one of the four sides
var hoverBorderColor = button.data('hover-border-color');
button.on('mouseenter', {button: button, color: hoverBorderColor}, changeBorderColor);
button.on('mouseleave', {button: button, color: originalBorderColor}, changeBorderColor);
}
};
return {
init: function () {
if (buttons.length) {
buttons.each(function () {
buttonHoverColor($(this));
buttonHoverBgColor($(this));
buttonHoverBorderColor($(this));
});
}
}
};
};
})(jQuery);
(function ($) {
'use strict';
var borderedCarousel = {};
edgtf.modules.borderedCarousel = borderedCarousel;
borderedCarousel.edgtfBorderedCarousel = edgtfBorderedCarousel;
borderedCarousel.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfBorderedCarousel();
}
/**
* Init bordered carousel shortcode
*/
function edgtfBorderedCarousel() {
var carousels = $('.edgtf-bordered-carousel');
if (carousels.length) {
carousels.each(function () {
var carousel = $(this),
swiperInstance = carousel.find('.swiper-container'),
fullscreen = carousel.hasClass('edgtf-bc-fullscreen') ? true : false,
wheelChange = carousel.hasClass('edgtf-bc-slide-on-scroll') ? true : false,
transitionSpeed = 1200;
var fullscreenCalcs = function () {
if (fullscreen) {
var heightVal = edgtf.windowHeight - carousel.offset().top;
if (edgtf.body.hasClass('edgtf-paspartu-enabled')) {
var passepartoutSize = parseInt($('.edgtf-wrapper').css('padding-top'));
heightVal -= passepartoutSize;
}
carousel.css('height', heightVal);
}
};
var dragTrigger = function () {
var xPosStart = 0,
xPos;
$(document).on('touchstart', carousel, function (e) {
xPosStart = e.originalEvent.touches[0].pageX;
}).on('touchmove', carousel, function (e) {
xPos = e.originalEvent.touches[0].pageX;
if (xPos > xPosStart) {
swiperSlider.slideNext(transitionSpeed);
} else {
swiperSlider.slidePrev(transitionSpeed);
}
}).on('touchend', carousel, function () {
xPosStart = 0;
xPos = 0;
});
};
var clickTrigger = function () {
var togglePrev = carousel.find('.edgtf-slide-toggle-prev'),
toggleNext = carousel.find('.edgtf-slide-toggle-next');
togglePrev.on('click', function (e) {
e.preventDefault();
swiperSlider.slidePrev(transitionSpeed);
return false;
});
toggleNext.on('click', function (e) {
e.preventDefault();
swiperSlider.slideNext(transitionSpeed);
return false;
});
};
var swiperSlider = new Swiper(swiperInstance, {
autoplay: {
delay: 3500,
},
loop: true,
centeredSlides: true,
slidesPerView: 'auto',
speed: transitionSpeed,
mousewheel: wheelChange,
parallax: true,
init: false,
pagination: {
el: '.swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
return '<span class="' + className + '">0' + (index + 1) + '</span>';
},
},
});
swiperSlider.on('init', function () {
fullscreenCalcs();
dragTrigger();
clickTrigger();
});
$(window).on('load', function () {
carousel.addClass('edgtf-initialized');
swiperSlider.init();
});
$(window).resize(function () {
setTimeout(function () {
fullscreenCalcs();
}, 200);
});
});
}
}
})(jQuery);
(function ($) {
'use strict';
var countdown = {};
edgtf.modules.countdown = countdown;
countdown.edgtfInitCountdown = edgtfInitCountdown;
countdown.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitCountdown();
}
/**
* Countdown Shortcode
*/
function edgtfInitCountdown() {
var countdowns = $('.edgtf-countdown'),
date = new Date(),
currentMonth = date.getMonth(),
currentYear = date.getFullYear(),
year,
month,
day,
hour,
minute,
timezone,
monthLabel,
dayLabel,
hourLabel,
minuteLabel,
secondLabel;
if (countdowns.length) {
countdowns.each(function () {
//Find countdown elements by id-s
var countdownId = $(this).attr('id'),
countdown = $('#' + countdownId),
digitFontSize,
labelFontSize;
//Get data for countdown
year = countdown.data('year');
month = countdown.data('month');
day = countdown.data('day');
hour = countdown.data('hour');
minute = countdown.data('minute');
timezone = countdown.data('timezone');
monthLabel = countdown.data('month-label');
dayLabel = countdown.data('day-label');
hourLabel = countdown.data('hour-label');
minuteLabel = countdown.data('minute-label');
secondLabel = countdown.data('second-label');
digitFontSize = countdown.data('digit-size');
labelFontSize = countdown.data('label-size');
if (currentMonth !== month || currentYear !== year) {
month = month - 1;
}
//Initialize countdown
countdown.countdown({
until: new Date(year, month, day, hour, minute, 44),
labels: ['', monthLabel, '', dayLabel, hourLabel, minuteLabel, secondLabel],
format: 'ODHMS',
timezone: timezone,
padZeroes: true,
onTick: setCountdownStyle
});
function setCountdownStyle() {
countdown.find('.countdown-amount').css({
'font-size': digitFontSize + 'px',
'line-height': digitFontSize + 'px'
});
countdown.find('.countdown-period').css({
'font-size': labelFontSize + 'px'
});
}
});
}
}
})(jQuery);
(function ($) {
'use strict';
var counter = {};
edgtf.modules.counter = counter;
counter.edgtfInitCounter = edgtfInitCounter;
counter.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitCounter();
}
/**
* Counter Shortcode
*/
function edgtfInitCounter() {
var counterHolder = $('.edgtf-counter-holder');
if (counterHolder.length) {
counterHolder.each(function () {
var thisCounterHolder = $(this),
thisCounter = thisCounterHolder.find('.edgtf-counter');
thisCounterHolder.appear(function () {
thisCounterHolder.css('opacity', '1');
//Counter zero type
if (thisCounter.hasClass('edgtf-zero-counter')) {
var max = parseFloat(thisCounter.text());
thisCounter.countTo({
from: 0,
to: max,
speed: 1500,
refreshInterval: 100
});
} else {
thisCounter.absoluteCounter({
speed: 2000,
fadeInDelay: 1000
});
}
}, {accX: 0, accY: edgtfGlobalVars.vars.edgtfElementAppearAmount});
});
}
}
})(jQuery);
(function ($) {
'use strict';
var customFont = {};
edgtf.modules.customFont = customFont;
customFont.edgtfCustomFontResize = edgtfCustomFontResize;
customFont.edgtfCustomFontTypeOut = edgtfCustomFontTypeOut;
customFont.edgtfOnDocumentReady = edgtfOnDocumentReady;
customFont.edgtfOnWindowLoad = edgtfOnWindowLoad;
$(document).ready(edgtfOnDocumentReady);
$(window).on('load', edgtfOnWindowLoad);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfCustomFontResize();
}
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
edgtfCustomFontTypeOut();
}
/*
** Custom Font resizing style
*/
function edgtfCustomFontResize() {
var holder = $('.edgtf-custom-font-holder');
if (holder.length) {
holder.each(function () {
var thisItem = $(this),
itemClass = '',
smallLaptopStyle = '',
ipadLandscapeStyle = '',
ipadPortraitStyle = '',
mobileLandscapeStyle = '',
style = '',
responsiveStyle = '';
if (typeof thisItem.data('item-class') !== 'undefined' && thisItem.data('item-class') !== false) {
itemClass = thisItem.data('item-class');
}
if (typeof thisItem.data('font-size-1366') !== 'undefined' && thisItem.data('font-size-1366') !== false) {
smallLaptopStyle += 'font-size: ' + thisItem.data('font-size-1366') + ' !important;';
}
if (typeof thisItem.data('font-size-1024') !== 'undefined' && thisItem.data('font-size-1024') !== false) {
ipadLandscapeStyle += 'font-size: ' + thisItem.data('font-size-1024') + ' !important;';
}
if (typeof thisItem.data('font-size-768') !== 'undefined' && thisItem.data('font-size-768') !== false) {
ipadPortraitStyle += 'font-size: ' + thisItem.data('font-size-768') + ' !important;';
}
if (typeof thisItem.data('font-size-680') !== 'undefined' && thisItem.data('font-size-680') !== false) {
mobileLandscapeStyle += 'font-size: ' + thisItem.data('font-size-680') + ' !important;';
}
if (typeof thisItem.data('line-height-1366') !== 'undefined' && thisItem.data('line-height-1366') !== false) {
smallLaptopStyle += 'line-height: ' + thisItem.data('line-height-1366') + ' !important;';
}
if (typeof thisItem.data('line-height-1024') !== 'undefined' && thisItem.data('line-height-1024') !== false) {
ipadLandscapeStyle += 'line-height: ' + thisItem.data('line-height-1024') + ' !important;';
}
if (typeof thisItem.data('line-height-768') !== 'undefined' && thisItem.data('line-height-768') !== false) {
ipadPortraitStyle += 'line-height: ' + thisItem.data('line-height-768') + ' !important;';
}
if (typeof thisItem.data('line-height-680') !== 'undefined' && thisItem.data('line-height-680') !== false) {
mobileLandscapeStyle += 'line-height: ' + thisItem.data('line-height-680') + ' !important;';
}
if (smallLaptopStyle.length || ipadLandscapeStyle.length || ipadPortraitStyle.length || mobileLandscapeStyle.length) {
if (smallLaptopStyle.length) {
responsiveStyle += "@media only screen and (max-width: 1366px) {.edgtf-custom-font-holder." + itemClass + " { " + smallLaptopStyle + " } }";
}
if (ipadLandscapeStyle.length) {
responsiveStyle += "@media only screen and (max-width: 1024px) {.edgtf-custom-font-holder." + itemClass + " { " + ipadLandscapeStyle + " } }";
}
if (ipadPortraitStyle.length) {
responsiveStyle += "@media only screen and (max-width: 768px) {.edgtf-custom-font-holder." + itemClass + " { " + ipadPortraitStyle + " } }";
}
if (mobileLandscapeStyle.length) {
responsiveStyle += "@media only screen and (max-width: 680px) {.edgtf-custom-font-holder." + itemClass + " { " + mobileLandscapeStyle + " } }";
}
}
if (responsiveStyle.length) {
style = '<style type="text/css">' + responsiveStyle + '</style>';
}
if (style.length) {
$('head').append(style);
}
});
}
}
/*
* Init Type out functionality for Custom Font shortcode
*/
function edgtfCustomFontTypeOut() {
var edgtfTyped = $('.edgtf-cf-typed');
if (edgtfTyped.length) {
edgtfTyped.each(function () {
//vars
var thisTyped = $(this),
typedWrap = thisTyped.parent('.edgtf-cf-typed-wrap'),
customFontHolder = typedWrap.parent('.edgtf-custom-font-holder'),
str = [],
string_1 = thisTyped.find('.edgtf-cf-typed-1').text(),
string_2 = thisTyped.find('.edgtf-cf-typed-2').text(),
string_3 = thisTyped.find('.edgtf-cf-typed-3').text(),
string_4 = thisTyped.find('.edgtf-cf-typed-4').text();
if (string_1.length) {
str.push(string_1);
}
if (string_2.length) {
str.push(string_2);
}
if (string_3.length) {
str.push(string_3);
}
if (string_4.length) {
str.push(string_4);
}
customFontHolder.appear(function () {
thisTyped.typed({
strings: str,
typeSpeed: 90,
backDelay: 700,
loop: true,
contentType: 'text',
loopCount: false,
cursorChar: '_'
});
}, {accX: 0, accY: edgtfGlobalVars.vars.edgtfElementAppearAmount});
});
}
}
})(jQuery);
(function ($) {
'use strict';
var elementsHolder = {};
edgtf.modules.elementsHolder = elementsHolder;
elementsHolder.edgtfInitElementsHolderResponsiveStyle = edgtfInitElementsHolderResponsiveStyle;
elementsHolder.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitElementsHolderResponsiveStyle();
}
/*
** Elements Holder responsive style
*/
function edgtfInitElementsHolderResponsiveStyle() {
var elementsHolder = $('.edgtf-elements-holder');
if (elementsHolder.length) {
elementsHolder.each(function () {
var thisElementsHolder = $(this),
elementsHolderItem = thisElementsHolder.children('.edgtf-eh-item'),
style = '',
responsiveStyle = '';
elementsHolderItem.each(function () {
var thisItem = $(this),
itemClass = '',
largeLaptop = '',
smallLaptop = '',
ipadLandscape = '',
ipadPortrait = '',
mobileLandscape = '',
mobilePortrait = '';
if (typeof thisItem.data('item-class') !== 'undefined' && thisItem.data('item-class') !== false) {
itemClass = thisItem.data('item-class');
}
if (typeof thisItem.data('1367-1600') !== 'undefined' && thisItem.data('1367-1600') !== false) {
largeLaptop = thisItem.data('1367-1600');
}
if (typeof thisItem.data('1025-1366') !== 'undefined' && thisItem.data('1025-1366') !== false) {
smallLaptop = thisItem.data('1025-1366');
}
if (typeof thisItem.data('769-1024') !== 'undefined' && thisItem.data('769-1024') !== false) {
ipadLandscape = thisItem.data('769-1024');
}
if (typeof thisItem.data('681-768') !== 'undefined' && thisItem.data('681-768') !== false) {
ipadPortrait = thisItem.data('681-768');
}
if (typeof thisItem.data('680') !== 'undefined' && thisItem.data('680') !== false) {
mobileLandscape = thisItem.data('680');
}
if (largeLaptop.length || smallLaptop.length || ipadLandscape.length || ipadPortrait.length || mobileLandscape.length || mobilePortrait.length) {
if (largeLaptop.length) {
responsiveStyle += "@media only screen and (min-width: 1367px) and (max-width: 1600px) {.edgtf-eh-item-content." + itemClass + " { padding: " + largeLaptop + " !important; } }";
}
if (smallLaptop.length) {
responsiveStyle += "@media only screen and (min-width: 1025px) and (max-width: 1366px) {.edgtf-eh-item-content." + itemClass + " { padding: " + smallLaptop + " !important; } }";
}
if (ipadLandscape.length) {
responsiveStyle += "@media only screen and (min-width: 769px) and (max-width: 1024px) {.edgtf-eh-item-content." + itemClass + " { padding: " + ipadLandscape + " !important; } }";
}
if (ipadPortrait.length) {
responsiveStyle += "@media only screen and (min-width: 681px) and (max-width: 768px) {.edgtf-eh-item-content." + itemClass + " { padding: " + ipadPortrait + " !important; } }";
}
if (mobileLandscape.length) {
responsiveStyle += "@media only screen and (max-width: 680px) {.edgtf-eh-item-content." + itemClass + " { padding: " + mobileLandscape + " !important; } }";
}
}
if (typeof edgtf.modules.common.edgtfOwlSlider === "function") { // if owl function exist
var owl = thisItem.find('.edgtf-owl-slider');
if (owl.length) { // if owl is in elements holder
setTimeout(function () {
owl.trigger('refresh.owl.carousel'); // reinit owl
}, 100);
}
}
});
if (responsiveStyle.length) {
style = '<style type="text/css">' + responsiveStyle + '</style>';
}
if (style.length) {
$('head').append(style);
}
});
}
}
})(jQuery);
(function ($) {
'use strict';
var glideSlider = {};
edgtf.modules.glideSlider = glideSlider;
glideSlider.edgtfInitGlideSlider = edgtfInitGlideSlider;
glideSlider.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitGlideSlider();
}
/*
** Glide slider
*/
function edgtfInitGlideSlider() {
var glideSlider = $('.swiper-container.edgtf-glide-slider');
if (glideSlider.length) {
glideSlider.each(function () {
var swiper = $(this);
var mouseWheelControl = swiper.data('mouse-wheel-control') === 'yes' ? true : false;
var swiperSlider = new Swiper(swiper, {
loop: true,
parallax: true,
speed: 1000,
mousewheel: mouseWheelControl,
pagination: {
el: '.swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
return '<span class="' + className + '">0' + (index + 1) + '</span>';
},
},
});
});
}
}
})(jQuery);
(function ($) {
'use strict';
var googleMap = {};
edgtf.modules.googleMap = googleMap;
googleMap.edgtfShowGoogleMap = edgtfShowGoogleMap;
googleMap.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfShowGoogleMap();
}
/*
** Show Google Map
*/
function edgtfShowGoogleMap() {
var googleMap = $('.edgtf-google-map');
if (googleMap.length) {
googleMap.each(function () {
var element = $(this);
var snazzyMapStyle = false;
var snazzyMapCode = '';
if (typeof element.data('snazzy-map-style') !== 'undefined' && element.data('snazzy-map-style') === 'yes') {
snazzyMapStyle = true;
var snazzyMapHolder = element.parent().find('.edgtf-snazzy-map'),
snazzyMapCodes = snazzyMapHolder.val();
if (snazzyMapHolder.length && snazzyMapCodes.length) {
snazzyMapCode = JSON.parse(snazzyMapCodes.replace(/`{`/g, '[').replace(/`}`/g, ']').replace(/``/g, '"').replace(/`/g, ''));
}
}
var customMapStyle;
if (typeof element.data('custom-map-style') !== 'undefined') {
customMapStyle = element.data('custom-map-style');
}
var colorOverlay;
if (typeof element.data('color-overlay') !== 'undefined' && element.data('color-overlay') !== false) {
colorOverlay = element.data('color-overlay');
}
var saturation;
if (typeof element.data('saturation') !== 'undefined' && element.data('saturation') !== false) {
saturation = element.data('saturation');
}
var lightness;
if (typeof element.data('lightness') !== 'undefined' && element.data('lightness') !== false) {
lightness = element.data('lightness');
}
var zoom;
if (typeof element.data('zoom') !== 'undefined' && element.data('zoom') !== false) {
zoom = element.data('zoom');
}
var pin;
if (typeof element.data('pin') !== 'undefined' && element.data('pin') !== false) {
pin = element.data('pin');
}
var mapHeight;
if (typeof element.data('height') !== 'undefined' && element.data('height') !== false) {
mapHeight = element.data('height');
}
var uniqueId;
if (typeof element.data('unique-id') !== 'undefined' && element.data('unique-id') !== false) {
uniqueId = element.data('unique-id');
}
var scrollWheel;
if (typeof element.data('scroll-wheel') !== 'undefined') {
scrollWheel = element.data('scroll-wheel');
}
var addresses;
if (typeof element.data('addresses') !== 'undefined' && element.data('addresses') !== false) {
addresses = element.data('addresses');
}
var map = "map_" + uniqueId;
var geocoder = "geocoder_" + uniqueId;
var holderId = "edgtf-map-" + uniqueId;
edgtfInitializeGoogleMap(snazzyMapStyle, snazzyMapCode, customMapStyle, colorOverlay, saturation, lightness, scrollWheel, zoom, holderId, mapHeight, pin, map, geocoder, addresses);
});
}
}
/*
** Init Google Map
*/
function edgtfInitializeGoogleMap(snazzyMapStyle, snazzyMapCode, customMapStyle, color, saturation, lightness, wheel, zoom, holderId, height, pin, map, geocoder, data) {
if (typeof google !== 'object') {
return;
}
var mapStyles = [];
if (snazzyMapStyle && snazzyMapCode.length) {
mapStyles = snazzyMapCode;
} else {
mapStyles = [
{
stylers: [
{hue: color},
{saturation: saturation},
{lightness: lightness},
{gamma: 1}
]
}
];
}
var googleMapStyleId;
if (snazzyMapStyle || customMapStyle === 'yes') {
googleMapStyleId = 'edgtf-style';
} else {
googleMapStyleId = google.maps.MapTypeId.ROADMAP;
}
wheel = wheel === 'yes';
var qoogleMapType = new google.maps.StyledMapType(mapStyles, {name: "Google Map"});
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(-34.397, 150.644);
if (!isNaN(height)) {
height = height + 'px';
}
var myOptions = {
zoom: zoom,
scrollwheel: wheel,
center: latlng,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.RIGHT_CENTER
},
scaleControl: false,
scaleControlOptions: {
position: google.maps.ControlPosition.LEFT_CENTER
},
streetViewControl: false,
streetViewControlOptions: {
position: google.maps.ControlPosition.LEFT_CENTER
},
panControl: false,
panControlOptions: {
position: google.maps.ControlPosition.LEFT_CENTER
},
mapTypeControl: false,
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'edgtf-style'],
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
position: google.maps.ControlPosition.LEFT_CENTER
},
mapTypeId: googleMapStyleId
};
map = new google.maps.Map(document.getElementById(holderId), myOptions);
map.mapTypes.set('edgtf-style', qoogleMapType);
var index;
for (index = 0; index < data.length; ++index) {
edgtfInitializeGoogleAddress(data[index], pin, map, geocoder);
}
var holderElement = document.getElementById(holderId);
holderElement.style.height = height;
}
/*
** Init Google Map Addresses
*/
function edgtfInitializeGoogleAddress(data, pin, map, geocoder) {
if (data === '') {
return;
}
var contentString = '<div id="content">' +
'<div id="siteNotice">' +
'</div>' +
'<div id="bodyContent">' +
'<p>' + data + '</p>' +
'</div>' +
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
geocoder.geocode({'address': data}, function (results, status) {
if (status === google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location,
icon: pin,
title: data.store_title
});
google.maps.event.addListener(marker, 'click', function () {
infowindow.open(map, marker);
});
google.maps.event.addDomListener(window, 'resize', function () {
map.setCenter(results[0].geometry.location);
});
}
});
}
})(jQuery);
(function ($) {
'use strict';
var icon = {};
edgtf.modules.icon = icon;
icon.edgtfIcon = edgtfIcon;
icon.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfIcon().init();
}
/**
* Object that represents icon shortcode
* @returns {{init: Function}} function that initializes icon's functionality
*/
var edgtfIcon = function () {
var icons = $('.edgtf-icon-shortcode');
/**
* Function that triggers icon animation and icon animation delay
*/
var iconAnimation = function (icon) {
if (icon.hasClass('edgtf-icon-animation')) {
icon.appear(function () {
icon.parent('.edgtf-icon-animation-holder').addClass('edgtf-icon-animation-show');
}, {accX: 0, accY: edgtfGlobalVars.vars.edgtfElementAppearAmount});
}
};
/**
* Function that triggers icon hover color functionality
*/
var iconHoverColor = function (icon) {
if (typeof icon.data('hover-color') !== 'undefined') {
var changeIconColor = function (event) {
event.data.icon.css('color', event.data.color);
};
var iconElement = icon.find('.edgtf-icon-element');
var hoverColor = icon.data('hover-color');
var originalColor = iconElement.css('color');
if (hoverColor !== '') {
icon.on('mouseenter', {icon: iconElement, color: hoverColor}, changeIconColor);
icon.on('mouseleave', {icon: iconElement, color: originalColor}, changeIconColor);
}
}
};
/**
* Function that triggers icon holder background color hover functionality
*/
var iconHolderBackgroundHover = function (icon) {
if (typeof icon.data('hover-background-color') !== 'undefined') {
var changeIconBgColor = function (event) {
event.data.icon.css('background-color', event.data.color);
};
var hoverBackgroundColor = icon.data('hover-background-color');
var originalBackgroundColor = icon.css('background-color');
if (hoverBackgroundColor !== '') {
icon.on('mouseenter', {icon: icon, color: hoverBackgroundColor}, changeIconBgColor);
icon.on('mouseleave', {icon: icon, color: originalBackgroundColor}, changeIconBgColor);
}
}
};
/**
* Function that initializes icon holder border hover functionality
*/
var iconHolderBorderHover = function (icon) {
if (typeof icon.data('hover-border-color') !== 'undefined') {
var changeIconBorder = function (event) {
event.data.icon.css('border-color', event.data.color);
};
var hoverBorderColor = icon.data('hover-border-color');
var originalBorderColor = icon.css('borderTopColor');
if (hoverBorderColor !== '') {
icon.on('mouseenter', {icon: icon, color: hoverBorderColor}, changeIconBorder);
icon.on('mouseleave', {icon: icon, color: originalBorderColor}, changeIconBorder);
}
}
};
return {
init: function () {
if (icons.length) {
icons.each(function () {
iconAnimation($(this));
iconHoverColor($(this));
iconHolderBackgroundHover($(this));
iconHolderBorderHover($(this));
});
}
}
};
};
})(jQuery);
(function ($) {
'use strict';
var iconListItem = {};
edgtf.modules.iconListItem = iconListItem;
iconListItem.edgtfInitIconList = edgtfInitIconList;
iconListItem.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitIconList().init();
}
/**
* Button object that initializes icon list with animation
* @type {Function}
*/
var edgtfInitIconList = function () {
var iconList = $('.edgtf-animate-list');
/**
* Initializes icon list animation
* @param list current slider
*/
var iconListInit = function (list) {
setTimeout(function () {
list.appear(function () {
list.addClass('edgtf-appeared');
}, {accX: 0, accY: edgtfGlobalVars.vars.edgtfElementAppearAmount});
}, 30);
};
return {
init: function () {
if (iconList.length) {
iconList.each(function () {
iconListInit($(this));
});
}
}
};
};
})(jQuery);
(function ($) {
'use strict';
var imageTooltip = {};
edgtf.modules.imageTooltip = imageTooltip;
imageTooltip.edgtfImageTooltipInit = edgtfImageTooltipInit;
imageTooltip.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfImageTooltipInit();
}
/*
* Init Image Tooltip shortcode
*/
function edgtfImageTooltipInit() {
var holder = $('.edgtf-image-tooltip');
if (holder.length) {
holder.each(function () {
$(this).tooltip({
animation: true,
html: true
});
});
}
}
})(jQuery);
(function ($) {
'use strict';
var imageWithText = {};
edgtf.modules.imageWithText = imageWithText;
imageWithText.edgtfImageWithTextInit = edgtfImageWithTextInit;
imageWithText.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfImageWithTextInit();
}
/*
* Init Image Tooltip shortcode
*/
function edgtfImageWithTextInit() {
var iwts = $('.edgtf-iwt-text-follow-cursor');
if (iwts.length) {
edgtf.body.append('<div class="edgtf-iwt-follow-info-holder">\
<div class="edgtf-iwt-follow-info-title-holder"></div>\
<div class="edgtf-iwt-follow-info-text-holder"></div>\
</div>');
var followInfoHolder = $('.edgtf-iwt-follow-info-holder'),
followInfoTitle = followInfoHolder.find('.edgtf-iwt-follow-info-title-holder'),
followInfoText = followInfoHolder.find('.edgtf-iwt-follow-info-text-holder');
iwts.each(function () {
var iwt = $(this);
//info element position
iwt.on('mousemove', function (e) {
followInfoHolder.css({
top: e.clientY,
left: e.clientX
});
});
//show/hide info element
iwt.find('.edgtf-iwt-image').on('mousemove', function () {
if (!followInfoHolder.hasClass('edgtf-is-active')) {
followInfoHolder.addClass('edgtf-is-active');
}
});
iwt.find('.edgtf-iwt-image').on('mouseenter', function () {
var item = $(this).parent(),
itemTitle = item.find('.edgtf-iwt-title-wrapper'),
itemText = item.find('.edgtf-iwt-text-wrapper');
if (itemTitle.length) {
followInfoTitle.html(itemTitle.html());
}
if (itemText.length) {
followInfoText.html(itemText.html());
}
}).on('mouseleave', function () {
if (followInfoHolder.hasClass('edgtf-is-active')) {
followInfoHolder.removeClass('edgtf-is-active');
}
});
});
}
}
})(jQuery);
(function ($) {
'use strict';
var pieChart = {};
edgtf.modules.pieChart = pieChart;
pieChart.edgtfInitPieChart = edgtfInitPieChart;
pieChart.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitPieChart();
}
/**
* Init Pie Chart shortcode
*/
function edgtfInitPieChart() {
var pieChartHolder = $('.edgtf-pie-chart-holder');
if (pieChartHolder.length) {
pieChartHolder.each(function () {
var thisPieChartHolder = $(this),
pieChart = thisPieChartHolder.children('.edgtf-pc-percentage'),
barColor = '#000000',
trackColor = '#ffffff',
lineWidth = 3,
size = 176;
if (typeof pieChart.data('size') !== 'undefined' && pieChart.data('size') !== '') {
size = pieChart.data('size');
}
if (typeof pieChart.data('bar-color') !== 'undefined' && pieChart.data('bar-color') !== '') {
barColor = pieChart.data('bar-color');
}
if (typeof pieChart.data('track-color') !== 'undefined' && pieChart.data('track-color') !== '') {
trackColor = pieChart.data('track-color');
}
pieChart.appear(function () {
initToCounterPieChart(pieChart);
thisPieChartHolder.css('opacity', '1');
pieChart.easyPieChart({
barColor: barColor,
trackColor: trackColor,
scaleColor: false,
lineCap: 'butt',
lineWidth: lineWidth,
animate: 1500,
size: size
});
}, {accX: 0, accY: edgtfGlobalVars.vars.edgtfElementAppearAmount});
});
}
}
/*
** Counter for pie chart number from zero to defined number
*/
function initToCounterPieChart(pieChart) {
var counter = pieChart.find('.edgtf-pc-percent'),
max = parseFloat(counter.text());
counter.countTo({
from: 0,
to: max,
speed: 1500,
refreshInterval: 50
});
}
})(jQuery);
(function ($) {
'use strict';
var progressBar = {};
edgtf.modules.progressBar = progressBar;
progressBar.edgtfInitProgressBars = edgtfInitProgressBars;
progressBar.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitProgressBars();
}
/*
** Horizontal progress bars shortcode
*/
function edgtfInitProgressBars() {
var progressBar = $('.edgtf-progress-bar');
if (progressBar.length) {
progressBar.appear(function () {
var thisBar = $(this),
thisBarContent = thisBar.find('.edgtf-pb-content'),
percentage = thisBarContent.data('percentage');
thisBar.addClass('edgtf-appeared');
thisBarContent.css({'width': percentage + '%'});
thisBar.find('.edgtf-pb-percent').css({'left': percentage + '%'});
edgtfInitToCounterProgressBar(thisBar, percentage);
});
}
}
/*
** Counter for horizontal progress bars percent from zero to defined percent
*/
function edgtfInitToCounterProgressBar(progressBar, percentageValue) {
var percentage = parseFloat(percentageValue),
percent = progressBar.find('.edgtf-pb-percent span');
if (percent.length) {
percent.countTo({
from: 0,
to: percentage,
speed: 800,
refreshInterval: 50
});
}
}
})(jQuery);
(function ($) {
'use strict';
var tabs = {};
edgtf.modules.tabs = tabs;
tabs.edgtfInitTabs = edgtfInitTabs;
tabs.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitTabs();
}
/*
** Init tabs shortcode
*/
function edgtfInitTabs() {
var tabs = $('.edgtf-tabs');
if (tabs.length) {
tabs.each(function () {
var thisTabs = $(this);
thisTabs.children('.edgtf-tab-container').each(function (index) {
index = index + 1;
var that = $(this),
link = that.attr('id'),
navItem = that.parent().find('.edgtf-tabs-nav li:nth-child(' + index + ') a'),
navLink = navItem.attr('href');
link = '#' + link;
if (link.indexOf(navLink) > -1) {
navItem.attr('href', link);
}
});
thisTabs.tabs();
$('.edgtf-tabs a.edgtf-external-link').off('click');
});
}
}
})(jQuery);
(function ($) {
'use strict';
var textMarquee = {};
edgtf.modules.textMarquee = textMarquee;
textMarquee.edgtfInitTextMarquee = edgtfInitTextMarquee;
textMarquee.edgtfTextMarqueeResize = edgtfTextMarqueeResize;
textMarquee.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfTextMarqueeResize();
edgtfInitTextMarquee();
}
/**
* Init Text Marquee effect
*/
function edgtfInitTextMarquee() {
var textMarqueeShortcodes = $('.edgtf-text-marquee');
if (textMarqueeShortcodes.length) {
textMarqueeShortcodes.each(function () {
var textMarqueeShortcode = $(this),
marqueeElements = textMarqueeShortcode.find('.edgtf-marquee-element'),
originalText = marqueeElements.filter('.edgtf-original-text'),
auxText = marqueeElements.filter('.edgtf-aux-text');
var calcWidth = function (element) {
var width;
if (textMarqueeShortcode.outerWidth() > element.outerWidth()) {
width = textMarqueeShortcode.outerWidth();
} else {
width = element.outerWidth();
}
return width;
};
var marqueeEffect = function () {
edgtfRequestAnimationFrame();
var delta = 1, //pixel movement
speedCoeff = 0.8, // below 1 to slow down, above 1 to speed up
marqueeWidth = calcWidth(originalText);
marqueeElements.css({'width': marqueeWidth}); // set the same width to both elements
auxText.css('left', marqueeWidth); //set to the right of the initial marquee element
//movement loop
marqueeElements.each(function (i) {
var marqueeElement = $(this),
currentPos = 0;
var edgtfInfiniteScrollEffect = function () {
currentPos -= delta;
//move marquee element
if (marqueeElement.position().left <= -marqueeWidth) {
marqueeElement.css('left', parseInt(marqueeWidth - delta));
currentPos = 0;
}
marqueeElement.css('transform', 'translate3d(' + speedCoeff * currentPos + 'px,0,0)');
requestNextAnimationFrame(edgtfInfiniteScrollEffect);
$(window).resize(function () {
marqueeWidth = calcWidth(originalText);
currentPos = 0;
originalText.css('left', 0);
auxText.css('left', marqueeWidth); //set to the right of the inital marquee element
});
};
edgtfInfiniteScrollEffect();
});
};
marqueeEffect();
});
}
}
/*
* Request Animation Frame shim
*/
function edgtfRequestAnimationFrame() {
window.requestNextAnimationFrame =
(function () {
var originalWebkitRequestAnimationFrame = undefined,
wrapper = undefined,
callback = undefined,
geckoVersion = 0,
userAgent = navigator.userAgent,
index = 0,
self = this;
// Workaround for Chrome 10 bug where Chrome
// does not pass the time to the animation function
if (window.webkitRequestAnimationFrame) {
// Define the wrapper
wrapper = function (time) {
if (time === undefined) {
time = +new Date();
}
self.callback(time);
};
// Make the switch
originalWebkitRequestAnimationFrame = window.webkitRequestAnimationFrame;
window.webkitRequestAnimationFrame = function (callback, element) {
self.callback = callback;
// Browser calls the wrapper and wrapper calls the callback
originalWebkitRequestAnimationFrame(wrapper, element);
};
}
// Workaround for Gecko 2.0, which has a bug in
// mozRequestAnimationFrame() that restricts animations
// to 30-40 fps.
if (window.mozRequestAnimationFrame) {
// Check the Gecko version. Gecko is used by browsers
// other than Firefox. Gecko 2.0 corresponds to
// Firefox 4.0.
index = userAgent.indexOf('rv:');
if (userAgent.indexOf('Gecko') !== -1) {
geckoVersion = userAgent.substr(index + 3, 3);
if (geckoVersion === '2.0') {
// Forces the return statement to fall through
// to the setTimeout() function.
window.mozRequestAnimationFrame = undefined;
}
}
}
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback, element) {
var start,
finish;
window.setTimeout(function () {
start = +new Date();
callback(start);
finish = +new Date();
self.timeout = 1000 / 60 - (finish - start);
}, self.timeout);
};
})();
}
/*
** Text Marquee resizing style
*/
function edgtfTextMarqueeResize() {
var holder = $('.edgtf-text-marquee');
if (holder.length) {
holder.each(function () {
var thisItem = $(this),
itemClass = '',
smallLaptopStyle = '',
ipadLandscapeStyle = '',
ipadPortraitStyle = '',
mobileLandscapeStyle = '',
style = '',
responsiveStyle = '';
if (typeof thisItem.data('item-class') !== 'undefined' && thisItem.data('item-class') !== false) {
itemClass = thisItem.data('item-class');
}
if (typeof thisItem.data('font-size-1366') !== 'undefined' && thisItem.data('font-size-1366') !== false) {
smallLaptopStyle += 'font-size: ' + thisItem.data('font-size-1366') + ' !important;';
}
if (typeof thisItem.data('font-size-1024') !== 'undefined' && thisItem.data('font-size-1024') !== false) {
ipadLandscapeStyle += 'font-size: ' + thisItem.data('font-size-1024') + ' !important;';
}
if (typeof thisItem.data('font-size-768') !== 'undefined' && thisItem.data('font-size-768') !== false) {
ipadPortraitStyle += 'font-size: ' + thisItem.data('font-size-768') + ' !important;';
}
if (typeof thisItem.data('font-size-680') !== 'undefined' && thisItem.data('font-size-680') !== false) {
mobileLandscapeStyle += 'font-size: ' + thisItem.data('font-size-680') + ' !important;';
}
if (typeof thisItem.data('line-height-1366') !== 'undefined' && thisItem.data('line-height-1366') !== false) {
smallLaptopStyle += 'line-height: ' + thisItem.data('line-height-1366') + ' !important;';
}
if (typeof thisItem.data('line-height-1024') !== 'undefined' && thisItem.data('line-height-1024') !== false) {
ipadLandscapeStyle += 'line-height: ' + thisItem.data('line-height-1024') + ' !important;';
}
if (typeof thisItem.data('line-height-768') !== 'undefined' && thisItem.data('line-height-768') !== false) {
ipadPortraitStyle += 'line-height: ' + thisItem.data('line-height-768') + ' !important;';
}
if (typeof thisItem.data('line-height-680') !== 'undefined' && thisItem.data('line-height-680') !== false) {
mobileLandscapeStyle += 'line-height: ' + thisItem.data('line-height-680') + ' !important;';
}
if (smallLaptopStyle.length || ipadLandscapeStyle.length || ipadPortraitStyle.length || mobileLandscapeStyle.length) {
if (smallLaptopStyle.length) {
responsiveStyle += "@media only screen and (max-width: 1366px) {.edgtf-text-marquee." + itemClass + " { " + smallLaptopStyle + " } }";
}
if (ipadLandscapeStyle.length) {
responsiveStyle += "@media only screen and (max-width: 1024px) {.edgtf-text-marquee." + itemClass + " { " + ipadLandscapeStyle + " } }";
}
if (ipadPortraitStyle.length) {
responsiveStyle += "@media only screen and (max-width: 768px) {.edgtf-text-marquee." + itemClass + " { " + ipadPortraitStyle + " } }";
}
if (mobileLandscapeStyle.length) {
responsiveStyle += "@media only screen and (max-width: 680px) {.edgtf-text-marquee." + itemClass + " { " + mobileLandscapeStyle + " } }";
}
}
if (responsiveStyle.length) {
style = '<style type="text/css">' + responsiveStyle + '</style>';
}
if (style.length) {
$('head').append(style);
}
});
}
}
})(jQuery);
(function ($) {
'use strict';
var verticalSplitSlider = {};
edgtf.modules.verticalSplitSlider = verticalSplitSlider;
verticalSplitSlider.edgtfInitVerticalSplitSlider = edgtfInitVerticalSplitSlider;
verticalSplitSlider.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfInitVerticalSplitSlider();
}
/*
** Vertical Split Slider
*/
function edgtfInitVerticalSplitSlider() {
var slider = $('.edgtf-vertical-split-slider');
if (slider.length) {
if (edgtf.body.hasClass('edgtf-vss-initialized')) {
edgtf.body.removeClass('edgtf-vss-initialized');
$.fn.multiscroll.destroy();
}
slider.height(edgtf.windowHeight).animate({opacity: 1}, 300);
var defaultHeaderStyle = '';
if (edgtf.body.hasClass('edgtf-light-header')) {
defaultHeaderStyle = 'light';
} else if (edgtf.body.hasClass('edgtf-dark-header')) {
defaultHeaderStyle = 'dark';
}
slider.multiscroll({
scrollingSpeed: 700,
easing: 'easeInOutQuart',
navigation: true,
useAnchorsOnLoad: false,
sectionSelector: '.edgtf-vss-ms-section',
leftSelector: '.edgtf-vss-ms-left',
rightSelector: '.edgtf-vss-ms-right',
afterRender: function () {
edgtfCheckVerticalSplitSectionsForHeaderStyle($('.edgtf-vss-ms-left .edgtf-vss-ms-section:first-child').data('header-style'), defaultHeaderStyle);
edgtf.body.addClass('edgtf-vss-initialized');
var contactForm7 = $('div.wpcf7 > form');
if (contactForm7.length) {
contactForm7.each(function () {
var thisForm = $(this);
thisForm.find('.wpcf7-submit').off().on('click', function (e) {
e.preventDefault();
wpcf7.submit(thisForm);
});
});
}
//prepare html for smaller screens - start //
var verticalSplitSliderResponsive = $('<div class="edgtf-vss-responsive"></div>'),
leftSide = slider.find('.edgtf-vss-ms-left > div'),
rightSide = slider.find('.edgtf-vss-ms-right > div');
slider.after(verticalSplitSliderResponsive);
for (var i = 0; i < leftSide.length; i++) {
verticalSplitSliderResponsive.append($(leftSide[i]).clone(true));
verticalSplitSliderResponsive.append($(rightSide[leftSide.length - 1 - i]).clone(true));
}
//prepare google maps clones
var googleMapHolder = $('.edgtf-vss-responsive .edgtf-google-map');
if (googleMapHolder.length) {
googleMapHolder.each(function () {
var map = $(this);
map.empty();
var num = Math.floor((Math.random() * 100000) + 1);
map.attr('id', 'edgtf-map-' + num);
map.data('unique-id', num);
});
}
if (typeof edgtf.modules.animationHolder.edgtfInitAnimationHolder === "function") {
edgtf.modules.animationHolder.edgtfInitAnimationHolder();
}
if (typeof edgtf.modules.button.edgtfButton === "function") {
edgtf.modules.button.edgtfButton().init();
}
if (typeof edgtf.modules.elementsHolder.edgtfInitElementsHolderResponsiveStyle === "function") {
edgtf.modules.elementsHolder.edgtfInitElementsHolderResponsiveStyle();
}
if (typeof edgtf.modules.googleMap.edgtfShowGoogleMap === "function") {
edgtf.modules.googleMap.edgtfShowGoogleMap();
}
if (typeof edgtf.modules.icon.edgtfIcon === "function") {
edgtf.modules.icon.edgtfIcon().init();
}
if (typeof edgtf.modules.progressBar.edgtfInitProgressBars === "function") {
edgtf.modules.progressBar.edgtfInitProgressBars();
}
},
onLeave: function (index, nextIndex) {
edgtfIntiScrollAnimation(slider, nextIndex);
edgtfCheckVerticalSplitSectionsForHeaderStyle($($('.edgtf-vss-ms-left .edgtf-vss-ms-section')[nextIndex - 1]).data('header-style'), defaultHeaderStyle);
}
});
if (edgtf.windowWidth <= 1024) {
$.fn.multiscroll.destroy();
} else {
$.fn.multiscroll.build();
}
$(window).resize(function () {
if (edgtf.windowWidth <= 1024) {
$.fn.multiscroll.destroy();
} else {
$.fn.multiscroll.build();
}
});
}
}
function edgtfIntiScrollAnimation(slider, nextIndex) {
if (slider.hasClass('edgtf-vss-scrolling-animation')) {
if (nextIndex > 1 && !slider.hasClass('edgtf-vss-scrolled')) {
slider.addClass('edgtf-vss-scrolled');
} else if (nextIndex === 1 && slider.hasClass('edgtf-vss-scrolled')) {
slider.removeClass('edgtf-vss-scrolled');
}
}
}
/*
** Check slides on load and slide change for header style changing
*/
function edgtfCheckVerticalSplitSectionsForHeaderStyle(section_header_style, default_header_style) {
if (section_header_style !== undefined && section_header_style !== '') {
edgtf.body.removeClass('edgtf-light-header edgtf-dark-header').addClass('edgtf-' + section_header_style + '-header');
} else if (default_header_style !== '') {
edgtf.body.removeClass('edgtf-light-header edgtf-dark-header').addClass('edgtf-' + default_header_style + '-header');
} else {
edgtf.body.removeClass('edgtf-light-header edgtf-dark-header');
}
}
})(jQuery);
(function ($) {
'use strict';
var portfolioList = {};
edgtf.modules.portfolioList = portfolioList;
portfolioList.edgtfOnWindowLoad = edgtfOnWindowLoad;
portfolioList.edgtfOnWindowScroll = edgtfOnWindowScroll;
$(window).on('load', edgtfOnWindowLoad);
$(window).scroll(edgtfOnWindowScroll);
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
edgtfInitPortfolioFilter();
edgtfInitPortfolioListAnimation();
edgtfInitPortfolioPagination().init();
}
/*
All functions to be called on $(window).scroll() should be in this function
*/
function edgtfOnWindowScroll() {
edgtfInitPortfolioPagination().scroll();
}
/**
* Initializes portfolio list article animation
*/
function edgtfInitPortfolioListAnimation() {
var portList = $('.edgtf-portfolio-list-holder.edgtf-pl-has-animation');
if (portList.length) {
portList.each(function () {
var thisPortList = $(this).children('.edgtf-pl-inner');
thisPortList.children('article').each(function (l) {
var thisArticle = $(this);
thisArticle.appear(function () {
thisArticle.addClass('edgtf-item-show');
setTimeout(function () {
thisArticle.addClass('edgtf-item-shown');
}, 1000);
}, {accX: 0, accY: 0});
});
});
}
}
/**
* Initializes portfolio masonry filter
*/
function edgtfInitPortfolioFilter() {
var filterHolder = $('.edgtf-portfolio-list-holder .edgtf-pl-filter-holder');
if (filterHolder.length) {
filterHolder.each(function () {
var thisFilterHolder = $(this),
thisPortListHolder = thisFilterHolder.closest('.edgtf-portfolio-list-holder'),
thisPortListInner = thisPortListHolder.find('.edgtf-pl-inner'),
portListHasLoadMore = thisPortListHolder.hasClass('edgtf-pl-pag-load-more') ? true : false;
thisFilterHolder.find('.edgtf-pl-filter:first').addClass('edgtf-pl-current');
if (thisPortListHolder.hasClass('edgtf-pl-gallery')) {
thisPortListInner.isotope();
}
thisFilterHolder.find('.edgtf-pl-filter').on('click', function () {
var thisFilter = $(this),
filterValue = thisFilter.attr('data-filter'),
filterClassName = filterValue.length ? filterValue.substring(1) : '',
portListHasArticles = thisPortListInner.children().hasClass(filterClassName) ? true : false;
thisFilter.parent().children('.edgtf-pl-filter').removeClass('edgtf-pl-current');
thisFilter.addClass('edgtf-pl-current');
if (portListHasLoadMore && !portListHasArticles && filterValue.length) {
edgtfInitLoadMoreItemsPortfolioFilter(thisPortListHolder, filterValue, filterClassName);
} else {
filterValue = filterValue.length === 0 ? '*' : filterValue;
thisFilterHolder.parent().children('.edgtf-pl-inner').isotope({filter: filterValue});
edgtf.modules.common.edgtfInitParallax();
}
});
});
}
}
/**
* Initializes load more items if portfolio masonry filter item is empty
*/
function edgtfInitLoadMoreItemsPortfolioFilter($portfolioList, $filterValue, $filterClassName) {
var thisPortList = $portfolioList,
thisPortListInner = thisPortList.find('.edgtf-pl-inner'),
filterValue = $filterValue,
filterClassName = $filterClassName,
maxNumPages = 0;
if (typeof thisPortList.data('max-num-pages') !== 'undefined' && thisPortList.data('max-num-pages') !== false) {
maxNumPages = thisPortList.data('max-num-pages');
}
var loadMoreDatta = edgtf.modules.common.getLoadMoreData(thisPortList),
nextPage = loadMoreDatta.nextPage,
ajaxData = edgtf.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'ottar_core_portfolio_ajax_load_more'),
loadingItem = thisPortList.find('.edgtf-pl-loading');
if (nextPage <= maxNumPages) {
loadingItem.addClass('edgtf-showing edgtf-filter-trigger');
thisPortListInner.css('opacity', '0');
$.ajax({
type: 'POST',
data: ajaxData,
url: edgtfGlobalVars.vars.edgtfAjaxUrl,
success: function (data) {
nextPage++;
thisPortList.data('next-page', nextPage);
var response = $.parseJSON(data),
responseHtml = response.html;
thisPortList.waitForImages(function () {
thisPortListInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'});
var portListHasArticles = !!thisPortListInner.children().hasClass(filterClassName);
if (portListHasArticles) {
setTimeout(function () {
edgtf.modules.common.setFixedImageProportionSize(thisPortList, thisPortListInner.find('article'), thisPortListInner.find('.edgtf-masonry-grid-sizer').width());
thisPortListInner.isotope('layout').isotope({filter: filterValue});
loadingItem.removeClass('edgtf-showing edgtf-filter-trigger');
setTimeout(function () {
thisPortListInner.css('opacity', '1');
edgtfInitPortfolioListAnimation();
edgtf.modules.common.edgtfInitParallax();
}, 150);
}, 400);
} else {
loadingItem.removeClass('edgtf-showing edgtf-filter-trigger');
edgtfInitLoadMoreItemsPortfolioFilter(thisPortList, filterValue, filterClassName);
}
});
}
});
}
}
/**
* Initializes portfolio pagination functions
*/
function edgtfInitPortfolioPagination() {
var portList = $('.edgtf-portfolio-list-holder');
var initStandardPagination = function (thisPortList) {
var standardLink = thisPortList.find('.edgtf-pl-standard-pagination li');
if (standardLink.length) {
standardLink.each(function () {
var thisLink = $(this).children('a'),
pagedLink = 1;
thisLink.on('click', function (e) {
e.preventDefault();
e.stopPropagation();
if (typeof thisLink.data('paged') !== 'undefined' && thisLink.data('paged') !== false) {
pagedLink = thisLink.data('paged');
}
initMainPagFunctionality(thisPortList, pagedLink);
});
});
}
};
var initLoadMorePagination = function (thisPortList) {
var loadMoreButton = thisPortList.find('.edgtf-pl-load-more a');
loadMoreButton.on('click', function (e) {
e.preventDefault();
e.stopPropagation();
initMainPagFunctionality(thisPortList);
});
};
var initInifiteScrollPagination = function (thisPortList) {
var portListHeight = thisPortList.outerHeight(),
portListTopOffest = thisPortList.offset().top,
portListPosition = portListHeight + portListTopOffest - edgtfGlobalVars.vars.edgtfAddForAdminBar;
if (!thisPortList.hasClass('edgtf-pl-infinite-scroll-started') && edgtf.scroll + edgtf.windowHeight > portListPosition) {
initMainPagFunctionality(thisPortList);
}
};
var initMainPagFunctionality = function (thisPortList, pagedLink) {
var thisPortListInner = thisPortList.find('.edgtf-pl-inner'),
nextPage,
maxNumPages;
if (typeof thisPortList.data('max-num-pages') !== 'undefined' && thisPortList.data('max-num-pages') !== false) {
maxNumPages = thisPortList.data('max-num-pages');
}
if (thisPortList.hasClass('edgtf-pl-pag-standard')) {
thisPortList.data('next-page', pagedLink);
}
if (thisPortList.hasClass('edgtf-pl-pag-infinite-scroll')) {
thisPortList.addClass('edgtf-pl-infinite-scroll-started');
}
var loadMoreDatta = edgtf.modules.common.getLoadMoreData(thisPortList),
loadingItem = thisPortList.find('.edgtf-pl-loading');
nextPage = loadMoreDatta.nextPage;
if (nextPage <= maxNumPages || maxNumPages === 0) {
if (thisPortList.hasClass('edgtf-pl-pag-standard')) {
loadingItem.addClass('edgtf-showing edgtf-standard-pag-trigger');
thisPortList.addClass('edgtf-pl-pag-standard-animate');
} else {
loadingItem.addClass('edgtf-showing');
}
var ajaxData = edgtf.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'ottar_core_portfolio_ajax_load_more');
$.ajax({
type: 'POST',
data: ajaxData,
url: edgtfGlobalVars.vars.edgtfAjaxUrl,
success: function (data) {
if (!thisPortList.hasClass('edgtf-pl-pag-standard')) {
nextPage++;
}
thisPortList.data('next-page', nextPage);
var response = $.parseJSON(data),
responseHtml = response.html;
if (thisPortList.hasClass('edgtf-pl-pag-standard')) {
edgtfInitStandardPaginationLinkChanges(thisPortList, maxNumPages, nextPage);
thisPortList.waitForImages(function () {
if (thisPortList.hasClass('edgtf-pl-masonry')) {
edgtfInitHtmlIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml);
} else if (thisPortList.hasClass('edgtf-pl-gallery') && thisPortList.hasClass('edgtf-pl-has-filter')) {
edgtfInitHtmlIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml);
} else {
edgtfInitHtmlGalleryNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml);
}
});
} else {
thisPortList.waitForImages(function () {
if (thisPortList.hasClass('edgtf-pl-masonry')) {
if (pagedLink === 1) {
edgtfInitHtmlIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml);
} else {
edgtfInitAppendIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml);
}
} else if (thisPortList.hasClass('edgtf-pl-gallery') && thisPortList.hasClass('edgtf-pl-has-filter') && pagedLink !== 1) {
edgtfInitAppendIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml);
} else {
if (pagedLink === 1) {
edgtfInitHtmlGalleryNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml);
} else {
edgtfInitAppendGalleryNewContent(thisPortListInner, loadingItem, responseHtml);
}
}
});
}
if (thisPortList.hasClass('edgtf-pl-infinite-scroll-started')) {
thisPortList.removeClass('edgtf-pl-infinite-scroll-started');
}
}
});
}
if (nextPage === maxNumPages) {
thisPortList.find('.edgtf-pl-load-more-holder').hide();
}
};
var edgtfInitStandardPaginationLinkChanges = function (thisPortList, maxNumPages, nextPage) {
var standardPagHolder = thisPortList.find('.edgtf-pl-standard-pagination'),
standardPagNumericItem = standardPagHolder.find('li.edgtf-pl-pag-number'),
standardPagPrevItem = standardPagHolder.find('li.edgtf-pl-pag-prev a'),
standardPagNextItem = standardPagHolder.find('li.edgtf-pl-pag-next a');
standardPagNumericItem.removeClass('edgtf-pl-pag-active');
standardPagNumericItem.eq(nextPage - 1).addClass('edgtf-pl-pag-active');
standardPagPrevItem.data('paged', nextPage - 1);
standardPagNextItem.data('paged', nextPage + 1);
if (nextPage > 1) {
standardPagPrevItem.css({'opacity': '1'});
} else {
standardPagPrevItem.css({'opacity': '0'});
}
if (nextPage === maxNumPages) {
standardPagNextItem.css({'opacity': '0'});
} else {
standardPagNextItem.css({'opacity': '1'});
}
};
var edgtfInitHtmlIsotopeNewContent = function (thisPortList, thisPortListInner, loadingItem, responseHtml) {
thisPortListInner.find('article').remove();
thisPortListInner.append(responseHtml);
edgtf.modules.common.setFixedImageProportionSize(thisPortList, thisPortListInner.find('article'), thisPortListInner.find('.edgtf-masonry-grid-sizer').width());
thisPortListInner.isotope('reloadItems').isotope({sortBy: 'original-order'});
loadingItem.removeClass('edgtf-showing edgtf-standard-pag-trigger');
thisPortList.removeClass('edgtf-pl-pag-standard-animate');
setTimeout(function () {
thisPortListInner.isotope('layout');
edgtfInitPortfolioListAnimation();
edgtf.modules.common.edgtfInitParallax();
edgtf.modules.common.edgtfPrettyPhoto();
}, 600);
};
var edgtfInitHtmlGalleryNewContent = function (thisPortList, thisPortListInner, loadingItem, responseHtml) {
loadingItem.removeClass('edgtf-showing edgtf-standard-pag-trigger');
thisPortList.removeClass('edgtf-pl-pag-standard-animate');
thisPortListInner.html(responseHtml);
edgtfInitPortfolioListAnimation();
edgtf.modules.common.edgtfInitParallax();
edgtf.modules.common.edgtfPrettyPhoto();
};
var edgtfInitAppendIsotopeNewContent = function (thisPortList, thisPortListInner, loadingItem, responseHtml) {
thisPortListInner.append(responseHtml);
edgtf.modules.common.setFixedImageProportionSize(thisPortList, thisPortListInner.find('article'), thisPortListInner.find('.edgtf-masonry-grid-sizer').width());
thisPortListInner.isotope('reloadItems').isotope({sortBy: 'original-order'});
loadingItem.removeClass('edgtf-showing');
setTimeout(function () {
thisPortListInner.isotope('layout');
edgtfInitPortfolioListAnimation();
edgtf.modules.common.edgtfInitParallax();
edgtf.modules.common.edgtfPrettyPhoto();
}, 600);
};
var edgtfInitAppendGalleryNewContent = function (thisPortListInner, loadingItem, responseHtml) {
loadingItem.removeClass('edgtf-showing');
thisPortListInner.append(responseHtml);
edgtfInitPortfolioListAnimation();
edgtf.modules.common.edgtfInitParallax();
edgtf.modules.common.edgtfPrettyPhoto();
};
return {
init: function () {
if (portList.length) {
portList.each(function () {
var thisPortList = $(this);
if (thisPortList.hasClass('edgtf-pl-pag-standard')) {
initStandardPagination(thisPortList);
}
if (thisPortList.hasClass('edgtf-pl-pag-load-more')) {
initLoadMorePagination(thisPortList);
}
if (thisPortList.hasClass('edgtf-pl-pag-infinite-scroll')) {
initInifiteScrollPagination(thisPortList);
}
});
}
},
scroll: function () {
if (portList.length) {
portList.each(function () {
var thisPortList = $(this);
if (thisPortList.hasClass('edgtf-pl-pag-infinite-scroll')) {
initInifiteScrollPagination(thisPortList);
}
});
}
},
getMainPagFunction: function (thisPortList, paged) {
initMainPagFunctionality(thisPortList, paged);
}
};
}
})(jQuery);
(function ($) {
'use strict';
var testimonialsCarousel = {};
edgtf.modules.testimonialsCarousel = testimonialsCarousel;
testimonialsCarousel.edgtfInitTestimonials = edgtfInitTestimonialsCarousel;
testimonialsCarousel.edgtfOnWindowLoad = edgtfOnWindowLoad;
$(window).on('load', edgtfOnWindowLoad);
/*
All functions to be called on $(window).on('load', ) should be in this function
*/
function edgtfOnWindowLoad() {
edgtfInitTestimonialsCarousel();
}
/**
* Init testimonials shortcode elegant type
*/
function edgtfInitTestimonialsCarousel() {
var testimonial = $('.edgtf-testimonials-holder.edgtf-testimonials-carousel');
if (testimonial.length) {
testimonial.each(function () {
var thisTestimonials = $(this),
mainTestimonialsSlider = thisTestimonials.find('.edgtf-testimonials-main'),
imagePagSlider = thisTestimonials.children('.edgtf-testimonial-image-nav'),
loop = true,
autoplay = true,
sliderSpeed = 5000,
sliderSpeedAnimation = 600,
mouseDrag = false;
if (mainTestimonialsSlider.data('enable-loop') === 'no') {
loop = false;
}
if (mainTestimonialsSlider.data('enable-autoplay') === 'no') {
autoplay = false;
}
if (typeof mainTestimonialsSlider.data('slider-speed') !== 'undefined' && mainTestimonialsSlider.data('slider-speed') !== false) {
sliderSpeed = mainTestimonialsSlider.data('slider-speed');
}
if (typeof mainTestimonialsSlider.data('slider-speed-animation') !== 'undefined' && mainTestimonialsSlider.data('slider-speed-animation') !== false) {
sliderSpeedAnimation = mainTestimonialsSlider.data('slider-speed-animation');
}
if (edgtf.windowWidth < 680) {
mouseDrag = true;
}
if (mainTestimonialsSlider.length && imagePagSlider.length) {
var text = mainTestimonialsSlider.owlCarousel({
items: 1,
loop: loop,
autoplay: autoplay,
autoplayTimeout: sliderSpeed,
smartSpeed: sliderSpeedAnimation,
autoplayHoverPause: false,
dots: false,
nav: false,
mouseDrag: false,
touchDrag: mouseDrag,
onInitialize: function () {
mainTestimonialsSlider.css('visibility', 'visible');
}
});
var image = imagePagSlider.owlCarousel({
loop: loop,
autoplay: autoplay,
autoplayTimeout: sliderSpeed,
smartSpeed: sliderSpeedAnimation,
autoplayHoverPause: false,
center: true,
dots: false,
nav: false,
mouseDrag: false,
touchDrag: false,
responsive: {
1025: {
items: 5
},
0: {
items: 3
}
},
onInitialize: function () {
imagePagSlider.css('visibility', 'visible');
thisTestimonials.css('opacity', '1');
}
});
imagePagSlider.find('.owl-item').on('click touchpress', function (e) {
e.preventDefault();
var thisItem = $(this),
itemIndex = thisItem.index(),
numberOfClones = imagePagSlider.find('.owl-item.cloned').length,
modifiedItems = itemIndex - numberOfClones / 2 >= 0 ? itemIndex - numberOfClones / 2 : itemIndex;
image.trigger('to.owl.carousel', modifiedItems);
text.trigger('to.owl.carousel', modifiedItems);
});
}
});
}
}
})(jQuery);
(function ($) {
'use strict';
var testimonialsImagePagination = {};
edgtf.modules.testimonialsImagePagination = testimonialsImagePagination;
testimonialsImagePagination.edgtfOnDocumentReady = edgtfOnDocumentReady;
$(document).ready(edgtfOnDocumentReady);
/*
All functions to be called on $(document).ready() should be in this function
*/
function edgtfOnDocumentReady() {
edgtfTestimonialsImagePagination();
}
/**
* Init Owl Carousel
*/
function edgtfTestimonialsImagePagination() {
var sliders = $('.edgtf-testimonials-image-pagination-inner');
if (sliders.length) {
sliders.each(function () {
var slider = $(this),
slideItemsNumber = slider.children().length,
loop = true,
autoplay = true,
autoplayHoverPause = false,
sliderSpeed = 3500,
sliderSpeedAnimation = 500,
margin = 0,
stagePadding = 0,
center = false,
autoWidth = false,
animateInClass = false, // keyframe css animation
animateOutClass = false, // keyframe css animation
navigation = true,
pagination = false,
drag = true,
sliderDataHolder = slider;
if (sliderDataHolder.data('enable-loop') === 'no') {
loop = false;
}
if (typeof sliderDataHolder.data('slider-speed') !== 'undefined' && sliderDataHolder.data('slider-speed') !== false) {
sliderSpeed = sliderDataHolder.data('slider-speed');
}
if (typeof sliderDataHolder.data('slider-speed-animation') !== 'undefined' && sliderDataHolder.data('slider-speed-animation') !== false) {
sliderSpeedAnimation = sliderDataHolder.data('slider-speed-animation');
}
if (sliderDataHolder.data('enable-auto-width') === 'yes') {
autoWidth = true;
}
if (typeof sliderDataHolder.data('slider-animate-in') !== 'undefined' && sliderDataHolder.data('slider-animate-in') !== false) {
animateInClass = sliderDataHolder.data('slider-animate-in');
}
if (typeof sliderDataHolder.data('slider-animate-out') !== 'undefined' && sliderDataHolder.data('slider-animate-out') !== false) {
animateOutClass = sliderDataHolder.data('slider-animate-out');
}
if (sliderDataHolder.data('enable-navigation') === 'no') {
navigation = false;
}
if (sliderDataHolder.data('enable-pagination') === 'yes') {
pagination = true;
}
if (navigation && pagination) {
slider.addClass('edgtf-slider-has-both-nav');
}
if (pagination) {
var dotsContainer = '#edgtf-testimonial-pagination';
$('.edgtf-tsp-item').on('click', function () {
slider.trigger('to.owl.carousel', [$(this).index(), 300]);
});
}
if (slideItemsNumber <= 1) {
loop = false;
autoplay = false;
navigation = false;
pagination = false;
}
slider.waitForImages(function () {
$(this).owlCarousel({
items: 1,
loop: loop,
autoplay: autoplay,
autoplayHoverPause: autoplayHoverPause,
autoplayTimeout: sliderSpeed,
smartSpeed: sliderSpeedAnimation,
margin: margin,
stagePadding: stagePadding,
center: center,
autoWidth: autoWidth,
animateIn: animateInClass,
animateOut: animateOutClass,
dots: pagination,
dotsContainer: dotsContainer,
nav: navigation,
drag: drag,
callbacks: true,
navText: [
'<span class="edgtf-prev-icon ion-chevron-left"></span>',
'<span class="edgtf-next-icon ion-chevron-right"></span>'
],
onInitialize: function () {
slider.css('visibility', 'visible');
},
onDrag: function (e) {
if (edgtf.body.hasClass('edgtf-smooth-page-transitions-fadeout')) {
var sliderIsMoving = e.isTrigger > 0;
if (sliderIsMoving) {
slider.addClass('edgtf-slider-is-moving');
}
}
},
onDragged: function () {
if (edgtf.body.hasClass('edgtf-smooth-page-transitions-fadeout') && slider.hasClass('edgtf-slider-is-moving')) {
setTimeout(function () {
slider.removeClass('edgtf-slider-is-moving');
}, 500);
}
}
});
});
});
}
}
})(jQuery);