From 483c6f17be55f7dae59fb007bca5364033b3ba79 Mon Sep 17 00:00:00 2001 From: Philipp Seibt Date: Fri, 15 Mar 2024 11:37:48 +0100 Subject: [PATCH] fix search icon bug; change search box styling --- CHANGELOG.md | 5 +++++ public/js/theme.js | 3 ++- public/js/theme.min.js | 2 +- public/sass/style.scss | 10 ++++++---- src/Module/MateThemeSetup.php | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6835133..fa76649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ Types of changes Security in case of vulnerabilities. ) +## [3.3.2](https://github.com/contao-themes-net/mate-theme-bundle/tree/3.3.2) – 2024-03-15 + +- [Fixed] Click on header search icon starts reload of start page ([#183](https://github.com/contao-themes-net/mate-theme-bundle/issues/183)) +- [Changed] Change search box styling + ## [3.3.1](https://github.com/contao-themes-net/mate-theme-bundle/tree/3.3.1) – 2024-02-26 - [Fixed] Fix select field validation diff --git a/public/js/theme.js b/public/js/theme.js index b2adf18..8a75110 100644 --- a/public/js/theme.js +++ b/public/js/theme.js @@ -176,7 +176,7 @@ jQuery(document).ready(function ($) { /* ===================== * * Suche * * ====================== */ - $(".search a").click(function () { + $(".search a").click(function (e) { if ($('.search-box').hasClass("active")) { $('.search-box').removeClass('active'); $('div').remove('.overlay'); @@ -184,6 +184,7 @@ jQuery(document).ready(function ($) { $('.search-box').addClass('active'); $('body').append('
'); } + e.preventDefault(); }); $(document).click(function (event) { diff --git a/public/js/theme.min.js b/public/js/theme.min.js index 7eff0fe..0f4db7a 100644 --- a/public/js/theme.min.js +++ b/public/js/theme.min.js @@ -1 +1 @@ -function is_touch_device(){return!!("ontouchstart"in window||navigator.maxTouchPoints)}jQuery(document).ready(function($){$("select").formSelect();var lang=$("html").attr("lang");var translations={nextMonth:"Next month",previousMonth:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"],today:"Today",clear:"Clear",done:"OK",cancel:"Cancel",format:"yyyy-mm-dd"};switch(lang){case"de":var translations={nextMonth:"Nächster Monat",previousMonth:"Vorheriger Monat",labelMonthSelect:"Monat wählen",labelYearSelect:"Jahr wählen",months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],weekdaysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],weekdaysAbbrev:["S","M","D","M","D","F","S"],today:"Heute",clear:"Löschen",done:"OK",cancel:"Abbrechen",format:"dd.mm.yyyy"};break;case"fr":var translations={nextMonth:"Mois suivant",previousMonth:"Mois précédent",labelMonthSelect:"Sélectionnez un mois",labelYearSelect:"Sélectionnez une année",months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Decembre"],monthsShort:["Jan","Fev","Mar","Avr","Mai","Jun","Jul","Aou","Sep","Oct","Nov","Dec"],weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekdaysShort:["Di","Lu","Ma","Me","Je","Ve","Sa"],weekdaysAbbrev:["D","L","M","M","J","V","S"],today:"Aujourd'hui",clear:"Réinitialiser",done:"OK",cancel:"Annuler",format:"dd/mm/yyyy"};break;case"pl":var translations={nextMonth:"W przyszłym miesiącu",previousMonth:"Poprzedni miesiąc",labelMonthSelect:"Wybierz miesiąc",labelYearSelect:"Wybierz rok",months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paz","Lis","Gru"],weekdays:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],weekdaysShort:["Nie","Pon","Wto","Sro","Czw","Pia","Sob"],weekdaysAbbrev:["N","P","W","S","C","P","S"],today:"Dziś",clear:"Jasne",done:"OK",cancel:"Anuluj",format:"dd.mm.yyyy"};break}$("input.datepicker").datepicker({selectMonths:true,selectYears:"150",maxDate:new Date((new Date).getFullYear()+30,(new Date).getMonth(),(new Date).getDate()),autoClose:true,format:translations.format,container:"div.datepicker",firstDay:1,yearRange:[1900,(new Date).getFullYear()+30],i18n:{nextMonth:translations.nextMonth,previousMonth:translations.previousMonth,labelMonthSelect:translations.labelMonthSelect,labelYearSelect:translations.labelYearSelect,months:translations.months,monthsShort:translations.monthsShort,weekdays:translations.weekdays,weekdaysShort:translations.weekdaysShort,weekdaysAbbrev:translations.weekdaysAbbrev,today:translations.today,clear:translations.clear,done:translations.done,cancel:translations.cancel}});$("input.timepicker").timepicker({defaultTime:"now",fromNow:0,twelveHour:false,autoClose:false,container:"div.timepicker",i18n:{cancel:translations.cancel,clear:translations.clear,done:translations.done}});$(".slides .content-text, .slides .ce_image, .slides .ce_mateTextBackgroundElement, .slides .content-youtube, .slides .content-player").each(function(index){var classList=$(this).attr("class");var id="";if(typeof $(this).attr("id")!=="undefined"){var id=" id='"+$(this).attr("id")+"'"}$(this).replaceWith("
  • "+$(this).html()+"
  • ")});if($(".slider-text-below-image li").length>0){$(".slider-text-below-image li").each(function(){var headline=$(this).find("> h2, > h3, > h4, > h5, > h6").html();var index=$(this).index()+1;var slider=$(this).closest(".slider-text-below-image");setTimeout(function(){slider.find(".indicators li:nth-of-type("+index+")").html(headline)},100)});setSliderHeight();$(window).resize(function(){setSliderHeight()})}function setSliderHeight(){var height=0;var imageHeight,textHeight,elemHeight;$(".slider-text-below-image li").each(function(){imageHeight=$(this).find("img").height();textHeight=$(this).find("p").outerHeight();elemHeight=imageHeight+textHeight;if(elemHeight>height){height=elemHeight}});setTimeout(function(){$(".slider-text-below-image, .slider-text-below-image .slides").css("min-height",height+"px")},100)}$(".search a").click(function(){if($(".search-box").hasClass("active")){$(".search-box").removeClass("active");$("div").remove(".overlay")}else{$(".search-box").addClass("active");$("body").append('
    ')}});$(document).click(function(event){if($(event.target).closest(".overlay").length){$(".search-box").removeClass("active");$("div").remove(".overlay")}});$(window).scroll(function(){if($(".mod_mateNavbar").hasClass("headroom--unpinned")){$(".search-box").removeClass("active");$("div").remove(".overlay")}});var scrollTarget=$("#header .mod_mateNavbar").offset().top;if($("#header .mod_mateNavbar").hasClass("stuckNavbar")){var navbarHeight=$("#header .mod_mateNavbar").height();$(window).scroll(function(){var scrollPos=$(window).scrollTop();if(scrollPos>scrollTarget){$("#header").css("padding-top",navbarHeight+"px");$(".sectionTop").css("visibility","hidden");$("#header .mod_mateNavbar, #header .search-box").addClass("stuck")}else{$("#header").css("padding-top","0");$(".sectionTop").css("visibility","visible");$("#header .mod_mateNavbar, #header .search-box").removeClass("stuck")}})}if($("#header .mod_mateNavbar").hasClass("includeHeadroom")){var myElement=document.querySelector("#header .mod_mateNavbar");var headroom=new Headroom(myElement,{offset:600});headroom.init()}$(".sidenav").sidenav();$("nav:not(.subnav) .desktop-menu a.dropdown-button").dropdown({inDuration:300,outDuration:225,hover:true,coverTrigger:false,alignment:"left",constrainWidth:false,closeOnClick:false});$("nav:not(.subnav) .desktop-menu ul.dropdown-content a.dropdown-button").dropdown({inDuration:300,outDuration:225,hover:false,coverTrigger:false,alignment:"left",constrainWidth:false,closeOnClick:false});$("nav:not(.subnav) .desktop-menu ul.dropdown-content ul.dropdown-content a.dropdown-button").dropdown({inDuration:300,outDuration:225,hover:false,coverTrigger:false,alignment:"left",constrainWidth:false,closeOnClick:false});$(".dropdown-button").click(function(){$(".dropdown-content .dropdown-content").hide();if(!$(this).hasClass("stopPropagation"))window.location.href=$(this).attr("href")});$(document).on("touchstart","body",function(e){$("a.dropdown-button").removeClass("touch-active")});$("nav:not(.subnav)").on("touchstart",".dropdown-content a",function(e){e.stopPropagation()});$("nav:not(.subnav)").on("touchstart","a.dropdown-button",function(e){$("a.dropdown-button").removeClass("touch-active");if($(this).hasClass("open")){window.location.href=$(this).attr("href")}if($(this).parents().parents().hasClass("desktop-menu")){$("a.dropdown-button").removeClass("open")}$(this).addClass("touch-active");$(this).closest(".dropdown-content").prev().addClass("touch-active");$(this).closest("ul").parents().parents().prev().addClass("touch-active");$(this).toggleClass("open");e.preventDefault();e.stopPropagation()});$("nav:not(.subnav) .mobile-menu a.dropdown-button").dropdown({inDuration:300,outDuration:225,hover:false,coverTrigger:false,alignment:"left"});$("nav.subnav a.dropdown-button").dropdown({inDuration:0,outDuration:0,alignment:"right",closeOnClick:false,hover:false});$("nav.subnav a.dropdown-button").click(function(){window.location.href=$(this).attr("href")});$(window).scroll(function(){scrollPos=$(document).scrollTop();$("footer .toplink").addClass("active");if(scrollPos<=500){$("footer .toplink").removeClass("active")}});$(document).on("click","footer .toplink:not(.custom)",function(event){event.preventDefault();$("html, body").animate({scrollTop:0},1e3)});$("a[href*=\\#]:not(.modal-trigger):not(.toplink)").on("click",function(event){var href=$(this).attr("href");if(href!=="#"&&href!==""){if(href.indexOf("tabControl_")<0){href=href.substr(0,href.indexOf("#"));href=href.replace("./","");var path=window.location.pathname;path=path.replace("/","");if($(this).attr("target")!="_blank"&&path==href){event.preventDefault();$("html,body").animate({scrollTop:$(this.hash).offset().top-80},1500)}}else{setTimeout(function(){var tabControlId=href.substr(href.indexOf("#"));$("html,body").animate({scrollTop:$(tabControlId).offset().top-150},1500)},200)}}});$("select[required]").css({display:"inline",position:"absolute",float:"left",padding:0,margin:0,border:"1px solid rgba(255,255,255,0)",height:0,width:0,top:"40px",left:"50%"});$(".modal").modal();$(".close-modal i").click(function(){$(".modal").modal("close")});$(".parallax").parallax()}); \ No newline at end of file +function is_touch_device(){return!!("ontouchstart"in window||navigator.maxTouchPoints)}jQuery(document).ready(function($){$("select").formSelect();var lang=$("html").attr("lang");var translations={nextMonth:"Next month",previousMonth:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"],today:"Today",clear:"Clear",done:"OK",cancel:"Cancel",format:"yyyy-mm-dd"};switch(lang){case"de":var translations={nextMonth:"Nächster Monat",previousMonth:"Vorheriger Monat",labelMonthSelect:"Monat wählen",labelYearSelect:"Jahr wählen",months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],weekdaysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],weekdaysAbbrev:["S","M","D","M","D","F","S"],today:"Heute",clear:"Löschen",done:"OK",cancel:"Abbrechen",format:"dd.mm.yyyy"};break;case"fr":var translations={nextMonth:"Mois suivant",previousMonth:"Mois précédent",labelMonthSelect:"Sélectionnez un mois",labelYearSelect:"Sélectionnez une année",months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Decembre"],monthsShort:["Jan","Fev","Mar","Avr","Mai","Jun","Jul","Aou","Sep","Oct","Nov","Dec"],weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekdaysShort:["Di","Lu","Ma","Me","Je","Ve","Sa"],weekdaysAbbrev:["D","L","M","M","J","V","S"],today:"Aujourd'hui",clear:"Réinitialiser",done:"OK",cancel:"Annuler",format:"dd/mm/yyyy"};break;case"pl":var translations={nextMonth:"W przyszłym miesiącu",previousMonth:"Poprzedni miesiąc",labelMonthSelect:"Wybierz miesiąc",labelYearSelect:"Wybierz rok",months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paz","Lis","Gru"],weekdays:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],weekdaysShort:["Nie","Pon","Wto","Sro","Czw","Pia","Sob"],weekdaysAbbrev:["N","P","W","S","C","P","S"],today:"Dziś",clear:"Jasne",done:"OK",cancel:"Anuluj",format:"dd.mm.yyyy"};break}$("input.datepicker").datepicker({selectMonths:true,selectYears:"150",maxDate:new Date((new Date).getFullYear()+30,(new Date).getMonth(),(new Date).getDate()),autoClose:true,format:translations.format,container:"div.datepicker",firstDay:1,yearRange:[1900,(new Date).getFullYear()+30],i18n:{nextMonth:translations.nextMonth,previousMonth:translations.previousMonth,labelMonthSelect:translations.labelMonthSelect,labelYearSelect:translations.labelYearSelect,months:translations.months,monthsShort:translations.monthsShort,weekdays:translations.weekdays,weekdaysShort:translations.weekdaysShort,weekdaysAbbrev:translations.weekdaysAbbrev,today:translations.today,clear:translations.clear,done:translations.done,cancel:translations.cancel}});$("input.timepicker").timepicker({defaultTime:"now",fromNow:0,twelveHour:false,autoClose:false,container:"div.timepicker",i18n:{cancel:translations.cancel,clear:translations.clear,done:translations.done}});$(".slides .content-text, .slides .ce_image, .slides .ce_mateTextBackgroundElement, .slides .content-youtube, .slides .content-player").each(function(index){var classList=$(this).attr("class");var id="";if(typeof $(this).attr("id")!=="undefined"){var id=" id='"+$(this).attr("id")+"'"}$(this).replaceWith("
  • "+$(this).html()+"
  • ")});if($(".slider-text-below-image li").length>0){$(".slider-text-below-image li").each(function(){var headline=$(this).find("> h2, > h3, > h4, > h5, > h6").html();var index=$(this).index()+1;var slider=$(this).closest(".slider-text-below-image");setTimeout(function(){slider.find(".indicators li:nth-of-type("+index+")").html(headline)},100)});setSliderHeight();$(window).resize(function(){setSliderHeight()})}function setSliderHeight(){var height=0;var imageHeight,textHeight,elemHeight;$(".slider-text-below-image li").each(function(){imageHeight=$(this).find("img").height();textHeight=$(this).find("p").outerHeight();elemHeight=imageHeight+textHeight;if(elemHeight>height){height=elemHeight}});setTimeout(function(){$(".slider-text-below-image, .slider-text-below-image .slides").css("min-height",height+"px")},100)}$(".search a").click(function(e){if($(".search-box").hasClass("active")){$(".search-box").removeClass("active");$("div").remove(".overlay")}else{$(".search-box").addClass("active");$("body").append('
    ')}e.preventDefault()});$(document).click(function(event){if($(event.target).closest(".overlay").length){$(".search-box").removeClass("active");$("div").remove(".overlay")}});$(window).scroll(function(){if($(".mod_mateNavbar").hasClass("headroom--unpinned")){$(".search-box").removeClass("active");$("div").remove(".overlay")}});var scrollTarget=$("#header .mod_mateNavbar").offset().top;if($("#header .mod_mateNavbar").hasClass("stuckNavbar")){var navbarHeight=$("#header .mod_mateNavbar").height();$(window).scroll(function(){var scrollPos=$(window).scrollTop();if(scrollPos>scrollTarget){$("#header").css("padding-top",navbarHeight+"px");$(".sectionTop").css("visibility","hidden");$("#header .mod_mateNavbar, #header .search-box").addClass("stuck")}else{$("#header").css("padding-top","0");$(".sectionTop").css("visibility","visible");$("#header .mod_mateNavbar, #header .search-box").removeClass("stuck")}})}if($("#header .mod_mateNavbar").hasClass("includeHeadroom")){var myElement=document.querySelector("#header .mod_mateNavbar");var headroom=new Headroom(myElement,{offset:600});headroom.init()}$(".sidenav").sidenav();$("nav:not(.subnav) .desktop-menu a.dropdown-button").dropdown({inDuration:300,outDuration:225,hover:true,coverTrigger:false,alignment:"left",constrainWidth:false,closeOnClick:false});$("nav:not(.subnav) .desktop-menu ul.dropdown-content a.dropdown-button").dropdown({inDuration:300,outDuration:225,hover:false,coverTrigger:false,alignment:"left",constrainWidth:false,closeOnClick:false});$("nav:not(.subnav) .desktop-menu ul.dropdown-content ul.dropdown-content a.dropdown-button").dropdown({inDuration:300,outDuration:225,hover:false,coverTrigger:false,alignment:"left",constrainWidth:false,closeOnClick:false});$(".dropdown-button").click(function(){$(".dropdown-content .dropdown-content").hide();if(!$(this).hasClass("stopPropagation"))window.location.href=$(this).attr("href")});$(document).on("touchstart","body",function(e){$("a.dropdown-button").removeClass("touch-active")});$("nav:not(.subnav)").on("touchstart",".dropdown-content a",function(e){e.stopPropagation()});$("nav:not(.subnav)").on("touchstart","a.dropdown-button",function(e){$("a.dropdown-button").removeClass("touch-active");if($(this).hasClass("open")){window.location.href=$(this).attr("href")}if($(this).parents().parents().hasClass("desktop-menu")){$("a.dropdown-button").removeClass("open")}$(this).addClass("touch-active");$(this).closest(".dropdown-content").prev().addClass("touch-active");$(this).closest("ul").parents().parents().prev().addClass("touch-active");$(this).toggleClass("open");e.preventDefault();e.stopPropagation()});$("nav:not(.subnav) .mobile-menu a.dropdown-button").dropdown({inDuration:300,outDuration:225,hover:false,coverTrigger:false,alignment:"left"});$("nav.subnav a.dropdown-button").dropdown({inDuration:0,outDuration:0,alignment:"right",closeOnClick:false,hover:false});$("nav.subnav a.dropdown-button").click(function(){window.location.href=$(this).attr("href")});$(window).scroll(function(){scrollPos=$(document).scrollTop();$("footer .toplink").addClass("active");if(scrollPos<=500){$("footer .toplink").removeClass("active")}});$(document).on("click","footer .toplink:not(.custom)",function(event){event.preventDefault();$("html, body").animate({scrollTop:0},1e3)});$("a[href*=\\#]:not(.modal-trigger):not(.toplink)").on("click",function(event){var href=$(this).attr("href");if(href!=="#"&&href!==""){if(href.indexOf("tabControl_")<0){href=href.substr(0,href.indexOf("#"));href=href.replace("./","");var path=window.location.pathname;path=path.replace("/","");if($(this).attr("target")!="_blank"&&path==href){event.preventDefault();$("html,body").animate({scrollTop:$(this.hash).offset().top-80},1500)}}else{setTimeout(function(){var tabControlId=href.substr(href.indexOf("#"));$("html,body").animate({scrollTop:$(tabControlId).offset().top-150},1500)},200)}}});$("select[required]").css({display:"inline",position:"absolute",float:"left",padding:0,margin:0,border:"1px solid rgba(255,255,255,0)",height:0,width:0,top:"40px",left:"50%"});$(".modal").modal();$(".close-modal i").click(function(){$(".modal").modal("close")});$(".parallax").parallax()}); \ No newline at end of file diff --git a/public/sass/style.scss b/public/sass/style.scss index 2e78090..5ad1b9f 100644 --- a/public/sass/style.scss +++ b/public/sass/style.scss @@ -385,7 +385,7 @@ code, pre { font-size: 1em; } -.content-list, .content-text { +.content-list, .content-text, .accordion { ul:not(.browser-default) { padding-left: 0; @@ -409,7 +409,7 @@ code, pre { @extend .content-list; } -.content-list, .content-text { +.content-list, .content-text, .accordion { ol { padding-left: 15px; } @@ -846,7 +846,8 @@ header { background: $navbar-bg-color; border: none; text-align: center; - padding: 40px; + padding: 20px; + border-top: 1px solid $mateColor6; } .submit { @@ -863,7 +864,7 @@ header { } .widget-text { - width: 50%; + max-width: 400px; display: inline-block; float: none; vertical-align: top; @@ -4302,6 +4303,7 @@ div.klaro { width: 70%; margin-right: 0; float: left; + max-width: inherit; } .widget-submit { diff --git a/src/Module/MateThemeSetup.php b/src/Module/MateThemeSetup.php index 56c28d3..5384f58 100644 --- a/src/Module/MateThemeSetup.php +++ b/src/Module/MateThemeSetup.php @@ -23,7 +23,7 @@ class MateThemeSetup extends BackendModule { - public const VERSION = '3.3.1'; + public const VERSION = '3.3.2'; protected $strTemplate = 'be_mateTheme_setup';