-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.min.js
1 lines (1 loc) · 2.04 KB
/
script.min.js
1
function sortModulesGrid(e){e.find(".modules-grid_item").sort((function(e,a){var t=$(e).attr("data-module-date"),n=$(a).attr("data-module-date");return new Date(t)-new Date(n)})).appendTo(e)}function sortTeachers(){var e=$(".course-team_people.teachers"),a=e.find(".person");a.sort((function(e,a){var t=$(e).find(".person_name").text().trim().toUpperCase(),n=$(a).find(".person_name").text().trim().toUpperCase();return t<n?-1:t>n?1:0})),e.empty().append(a)}$(document).ready((function(){var e=$("body").attr("data-page-slug"),a=window.location.pathname;"a-comida-na-boca-do-povo"===e?($('[data-menu-link="comunicacao"]').addClass("w--current"),$("body").removeClass("page-training").addClass("page-communication")):a.includes("formacao")?$('[data-menu-link="formacao"]').addClass("w--current"):a.includes("negocios")?$('[data-menu-link="negocios"]').addClass("w--current"):a.includes("comunicacao")?$('[data-menu-link="comunicacao"]').addClass("w--current"):a.includes("artigo")&&$('[data-menu-link="artigos"]').addClass("w--current");var t=$(".testimonials-slider");t.length&&t.find(".splide__list").length?new Splide(".testimonials-slider",{type:"loop",perPage:2,perMove:1,gap:"2rem",pagination:!1,breakpoints:{767:{perPage:1}}}).mount():$(".section_testimonials").remove();var n=$(".general-slider");n.length&&n.find(".splide__list").length&&new Splide(".general-slider",{type:"loop",perPage:4,perMove:1,gap:"2rem",pagination:!1,breakpoints:{767:{perPage:1}}}).mount();var o=$(".modules-grid");o.length&&sortModulesGrid(o);var r=$(".course-team_people.teachers");r.length&&sortTeachers(r),$(".tabs-menu .tab-link").on("click",(function(){var e=$(this),a=e.closest(".tabs-menu"),t=e.position().left,n=e.outerWidth(),o=a.width();t+n>o+a.scrollLeft()&&(t=t-o+n),a.animate({scrollLeft:t},300)})),$(".main-menu_button").on("click",(function(){$("body").toggleClass("no-scroll")}));var s=(new Date).getFullYear();$(".copyright-year").text(s),$(".section_related-courses .courses-list").length||($(".section_related-courses").next(".spacer").remove(),$(".section_related-courses").remove())}));