update coords for the new widget size.

Reported by @bmla in https://github.com/ducksboard/gridster.js/commit/dbf98cc9bdc#commitcomment-1735360
This commit is contained in:
vieron
2012-08-20 21:06:21 +02:00
parent 1086fe5b77
commit 9402f202b8
+8
View File
@@ -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);
};