diff --git a/index.html b/index.html
index 7dd739f..d5c884d 100644
--- a/index.html
+++ b/index.html
@@ -2176,6 +2176,21 @@ function changeColorLastId(){
if (id) document.querySelector("#"+id).setAttribute("color", "red")
}
+function changeColorNextPinch(){
+ //let id = getIdFromPick() // applies on primary only
+ // does not work anymore ... but could listen to selectedElements changes via an observer but deprecated
+ // proxy could be nice but requires to modify push() calls first
+ let lastPrimary = selectedElements.filter( e => e.primary ).length
+
+ let checkForNewPinches = setInterval( _ => {
+ if (selectedElements.filter( e => e.primary ).length > lastPrimary){
+ let id = getIdFromPick() // applies on primary only
+ if (id) document.querySelector("#"+id).setAttribute("color", "red")
+ clearInterval(checkForNewPinches)
+ }
+ }, 50) // relatively cheap check, filtering on small array
+}
+
/*
generalize selector to pick last Nth rather than very last
@@ -2256,6 +2271,7 @@ consider pick then apply, i.e changeColorLastId() but for next Id
+