From 4e3df8121dac888e23875dcdfca7daf11228549d Mon Sep 17 00:00:00 2001 From: Zhora Shalyapin Date: Fri, 14 Mar 2025 15:14:18 +0000 Subject: [PATCH] prettify route build page --- main.js | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 944c17c..20a0924 100644 --- a/main.js +++ b/main.js @@ -989,6 +989,10 @@ document.body.appendChild(clearEl) } + function hasMap() { + return document.querySelector(".leaflet-container") !== null + } + function initMapbox() { 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') @@ -1436,6 +1440,34 @@ } } + function prettifyRouteBuildPage() { + let styles = ` + #content table table { + td:nth-child(2) { + width: 10%; + + select { + width: 5em !important; + } + } + + td:nth-child(3) { + width: 12%; + } + + td:nth-child(4) { + width: 12%; + + input { + width: 4em; + } + } + } + ` + + addStylesToHead(styles) + } + let styles = ` .sticky-menu { position: sticky; @@ -1808,7 +1840,8 @@ } addClearBoth() - if (document.querySelector(".leaflet-container")) { + + if (hasMap()) { initMapbox() addFullscreenButton() @@ -1826,4 +1859,8 @@ if (isRouteListPage()) { addStageLink() } + + if (isRouteBuildPage()) { + prettifyRouteBuildPage() + } })(); \ No newline at end of file