From c380126517784c29d66c469befce885f1be23df3 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Fri, 29 Jan 2016 19:47:59 -0500
Subject: [PATCH] try replacing css animation with web animation API (this will
 be more flexible once we pull the xlet highlighting logic out of the c code)

---
 pd/nw/pdgui.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index 71a292e6f..637a62c49 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -1423,14 +1423,31 @@ function gui_configure_io(cid, tag, is_iemgui, is_signal, width) {
         }
         // remove xlet_selected tag
         xlet.classList.remove("xlet_selected");
+        if (xlet_anim) {
+            xlet_anim.cancel();
+        }
     }
 }
 
+var xlet_anim;
 function gui_highlight_io(cid, tag) {
     var xlet = get_item(cid, tag);
     // must check for null (see gui_configure_io)
     if (xlet !== null) {
         xlet.classList.add("xlet_selected");
+        if (!xlet_anim || xlet_anim.playState === "finished" ||
+            xlet_anim.playState === "idle") {
+            xlet_anim = xlet.animate(
+                [{"stroke-width":"3"},
+                 {"stroke-width":"7"},
+                 {"stroke-width":"3"},
+                ],
+                { duration: 400,
+                  delay: 45,
+                  iterations: Infinity,
+                  easing: "ease-in-out" }
+            );
+        }
     }
 }
 
-- 
GitLab