From 4558894282e39d161cee8f3682d4e03c4196167e Mon Sep 17 00:00:00 2001 From: Zhora Shalyapin Date: Tue, 11 Mar 2025 08:54:25 +0000 Subject: [PATCH] fix sticky menu --- main.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 0080dbb..9cc8ddc 100644 --- a/main.js +++ b/main.js @@ -753,7 +753,16 @@ location.href = link.href }) } - + } + + function addStickyHeaderToMainList() { + let topMenu = document.querySelector(".large-menu") + let table = document.querySelector("#props") + if (topMenu) { + let caption = document.createElement("caption") + caption.appendChild(topMenu) + table.prepend(caption) + } } function addFullscreenButton() { @@ -768,11 +777,13 @@ } let styles = ` - .large-menu { + #props caption { position: sticky; top: 0; - z-index: 10; - background: white; + + .large-menu { + background: white; + } } #content-wrapper { @@ -1167,6 +1178,7 @@ addJs('https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js') addCss('https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css') + addStickyHeaderToMainList() addFullscreenButton() if (!isEditCpPage()) {