From d89c8a30694911ef6387d87bdef3725019769347 Mon Sep 17 00:00:00 2001 From: AliyanH Date: Fri, 5 May 2023 11:41:44 -0400 Subject: [PATCH 1/2] Add button for StopPropagation --- api/map-feature/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/map-feature/index.html b/api/map-feature/index.html index 4673c44..37ef6ee 100644 --- a/api/map-feature/index.html +++ b/api/map-feature/index.html @@ -55,6 +55,7 @@ document.querySelector('#blur').disabled = true; document.querySelector('#zoom').disabled = true; document.querySelector('#replace').disabled = true; + document.querySelector('#prevent').disabled = true; document.querySelector('#remove').disabled = true; } else { document.querySelector('#add').disabled = true; @@ -63,6 +64,7 @@ document.querySelector('#blur').disabled = false; document.querySelector('#zoom').disabled = false; document.querySelector('#replace').disabled = false; + document.querySelector('#prevent').disabled = false; document.querySelector('#remove').disabled = false; } } @@ -102,6 +104,15 @@ document.querySelector('map-feature').remove(); toggleDisabled(); } + function addStopPropagation() { + let man = document.querySelector('map-feature'); + man.addEventListener("click", (e) => { + // Stops Default click action + e.originalEvent.stopPropagation(); + // handle the click button yourself here + // ... + }); + }