summaryrefslogtreecommitdiff
path: root/src/client/view/bubble.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-02-27 08:13:12 +0200
committerAlon Levy <alon@pobox.com>2015-02-27 08:14:11 +0200
commit0a179c6b01c8be2677e89d159ce25dc742836555 (patch)
treeebc148c2f37a9e46f25f8d06e8db0ef06aa91a02 /src/client/view/bubble.js
parentdfc93cf003e8b4484e98ead7f7eac63ad10182e7 (diff)
client: graph_view: handle screen resize
Diffstat (limited to 'src/client/view/bubble.js')
-rw-r--r--src/client/view/bubble.js10
1 files changed, 6 insertions, 4 deletions
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