Fix note UX: unreachable wiki link, white Save hover, stale icon preview, invisible new points
- "Nearby on Wikipedia" linked to KIWIX_URL, a Docker-internal hostname (http://kiwix:8080) no real browser can resolve. Split it: KIWIX_URL stays server-side-only for the reachability check, and the link itself is built from KIWIX_PUBLIC_PORT (kiwix-serve's newly published host port) plus whatever host the visitor already used to reach maptool — works regardless of which hostname/IP that is. - The Save button went white on hover in GTK-themed Chrome: the browser's native button skin was painting over the custom background because appearance wasn't reset. - The map preview marker for a pending note always showed a plain red pin no matter which icon was picked in the form. NoteSaveForm now reports icon changes via onIconChange so NotesControl can update the marker's glyph live. - Saving a note (or a Measure "Save as note") left the new/grown .geojson file unchecked and invisible until manually toggled on. notifyGpxStoreChanged now carries the affected path so GpxPanelControl auto-shows it.
This commit is contained in:
1 parent
4f022ec43a
commit
9997a8a8c0
7 files changed
+103
-17
No files matched your search
+7
-4
@@ -18,13 +18,16 @@ export function onlyOneSidePanelOpen(panel, onClosedByOther) {
|
||||
|
||||
// Lets a control that writes into the GPX store (e.g. notes.js saving a
|
||||
// drawn point) tell GpxPanelControl its tree is stale, without either one
|
||||
// holding a reference to the other.
|
||||
// holding a reference to the other. path (the .geojson file just written
|
||||
// to) lets the listener also auto-show that file instead of just refreshing
|
||||
// the tree — the point/shape just saved is otherwise invisible until the
|
||||
// user finds and checks it by hand.
|
||||
const STORE_CHANGED_EVENT = "gpx-store-changed";
|
||||
|
||||
export function notifyGpxStoreChanged() {
|
||||
document.dispatchEvent(new CustomEvent(STORE_CHANGED_EVENT));
|
||||
export function notifyGpxStoreChanged(path) {
|
||||
document.dispatchEvent(new CustomEvent(STORE_CHANGED_EVENT, { detail: path }));
|
||||
}
|
||||
|
||||
export function onGpxStoreChanged(callback) {
|
||||
document.addEventListener(STORE_CHANGED_EVENT, callback);
|
||||
document.addEventListener(STORE_CHANGED_EVENT, (event) => callback(event.detail));
|
||||
}
|
||||
Reference in new issue
Block a user