kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fixed menu quirks
rodzic
97903a2648
commit
33ce263838
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Ładowanie…
Reference in New Issue