From ffda66af1dfdca8f8d12bd526f683556d6391deb Mon Sep 17 00:00:00 2001 From: tyage Date: Wed, 5 Sep 2018 17:02:49 +0900 Subject: [PATCH] tika on mouseover --- cmsranking/static/Overview.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmsranking/static/Overview.js b/cmsranking/static/Overview.js index 5e45c5b94c..a4655f44cf 100644 --- a/cmsranking/static/Overview.js +++ b/cmsranking/static/Overview.js @@ -164,10 +164,15 @@ var Overview = new function () { self.rank_axis.node.setAttribute("stroke", self.rank_axis.node.getAttribute("fill")); self.rank_axis.node.setAttribute("fill", "none"); - setInterval(() => { - self.rank_axis.attr( - {"stroke": "#" + Math.random().toString(16).slice(2,8)}); - }, 100); + var tika = () => { + self.paper.canvas.removeEventListener('mouseover', tika); + setInterval(() => { + self.rank_axis.attr({ + "stroke": "#" + Math.random().toString(16).slice(2,8) + }); + }, 100); + }; + self.paper.canvas.addEventListener('mouseover', tika); } };