From 41d8c33a6b87c948a7fe4ae5e53483d42fead422 Mon Sep 17 00:00:00 2001 From: Daniel Beauchamp Date: Thu, 9 Aug 2012 13:54:46 -0400 Subject: Re-layout with masonry whenever a widget is ready. --- templates/project/dashboards/layout.erb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'templates/project') diff --git a/templates/project/dashboards/layout.erb b/templates/project/dashboards/layout.erb index 1d1aeb3..97cb96d 100644 --- a/templates/project/dashboards/layout.erb +++ b/templates/project/dashboards/layout.erb @@ -22,12 +22,13 @@ $('#container ul').masonry({ itemSelector: '.widget-container' }); } - Dashing.on('ready', function() { - setTimeout(relayout, 0); + Dashing.Widget.on('ready', function(){ + setTimeout(function(){ + relayout(); + }, 0); }); $(window).resize(relayout); - -- cgit v1.2.3