From 76d2a399213a760f0798240f0ab26bf50a1bb5e3 Mon Sep 17 00:00:00 2001 From: Colin McFadden Date: Wed, 16 Oct 2024 08:09:26 -0500 Subject: [PATCH] rev leaflet --- .../leaflet-treering/Leaflet.AreaCapture.js | 39 ++++++--------- .../leaflet-treering/Leaflet.PithEstimate.js | 2 - .../Template.AreaCapture.html | 47 ++++++------------- assets/leaflet-treering/leaflet-treering.js | 4 -- 4 files changed, 29 insertions(+), 63 deletions(-) diff --git a/assets/leaflet-treering/Leaflet.AreaCapture.js b/assets/leaflet-treering/Leaflet.AreaCapture.js index f6715067..81d41726 100644 --- a/assets/leaflet-treering/Leaflet.AreaCapture.js +++ b/assets/leaflet-treering/Leaflet.AreaCapture.js @@ -690,10 +690,10 @@ function NewEllipse(Inte) { L.DomEvent.on(window, 'keydown', (e) => { if (e.keyCode == 69 && e.getModifierState("Shift") && !e.getModifierState("Control") && window.name.includes('popout') && !Inte.treering.annotationAsset.dialogAnnotationWindow) { // Dialog windows w/ text cannot be active - e.preventDefault(); - e.stopPropagation(); - Inte.treering.disableTools(); - this.enable(); + e.preventDefault(); + e.stopPropagation(); + Inte.treering.disableTools(); + this.enable(); } }, this); @@ -812,8 +812,8 @@ function NewEllipse(Inte) { * @param {object} Inte - AreaCaptureInterface object. Allows access to all other tools. */ function NewEllipseDialog(Inte) { - let minWidth = 130; - let minHeight = 130; + let minWidth = 180; + let minHeight = 170; this.size = [minWidth, minHeight]; this.anchor = [50, 0]; @@ -880,25 +880,14 @@ function NewEllipseDialog(Inte) { * @function */ NewEllipseDialog.prototype.createDialogEventListeners = function () { - // Year editing buttons: - $("#AreaCapture-editYear-btn").on("click", () => { - let html = document.getElementById("AreaCapture-newYearDialog-template").innerHTML; - let template = Handlebars.compile(html); - let content = template({ - "year": Inte.ellipseData.year, - }); - this.dialog.setContent(content); - document.getElementById("AreaCapture-newYear-input").select(); - - $("#AreaCapture-confirmYear-btn").on("click", () => { - let year = $("#AreaCapture-newYear-input").val(); - if (year || year == 0) { - Inte.ellipseVisualAssets.cycleColorsMulti(year); - Inte.ellipseData.year = year; - } - this.update(); - }) - }); + $("#AreaCapture-confirmYear-btn").on("click", () => { + let year = $("#AreaCapture-newYear-input").val(); + if (year || year == 0) { + Inte.ellipseVisualAssets.cycleColorsMulti(year); + Inte.ellipseData.year = year; + } + this.update(); + }) $("#AreaCapture-subtractYear-btn").on("click", () => { Inte.ellipseData.decreaseYear(); diff --git a/assets/leaflet-treering/Leaflet.PithEstimate.js b/assets/leaflet-treering/Leaflet.PithEstimate.js index 9d7e240d..def9aa54 100644 --- a/assets/leaflet-treering/Leaflet.PithEstimate.js +++ b/assets/leaflet-treering/Leaflet.PithEstimate.js @@ -4,8 +4,6 @@ * @version 1.0.0 */ -const { point } = require("leaflet"); - /** * Interface for pith estimate tools. * @constructor diff --git a/assets/leaflet-treering/Template.AreaCapture.html b/assets/leaflet-treering/Template.AreaCapture.html index cbeebb99..a4391b25 100644 --- a/assets/leaflet-treering/Template.AreaCapture.html +++ b/assets/leaflet-treering/Template.AreaCapture.html @@ -1,13 +1,20 @@ - -