Skip to content

Commit

Permalink
fix(resize.stop): Call resize.stop at the latest possible moment
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ciaranj authored and vieron committed Feb 14, 2014
1 parent 835c2df commit e21f63a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/jquery.gridster.js
Original file line number Diff line number Diff line change
Expand Up @@ -1162,19 +1162,19 @@
'min-width': '',
'min-height': ''
});

if (this.options.resize.stop) {
this.options.resize.stop.call(this, event, ui, this.$resized_widget);
}

this.$el.trigger('gridster:resizestop');
}, this), 300);

this.set_dom_grid_width();

if (this.options.autogrow_cols) {
this.drag_api.set_limits(this.cols * this.min_widget_width);
}

if (this.options.resize.stop) {
this.options.resize.stop.call(this, event, ui, this.$resized_widget);
}

this.$el.trigger('gridster:resizestop');
};

/**
Expand Down

0 comments on commit e21f63a

Please sign in to comment.