initial
This commit is contained in:
@@ -0,0 +1 @@
|
||||
@charset "UTF-8";@font-face{font-family:slick;src:url(fonts/slick.eot);src:url(fonts/slick.eot?#iefix) format("embedded-opentype"),url(fonts/slick.woff) format("woff"),url(fonts/slick.ttf) format("truetype"),url(fonts/slick.svg#slick) format("svg");font-weight:400;font-style:normal}.slick-next,.slick-prev{position:absolute;top:50%;display:block;padding:0;height:20px;width:20px;line-height:0;font-size:0;cursor:pointer;background:0 0;color:transparent;border:none;transform:translate(0,-50%)}.slick-next:focus .slick-next-icon,.slick-next:focus .slick-prev-icon,.slick-next:hover .slick-next-icon,.slick-next:hover .slick-prev-icon,.slick-prev:focus .slick-next-icon,.slick-prev:focus .slick-prev-icon,.slick-prev:hover .slick-next-icon,.slick-prev:hover .slick-prev-icon{opacity:1}.slick-next:focus,.slick-prev:focus{top:calc(50% - 1px)}.slick-next:focus .slick-next-icon,.slick-next:focus .slick-prev-icon,.slick-prev:focus .slick-next-icon,.slick-prev:focus .slick-prev-icon{color:orange;font-size:28px;margin-left:-2px}.slick-next.slick-disabled,.slick-prev.slick-disabled{cursor:default}.slick-next.slick-disabled .slick-next-icon,.slick-next.slick-disabled .slick-prev-icon,.slick-prev.slick-disabled .slick-next-icon,.slick-prev.slick-disabled .slick-prev-icon{opacity:.25}.slick-next .slick-next-icon,.slick-next .slick-prev-icon,.slick-prev .slick-next-icon,.slick-prev .slick-prev-icon{display:block;color:#000;opacity:.75;font-family:slick;font-size:24px;line-height:1}.slick-prev{left:-25px}[dir=rtl] .slick-prev{left:auto;right:-25px}.slick-prev .slick-prev-icon:before{content:"←"}[dir=rtl] .slick-prev .slick-prev-icon:before{content:"→"}.slick-next{right:-25px}[dir=rtl] .slick-next{left:-25px;right:auto}.slick-next .slick-next-icon:before{content:"→"}[dir=rtl] .slick-next .slick-next-icon:before{content:"←"}.slick-slider{margin-bottom:30px}.slick-slider.slick-dotted{margin-bottom:60px}.slick-dots{position:absolute;bottom:-30px;display:block;padding:0;margin:0;width:100%;list-style:none;text-align:center}.slick-dots li{position:relative;display:inline-block;margin:0 5px;padding:0}.slick-dots li button{display:block;height:20px;width:20px;margin-top:-4px;margin-left:-4px;line-height:0;font-size:0;color:transparent;border:0;background:0 0;cursor:pointer}.slick-dots li button:focus .slick-dot-icon,.slick-dots li button:hover .slick-dot-icon{opacity:1}.slick-dots li button:focus .slick-dot-icon:before{color:orange}.slick-dots li button .slick-dot-icon{color:#000;opacity:.25}.slick-dots li button .slick-dot-icon:before{position:absolute;top:0;left:0;content:"•";font-family:slick;font-size:12px;line-height:1;text-align:center;transition:all .05s linear}.slick-dots li.slick-active button:focus .slick-dot-icon{color:orange;opacity:1}.slick-dots li.slick-active button .slick-dot-icon{color:#000;opacity:1}.slick-dots li.slick-active button .slick-dot-icon:before{margin-top:-3px;margin-left:-2px;font-size:18px}.slick-sr-only{border:0!important;clip:rect(1px,1px,1px,1px)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}.slick-autoplay-toggle-button{position:absolute;left:5px;bottom:-32px;z-index:10;opacity:.75;background:0 0;border:0;cursor:pointer;color:#000}.slick-autoplay-toggle-button:focus,.slick-autoplay-toggle-button:hover{opacity:1}.slick-autoplay-toggle-button:focus{color:orange}.slick-autoplay-toggle-button .slick-pause-icon:before{content:"⏸";width:20px;height:20px;font-family:slick;font-size:18px;font-weight:400;line-height:20px;text-align:center}.slick-autoplay-toggle-button .slick-play-icon:before{content:"▶";width:20px;height:20px;font-family:slick;font-size:18px;font-weight:400;line-height:20px;text-align:center}
|
||||
@@ -0,0 +1 @@
|
||||
.slick-slider{position:relative;display:block;box-sizing:border-box;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.slick-list{position:relative;overflow:hidden;display:block;margin:0;padding:0}.slick-list:focus{outline:0}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-list,.slick-slider .slick-track{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.slick-track{position:relative;left:0;top:0;display:block;margin-left:auto;margin-right:auto}.slick-track:after,.slick-track:before{content:"";display:table}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{float:left;height:100%;min-height:1px;display:none}[dir=rtl] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-arrow.slick-hidden{display:none}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
|
||||
/*!
|
||||
* imagesLoaded PACKAGED v5.0.0
|
||||
* JavaScript is all like "You images are done yet or what?"
|
||||
* MIT License
|
||||
*/
|
||||
!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})),
|
||||
/*!
|
||||
* imagesLoaded v5.0.0
|
||||
* JavaScript is all like "You images are done yet or what?"
|
||||
* MIT License
|
||||
*/
|
||||
function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,390 @@
|
||||
jQuery(document).ready(function( $ ){
|
||||
|
||||
//Add landmark roles
|
||||
$('.elementor-location-header').attr('role', 'banner');
|
||||
$('.elementor-location-footer').attr('role', 'contentinfo');
|
||||
$('div[data-elementor-type=wp-page], div[data-elementor-type=wp-post], div[data-elementor-type=archive], div[data-elementor-type=single-post], div[data-elementor-type=error-404], div.pass-protected').attr('role', 'main').attr('id', 'main-content').attr('tabindex','-1');
|
||||
|
||||
$("#skiplink").click(function() {
|
||||
$('#main-content').focus();
|
||||
});
|
||||
|
||||
|
||||
// close mega menu when tabbing through a flyout and out onto the top level nav items
|
||||
jQuery(function($) {
|
||||
$('.mega-sub-menu').on('focusout', function(e) {
|
||||
e.preventDefault();
|
||||
if (!$(this).has(event.relatedTarget).length && !$(this).is(event.relatedTarget)) {
|
||||
// Focus has moved outside the menu, so close it
|
||||
$('.max-mega-menu').data('maxmegamenu').hideAllPanels();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// make svg invisible to SR
|
||||
$('.elementor-icon-list-icon svg, svg.e-font-icon-svg').attr('role','presentation').attr('tabindex','-1');
|
||||
|
||||
// Add aria-labels to roles
|
||||
$('.utility nav').attr('aria-label', 'Utility');
|
||||
$('.mainNav nav').attr('aria-label', 'Global');
|
||||
$('.footer nav').attr('aria-label', 'Footer');
|
||||
|
||||
// Add title text for Read More links for posts
|
||||
$('.news .jet-listing-grid__item').each(function () {
|
||||
var title = $('.title .elementor-heading-title a', this).html();
|
||||
var viewDetails = $('.link a', this);
|
||||
$(viewDetails).append('<span class="visuallyhidden"> about ' +title+ '</span>');
|
||||
});
|
||||
|
||||
// Add title text for Read More links
|
||||
$('.hidden-text .elementor-column').each(function () {
|
||||
var title = $('.title .elementor-heading-title', this).html();
|
||||
var viewDetails = $('.link a', this);
|
||||
$(viewDetails).append('<span class="visuallyhidden"> for ' +title+ '</span>');
|
||||
});
|
||||
|
||||
// Remove role Button
|
||||
$('.elementor-button-link').removeAttr('role', 'button');
|
||||
|
||||
|
||||
// Announcer
|
||||
//Move Banner Top to below skip link in the DOM
|
||||
var banner = $(".ancr-group.ancr-pos-top")
|
||||
$(banner).insertAfter('.elementor-location-header #skiplink');
|
||||
//Move bottom Banners to footer in the DOM
|
||||
var bannerBottom = $(".ancr-group.ancr-pos-bottom")
|
||||
$("div[data-elementor-type=footer]").prepend(bannerBottom);
|
||||
//Move Banner close button in the DOM
|
||||
$('.ancr-wrap').each(function() {
|
||||
var $this = $(this),
|
||||
$closeBtn = $this.find('.ancr-close-btn'),
|
||||
$target = $this.find('.ancr-content');
|
||||
$target.append($closeBtn);
|
||||
});
|
||||
|
||||
// Accordion accessibility (New)
|
||||
$('div.e-n-accordion').removeAttr('aria-label');
|
||||
$('details div').removeAttr('role').removeAttr('aria-labelledby');
|
||||
$('details summary').removeAttr('tabindex');
|
||||
|
||||
// Add id and for to News/Blog Search
|
||||
$(".search .jet-filter-label").replaceWith(function(){
|
||||
$(this).attr('for', 'search');
|
||||
return this.outerHTML.replace("<div", "<label").replace("</div", "</label")
|
||||
});
|
||||
$('.search .jet-search-filter__input').attr('id', 'search');
|
||||
|
||||
// Add aria-label to Search button
|
||||
$('.search .jet-search-filter__submit').attr('aria-label', 'Search')
|
||||
|
||||
|
||||
// Click enter in input field to click button search for redirect jetsmartfilter
|
||||
$( document ).ready(function() {
|
||||
$('.jet-search-filter__input').keyup(function(event) {
|
||||
if (event.which === 13) {
|
||||
$(this).parents(".elementor-widget-jet-smart-filters-search").siblings().find(".apply-filters__button").click()
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Add keyboard access to pagination
|
||||
$( document ).ready(function() {
|
||||
$('.jet-filters-pagination__link').attr('tabindex', 0);
|
||||
$('.jet-filters-pagination__item').removeAttr('tabindex');
|
||||
|
||||
$('.jet-filters-pagination__link').keyup(function(event) {
|
||||
if (event.which === 13) {
|
||||
$(this).click();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Aria for Checkbox Filters
|
||||
$( document ).ready(function() {
|
||||
$('.filter.multi .jet-filters-group .jet-filter').each(function (i) {
|
||||
var identifier = 0 + i;
|
||||
var group = $(this);
|
||||
var label = $('.jet-filter-label', this);
|
||||
$(group).attr('role', 'group').attr('aria-labelledby', 'filter-heading' + identifier)
|
||||
$(label).attr('id', 'filter-heading' + identifier)
|
||||
});
|
||||
|
||||
|
||||
$('.filter:not(.multi) .jet-filter').attr('role', 'group').attr('aria-labelledby', 'filter-heading');
|
||||
|
||||
$('.filter:not(.multi) .jet-filter-label').attr('id', 'filter-heading');
|
||||
|
||||
$('.filter .jet-checkboxes-list__input, .filter .jet-radio-list__input').attr('aria-checked', 'false');
|
||||
|
||||
$('.filter .jet-checkboxes-list__input, .filter .jet-radio-list__input').click(function() {
|
||||
if ($(this).attr('aria-checked') == "false") {
|
||||
$(this).attr("aria-checked","true");
|
||||
}
|
||||
else {
|
||||
$(this).attr("aria-checked", "false");
|
||||
}
|
||||
});
|
||||
|
||||
$('.filter .jet-checkboxes-list__input, .filter .jet-radio-list__input').keyup(function(event) {
|
||||
if (event.which === 13) {
|
||||
$(this).click();
|
||||
}
|
||||
});
|
||||
|
||||
$('.filter .jet-filter-row').each(function (i) {
|
||||
var identifier = 0 + i;
|
||||
var label = $('.jet-checkboxes-list__item, .jet-radio-list__input', this);
|
||||
var checkbox = $('.jet-checkboxes-list__input, .jet-radio-list__input', this);
|
||||
$(label).attr('for', 'checkbox' + identifier)
|
||||
$(checkbox).attr('id', 'checkbox' + identifier)
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
// Keyboard navigtion for Active filters
|
||||
// Need to add a mutation observer to look for changes
|
||||
// when filter is selected. .jet-active-filter is not
|
||||
// in the DOM on page load only after filter selection
|
||||
var targetNodes = $(".jet-active-filters");
|
||||
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
||||
var myObserver = new MutationObserver(mutationHandler);
|
||||
var obsConfig = {
|
||||
childList: true,
|
||||
characterData: true,
|
||||
attributes: true,
|
||||
subtree: true
|
||||
};
|
||||
|
||||
//--- Add a target node to the observer. Can only add one node at a time.
|
||||
targetNodes.each(function() {
|
||||
myObserver.observe(this, obsConfig);
|
||||
});
|
||||
|
||||
function mutationHandler(mutationRecords) {
|
||||
mutationRecords.forEach(function(mutation) {
|
||||
if (typeof mutation.removedNodes == "object") {
|
||||
var jq = $(mutation.removedNodes);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
$('.jet-active-filter').attr('tabindex', 0);
|
||||
$('.jet-active-filter').keyup(function(event) {
|
||||
if (event.which === 13) {
|
||||
$(this).click();
|
||||
}
|
||||
});
|
||||
},1000)
|
||||
// End mutation observer
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#checkboxes, #radio").replaceWith(function(){
|
||||
return this.outerHTML.replace("<span", "<fieldset").replace("</span", "</fieldset")
|
||||
});
|
||||
});
|
||||
|
||||
var selected = [];
|
||||
$('input[type=checkbox], input[type=radio]').each(function() {
|
||||
var value = $(this).val();
|
||||
var name = $(this).attr('name').replace(/ /g,'').replace(/[^a-z0-9\s]/gi, '');
|
||||
var id = value.replace(/ /g,'').replace(/[^a-z0-9\s]/gi, '');
|
||||
$(this).attr({ id: $(this).attr("id") + ' ' +id });
|
||||
var newId = $(this).attr('id');
|
||||
$(this).siblings('label').attr('for', newId);
|
||||
|
||||
});
|
||||
|
||||
// Refreshes carousels inside tab widgets
|
||||
var refreshSliders = function(){
|
||||
jQuery( ".swiper-container" ).each(function( index ) {
|
||||
swiperInstance = jQuery(this).data('swiper');
|
||||
swiperInstance.params.observer = true;
|
||||
swiperInstance.params.observeParents = true;
|
||||
swiperInstance.update();
|
||||
});
|
||||
}
|
||||
window.onload = function() {
|
||||
jQuery(".elementor-tab-title").on("click", function(){
|
||||
var $this = jQuery(this);
|
||||
refreshSliders();
|
||||
jQuery('html,body').animate({
|
||||
scrollTop: $this.offset().top - 220
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
// Carousel refresh inside tab widgets
|
||||
|
||||
//Update Tabbing of Tabs
|
||||
|
||||
$(function($) {
|
||||
$('.elementor-tabs .elementor-tab-title a').replaceWith(function(){
|
||||
$(this).removeAttr('href');
|
||||
return this.outerHTML.replace("<a", "<h3").replace("</a", "</h3")
|
||||
});
|
||||
});
|
||||
|
||||
$('.elementor-tabs .elementor-tab-title').attr('tabindex', 0);
|
||||
$('.elementor-tabs .elementor-tab-content').attr('tabindex', -1);
|
||||
|
||||
if ($(window).width() < 500) {
|
||||
|
||||
// Close Tab widget on mobile on page load
|
||||
const delay = 10;
|
||||
setTimeout(function() {
|
||||
$('.elementor-tab-title').removeClass('elementor-active');
|
||||
$('.elementor-tab-content').css('display', 'none');
|
||||
}, delay);
|
||||
}
|
||||
|
||||
// Anchor scroll offset top
|
||||
$('a[href*="#"]:not([href="#"])').click(function() {
|
||||
var offset = -200; // <-- change the value here
|
||||
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
|
||||
var target = $(this.hash);
|
||||
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
|
||||
if (target.length) {
|
||||
$('html, body').animate({
|
||||
scrollTop: target.offset().top + offset
|
||||
}, 300);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Hide and Show header search form
|
||||
$('.openSearch').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('.closeSearch, #searchForm').removeClass("hide");
|
||||
$('.openSearch, .util-nav').addClass("hide");
|
||||
setTimeout(function() {
|
||||
$('#search-59bc91d').focus();
|
||||
}, 100);
|
||||
});
|
||||
$('.closeSearch').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('.closeSearch, #searchForm').addClass("hide");
|
||||
$('.openSearch, .uti-nav').removeClass("hide");
|
||||
setTimeout(function() {
|
||||
$('.openSearch a').focus();
|
||||
}, 100);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
/* Code from https://element.how/elementor-tabs-closed-by-default/
|
||||
* Copyright 2024 Element.How
|
||||
* Automatically close the tabs on page load for mobile devices
|
||||
*/
|
||||
window.addEventListener('load', function () {
|
||||
if (window.innerWidth > 767) return;
|
||||
setTimeout(function () {
|
||||
let tabsElems = document.querySelectorAll('.e-n-tabs')
|
||||
tabsElems.forEach(e => {
|
||||
let activeTitles = e.querySelectorAll('.e-n-tab-title[aria-selected="true"]');
|
||||
let activeContent = e.querySelector('.e-con.e-active')
|
||||
activeContent.style.display = 'none';
|
||||
activeContent.classList.remove('e-active');
|
||||
activeTitles.forEach(activeTitle => activeTitle.setAttribute('aria-selected', false));
|
||||
activeTitles.forEach(activeTitle => activeTitle.setAttribute('tabindex', -1));
|
||||
});
|
||||
}, 300);
|
||||
});
|
||||
|
||||
/* Code from https://element.how/elementor-tabs-closed-by-default/
|
||||
* Copyright 2024 Element.How
|
||||
* Make the Elementor tabs closable
|
||||
*/
|
||||
(function () {
|
||||
if (window.innerWidth > 767) return;
|
||||
let isOnPageLoad = true;
|
||||
window.addEventListener('load', () => {
|
||||
setTimeout(() => {
|
||||
isOnPageLoad = false;
|
||||
}, 600);
|
||||
});
|
||||
if (document.querySelector('.elementor-editor-active')) return;
|
||||
document.querySelectorAll('.e-n-tab-title').forEach(tabTitle => {
|
||||
tabTitle.addEventListener('click', function () {
|
||||
if (isOnPageLoad) return;
|
||||
if (this.getAttribute('aria-selected') === 'true') {
|
||||
setTimeout(() => {
|
||||
const tabId = this.getAttribute('aria-controls');
|
||||
const tabContent = document.getElementById(tabId);
|
||||
if (tabContent) {
|
||||
tabContent.style.display = 'none';
|
||||
tabContent.classList.remove('e-active');
|
||||
}
|
||||
this.setAttribute('aria-selected', 'false');
|
||||
}, 30);
|
||||
}
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
|
||||
|
||||
/* Control the Elementor Tabs from the URL
|
||||
* Code from https://element.how/elementor-open-specific-tab-toggle-accordion/
|
||||
* Copyright 2023 Element.how
|
||||
* Updated 2023/12/05
|
||||
*/
|
||||
window.addEventListener('load', () => {
|
||||
setTimeout(function () {
|
||||
|
||||
let scrollOffset = 200; /* scroll offset from the top of title */
|
||||
|
||||
const tabsAccordionToggleTitles = document.querySelectorAll('.e-n-accordion-item-title, .e-n-tab-title, .elementor-tab-title');
|
||||
|
||||
const clickTitleWithAnchor = (anchor) => {
|
||||
tabsAccordionToggleTitles.forEach(title => {
|
||||
if (title.querySelector(`#${anchor}`) != null || title.id === anchor || (title.closest('details') && title.closest('details').id === anchor)) {
|
||||
if (title.getAttribute('aria-expanded') !== 'true' && !title.classList.contains('elementor-active')) title.click();
|
||||
let timing = 0;
|
||||
let scrollTarget = title;
|
||||
if (getComputedStyle(title.closest('.elementor-element')).getPropertyValue('--n-tabs-direction') == 'row') scrollTarget = title.closest('.elementor-element');
|
||||
if (title.closest('.e-n-accordion, .elementor-accordion-item, .elementor-toggle-item')) {
|
||||
timing = 400;
|
||||
}
|
||||
setTimeout(function () {
|
||||
jQuery('html, body').animate({
|
||||
scrollTop: jQuery(scrollTarget).offset().top - scrollOffset,
|
||||
}, 'slow');
|
||||
}, timing);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
if (event.target.closest('a') && event.target.closest('a').href.includes('#')) {
|
||||
const anchor = extractAnchor(event.target.closest('a').href);
|
||||
if (anchor && isAnchorInTitles(anchor, tabsAccordionToggleTitles)) {
|
||||
event.preventDefault();
|
||||
clickTitleWithAnchor(anchor);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const currentAnchor = extractAnchor(window.location.href);
|
||||
if (currentAnchor) {
|
||||
clickTitleWithAnchor(currentAnchor);
|
||||
}
|
||||
|
||||
function extractAnchor(url) {
|
||||
const match = url.match(/#([^?]+)/);
|
||||
return match ? match[1] : null;
|
||||
};
|
||||
|
||||
function isAnchorInTitles(anchor, titles) {
|
||||
return Array.from(titles).some(title => {
|
||||
return title.querySelector(`#${anchor}`) !== null || title.id === anchor || (title.closest('details') && title.closest('details').id === anchor);
|
||||
});
|
||||
};
|
||||
|
||||
}, 300);
|
||||
});
|
||||
Reference in New Issue
Block a user