diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index 3ca91b450..45bfc97e6 100644 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -190,7 +190,7 @@ - /** + /** * Change the size of a widget. * * @method resize_widget @@ -198,9 +198,10 @@ * representing the widget. * @param {Number} size_x The number of columns that will occupy the widget. * @param {Number} size_y The number of rows that will occupy the widget. + * @param {Function} callback Function executed when the widget is removed. * @return {HTMLElement} Returns $widget. */ - fn.resize_widget = function($widget, size_x, size_y) { + fn.resize_widget = function($widget, size_x, size_y, callback) { var wgd = $widget.coords().grid; size_x || (size_x = wgd.size_x); size_y || (size_y = wgd.size_y); @@ -319,6 +320,10 @@ this.remove_empty_cells.apply(this, rows_to_remove_holes); } + if (callback) { + callback.call(this, size_x, size_y); + } + return $widget; };