From 5ed90fff83da1b67762f5435260ad293b3339a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 30 Dec 2020 21:07:14 +0100 Subject: [PATCH] Popups: move close button into the content, so that position depends on existance of scrollbar --- src/CategoryOverpass.js | 3 +++ style.css | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/CategoryOverpass.js b/src/CategoryOverpass.js index baa69dd4..a8e61f8e 100644 --- a/src/CategoryOverpass.js +++ b/src/CategoryOverpass.js @@ -133,6 +133,9 @@ function CategoryOverpass (options, data, repository) { this.updatePopupContent(ob, ob.popup) + // Move close button into the content, to make its position depending whether a scrollbar is visible or not + ob.popup._contentNode.insertBefore(ob.popup._closeButton, ob.popup._contentNode.firstChild) + if (document.getElementById('content').className === 'details open') { showDetails(ob, this) } diff --git a/style.css b/style.css index 6eb249e7..c5726052 100644 --- a/style.css +++ b/style.css @@ -597,3 +597,10 @@ ul.overpass-layer-list > li > a > .content > .details { background-size: 100% 20px, 100% 20px, 100% 10px, 100% 10px; background-attachment:local, local, scroll, scroll; } +.leaflet-popup > .leaflet-popup-close-button { + display: none; +} +.leaflet-container .leaflet-popup-content > a.leaflet-popup-close-button { + float: right; + position: inherit; +}