Skip to content

Commit e21f63a

Browse files
ciaranjvieron
authored andcommitted
fix(resize.stop): Call resize.stop at the latest possible moment
Previously the resize.stop callback was being called before the widget had reached the end size that Gridster would make it (the widget grows to match the placeholder size after releasing the drag) This change pushes the resize.stop callback to the last possible moment where the size of the widget the callback receives is more likely to be correct. Signed-off-by: ciaranj <ciaranj@gmail.com> Conflicts: src/jquery.gridster.js
1 parent 835c2df commit e21f63a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/jquery.gridster.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1162,19 +1162,19 @@
11621162
'min-width': '',
11631163
'min-height': ''
11641164
});
1165+
1166+
if (this.options.resize.stop) {
1167+
this.options.resize.stop.call(this, event, ui, this.$resized_widget);
1168+
}
1169+
1170+
this.$el.trigger('gridster:resizestop');
11651171
}, this), 300);
11661172

11671173
this.set_dom_grid_width();
11681174

11691175
if (this.options.autogrow_cols) {
11701176
this.drag_api.set_limits(this.cols * this.min_widget_width);
11711177
}
1172-
1173-
if (this.options.resize.stop) {
1174-
this.options.resize.stop.call(this, event, ui, this.$resized_widget);
1175-
}
1176-
1177-
this.$el.trigger('gridster:resizestop');
11781178
};
11791179

11801180
/**

0 commit comments

Comments
 (0)