topbar: avoid JS error on layouts without topbar

eg. 404 pages
This commit is contained in:
Sören Weber 2025-02-28 07:57:01 +01:00
parent 8f55271c77
commit db407309e1
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 15 additions and 13 deletions

View file

@ -1903,6 +1903,7 @@ ready(function () {
moveTopbarButtons(); moveTopbarButtons();
adjustEmptyTopbarContents(); adjustEmptyTopbarContents();
} }
if (topbar) {
var mqs = window.matchMedia('only screen and (max-width: 47.999rem)'); var mqs = window.matchMedia('only screen and (max-width: 47.999rem)');
mqs.addEventListener('change', onWidthChange.bind(null, setWidthS)); mqs.addEventListener('change', onWidthChange.bind(null, setWidthS));
var mqm = window.matchMedia('only screen and (min-width: 48rem) and (max-width: 59.999rem)'); var mqm = window.matchMedia('only screen and (min-width: 48rem) and (max-width: 59.999rem)');
@ -1916,6 +1917,7 @@ ready(function () {
setWidthL(mql); setWidthL(mql);
moveTopbarButtons(); moveTopbarButtons();
adjustEmptyTopbarContents(); adjustEmptyTopbarContents();
}
})(); })();
(function () { (function () {

View file

@ -1 +1 @@
7.4.1+ec1b461d3886edd1383ec154518b970e72ca3f08 7.4.1+8f55271c7781cd53f9f3c9145035f2cbe0b4dfb5