From fc86609875d0d56a7399c7f2a9da87333ae440ac Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 14 Mar 2016 17:42:32 +0100 Subject: [PATCH] directly check if widget is in dom instead of using jquery event to decide if it has to be updated --- browser/js/app/widgets/plot.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/browser/js/app/widgets/plot.js b/browser/js/app/widgets/plot.js index 35a663f1..6f10b964 100644 --- a/browser/js/app/widgets/plot.js +++ b/browser/js/app/widgets/plot.js @@ -83,11 +83,8 @@ module.exports.create = function(widgetData,container) { }) $('body').on('sync',function(e,id,w){ - widget.trigger('draw',[id,w]) + if (widget.linkedWidgets.indexOf(id)==-1 || !document.contains(widget[0])) return - }) - widget.on('draw',function(e,id,w){ - if (widget.linkedWidgets.indexOf(id)==-1) return widget.fetchValues() requestAnimationFrame(widget.draw) })