Fix the navbar on the top for small displays

This commit is contained in:
Rodolphe Breard 2018-06-11 13:33:20 +02:00
parent 4bb0e083ae
commit 7dc976e347
2 changed files with 13 additions and 1 deletions

View file

@ -25,4 +25,16 @@ document.addEventListener('DOMContentLoaded', function () {
});
}
// Fix the navbar for small displays
if (window.screen.availWidth < 1088) {
var nb = document.getElementById('navBar');
if (nb !== null) {
nb.className += " is-fixed-top";
}
var ms = document.getElementsByTagName('html')[0];
if (ms !== null) {
ms.className += " has-navbar-fixed-top";
}
console.log(ms);
}
});

View file

@ -1,7 +1,7 @@
{% load static %}
{% load i18n %}
<nav class="navbar is-light">
<nav class="navbar is-light" id="navBar">
<div class="navbar-brand">
<a class="navbar-item" href="{% url 'index' %}"><img src="{% static "khaganat/images/icon_khaganat.png" %}" alt="Khaganat"></a>
<a role="button" class="navbar-burger" data-target="navMenu" aria-label="menu" aria-expanded="false">