From 0a179c6b01c8be2677e89d159ce25dc742836555 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Fri, 27 Feb 2015 08:13:12 +0200 Subject: client: graph_view: handle screen resize --- src/client/view/bubble.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/client/view/bubble.js') diff --git a/src/client/view/bubble.js b/src/client/view/bubble.js index 70dc5d09..dff59eae 100644 --- a/src/client/view/bubble.js +++ b/src/client/view/bubble.js @@ -17,10 +17,12 @@ function Bubble(raw_parent, radius) { circle.className.baseVal = 'circle bubble'; circle.id = 'bubble'; - radius.onValue(function (r) { - setTransformToCenter(g); - circle.setAttribute("r", r); - }) + // reset bubble on radius change and window resize + Bacon.combineWith(function (r, _) { return r; }, radius, $(window).asEventStream('resize')).onValue( + function (r) { + setTransformToCenter(g); + circle.setAttribute("r", r); + }); } return { Bubble:Bubble -- cgit v1.3.1