Fixed menu quirks

pull/636/head
Piero Toffanin 2019-03-19 18:25:12 -04:00
rodzic 97903a2648
commit 33ce263838
2 zmienionych plików z 14 dodań i 7 usunięć

Wyświetl plik

@ -81,7 +81,12 @@ a, a:hover, a:focus{
}
}
#navbar-top ul#side-menu a:hover, #navbar-top ul#side-menu a:focus{
#navbar-top ul#side-menu a:focus{
background-color: inherit;
color: inherit;
}
#navbar-top ul#side-menu a:hover, #navbar-top ul#side-menu a.active:hover{
background-color: theme("button_primary");
color: theme("secondary");
}

Wyświetl plik

@ -94,8 +94,8 @@ $(function(){
$('#side-menu').metisMenu();
$(window).bind("load resize", function() {
let topOffset = 50;
let width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
var topOffset = 50;
var width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
if (width < 768) {
$('div.navbar-collapse').addClass('collapse');
topOffset = 100; // 2-row-menu
@ -103,7 +103,7 @@ $(function(){
$('div.navbar-collapse').removeClass('collapse');
}
let height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
var height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
height = height - topOffset;
if (height < 1) height = 1;
if (height > topOffset) {
@ -111,18 +111,20 @@ $(function(){
}
});
let url = window.location;
let element = $('ul.nav a').filter(function() {
var url = window.location;
var element = $('ul.nav a').filter(function() {
return this.href == url;
}).addClass('active').parent();
while(true){
if (element.is('li')){
element = element.parent().addClass('in').parent();
element = element.parent().addClass('in');
} else {
break;
}
}
if (element.parent().is('li')) element.parent().addClass('active');
});
</script>