From 9402f202b8a9662953c028578aa0568193ed9e9a Mon Sep 17 00:00:00 2001 From: vieron Date: Mon, 20 Aug 2012 21:06:21 +0200 Subject: [PATCH] update coords for the new widget size. Reported by @bmla in https://github.com/ducksboard/gridster.js/commit/dbf98cc9bdc#commitcomment-1735360 --- src/jquery.gridster.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index fa8a157ca..9b8e9b8f7 100644 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -273,6 +273,14 @@ wgd.size_y = size_y; this.add_to_gridmap(new_grid_data, $widget); + //update coords instance attributes + $widget.data('coords').update({ + width: (size_x * this.options.widget_base_dimensions[0] + + ((size_x - 1) * this.options.widget_margins[0]) * 2), + height: (size_y * this.options.widget_base_dimensions[1] + + ((size_y - 1) * this.options.widget_margins[1]) * 2) + }); + if (size_y > old_size_y) { this.add_faux_rows(size_y - old_size_y); };