fix dashboard select drop down (#1205)

This commit is contained in:
Guillermo Ruffino 2020-07-27 06:43:51 -03:00 committed by Otto Winter
parent 9483a9c8c4
commit f39bf9c1e5
No known key found for this signature in database
GPG key ID: 48ED2DDB96D7682C
3 changed files with 20 additions and 4 deletions

View file

@ -163,6 +163,11 @@ main {
color: black;
}
nav {
height: auto;
line-height: normal;
}
.select-port-container {
margin-top: 8px;
margin-right: 10px;

View file

@ -5,6 +5,7 @@ $(document).ready(function () {
M.AutoInit(document.body);
nodeGrid();
startAceWebsocket();
fixNavbarHeight();
});
// WebSocket URL Helper
@ -16,6 +17,17 @@ if (loc.protocol === "https:") {
}
const wsUrl = wsLoc.href;
/**
* Fix NavBar height
*/
const fixNavbarHeight = () => {
const fixFunc = () => {
const sel = $(".select-wrapper");
$(".navbar-fixed").css("height", (sel.position().top + sel.outerHeight()) + "px");
}
$(window).resize(fixFunc);
fixFunc();
}
/**
* Dashboard Dynamic Grid
@ -1003,4 +1015,3 @@ jQuery.validator.addMethod("nospaces", (value, element) => {
jQuery.validator.addMethod("lowercase", (value, element) => {
return value === value.toLowerCase();
}, "Name must be all lower case!");

View file

@ -31,8 +31,8 @@
<body>
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper grey lighten-2">
<nav class="grey lighten-2">
<div class="nav-wrapper">
<a href="#" class="black-text logo-wrapper">
<img src="https://esphome.io/_static/logo-text.svg" alt="ESPHome Logo" class="logo">
</a>
@ -53,7 +53,7 @@
<li><a data-action="edit" data-filename="secrets.yaml">Secrets Editor</a></li>
<li class="divider"></li>
{% if login_enabled %}
<li><a href="{{ relative_url }}logout">Logout</a></li>
<li><a href="{{ relative_url }}logout">Logout</a></li>
{% end %}
</ul>
</nav>