mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Fix JS issues with our new menu
This commit is contained in:
parent
544e92ac4a
commit
459768ba4e
@ -117,19 +117,24 @@
|
|||||||
* @param url {String} The url to match
|
* @param url {String} The url to match
|
||||||
*/
|
*/
|
||||||
Navigation.prototype.setActiveByUrl = function(url) {
|
Navigation.prototype.setActiveByUrl = function(url) {
|
||||||
|
var $menu = $('#menu');
|
||||||
|
|
||||||
|
if (! $menu.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// try to active the first item that has an exact URL match
|
// try to active the first item that has an exact URL match
|
||||||
this.setActive(this.$menu.find('[href="' + url + '"]'));
|
this.setActive($menu.find('[href="' + url + '"]'));
|
||||||
|
|
||||||
// the url may point to the search field, which must be activated too
|
// the url may point to the search field, which must be activated too
|
||||||
if (! this.active) {
|
if (! this.active) {
|
||||||
this.setActive(this.$menu.find('form[action="' + this.icinga.utils.parseUrl(url).path + '"]'));
|
this.setActive($menu.find('form[action="' + this.icinga.utils.parseUrl(url).path + '"]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// some urls may have custom filters which won't match any menu item, in that case search
|
// some urls may have custom filters which won't match any menu item, in that case search
|
||||||
// for a menu item that points to the base action without any filters
|
// for a menu item that points to the base action without any filters
|
||||||
if (! this.active) {
|
if (! this.active) {
|
||||||
this.setActive(this.$menu.find('[href="' + this.icinga.utils.parseUrl(url).path + '"]').first());
|
this.setActive($menu.find('[href="' + this.icinga.utils.parseUrl(url).path + '"]').first());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -616,9 +616,11 @@
|
|||||||
$main.css({
|
$main.css({
|
||||||
top: $header.css('height')
|
top: $header.css('height')
|
||||||
});
|
});
|
||||||
$sidebar.css({
|
if (! $headerLogo.length) {
|
||||||
top: $headerLogo.offset().top + $headerLogo.outerHeight()
|
$sidebar.css({
|
||||||
});
|
top: $headerLogo.offset().top + $headerLogo.outerHeight()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (this.mobileMenu) {
|
if (this.mobileMenu) {
|
||||||
$header.css({
|
$header.css({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user