From ae38f41ac75020c424e8bfcd66bb3c6ee4e65e54 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Mon, 3 Jun 2024 21:12:10 +0200 Subject: [PATCH] added input handler for direct modification --- ccp/js/inputwidgetcontroller.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index b4d7d69..9509c57 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -888,7 +888,7 @@ class CCPGeoInputWidgetController extends CCPBaseInputWidgetController { ev.preventDefault() ev.stopPropagation() } - }) + }) document.addEventListener("keydown", ev=>{ if (ev.ctrlKey && ev.key === 'z') { @@ -933,8 +933,16 @@ class CCPGeoInputWidgetController extends CCPBaseInputWidgetController { ev.preventDefault() ev.stopPropagation() }) + + this.rootdoc.addEventListener("input", ev=>{ + if(ev.getAttribute("name") === this.name && this.getAttribute("data-index")){ + const index = Number(this.getAttribute("data-index")) + this.value[index] = ev.target.value + } + }) } + init(){ this.#widget = this.rootdoc.querySelector("div[name=map]") this.#draw = null