2025-01-22 22:12:25 +02:00
|
|
|
import { t } from "../../services/i18n.js";
|
2025-03-02 20:47:57 +01:00
|
|
|
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
2025-01-20 22:39:48 +02:00
|
|
|
|
|
|
|
const TPL = `\
|
|
|
|
<div class="geo-map-buttons">
|
|
|
|
<style>
|
|
|
|
.geo-map-buttons {
|
2025-02-03 22:40:41 +02:00
|
|
|
contain: none;
|
2025-01-20 22:39:48 +02:00
|
|
|
display: flex;
|
|
|
|
gap: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.leaflet-pane {
|
|
|
|
z-index: 50;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<button type="button"
|
|
|
|
class="geo-map-create-child-note floating-button btn bx bx-folder-plus"
|
2025-01-22 22:12:25 +02:00
|
|
|
title="${t("geo-map.create-child-note-title")}" />
|
2025-01-20 22:39:48 +02:00
|
|
|
</div>`;
|
|
|
|
|
|
|
|
export default class GeoMapButtons extends NoteContextAwareWidget {
|
|
|
|
|
|
|
|
isEnabled() {
|
|
|
|
return super.isEnabled() && this.note?.type === "geoMap";
|
|
|
|
}
|
|
|
|
|
|
|
|
doRender() {
|
|
|
|
super.doRender();
|
|
|
|
|
|
|
|
this.$widget = $(TPL);
|
2025-01-20 22:50:36 +02:00
|
|
|
this.$widget.find(".geo-map-create-child-note").on("click", () => this.triggerEvent("geoMapCreateChildNote", { ntxId: this.ntxId }));
|
2025-01-20 22:39:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|