From 14e08d9fe0d2078a509e75c9760c14ba909e124c Mon Sep 17 00:00:00 2001 From: floyd_hawkes Date: Wed, 4 Mar 2015 10:18:48 -0500 Subject: [PATCH] refactor(gridster): adding callback to add_widget function --- src/jquery.gridster.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index 1bcf98d5e..70e934fc2 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -327,7 +327,7 @@ * @return {HTMLElement} Returns the jQuery wrapped HTMLElement representing. * the widget that was just created. */ - fn.add_widget = function(html, size_x, size_y, col, row, max_size, min_size) { + fn.add_widget = function(html, size_x, size_y, col, row, max_size, min_size, callback) { var pos; size_x || (size_x = 1); size_y || (size_y = 1); @@ -371,7 +371,7 @@ this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols + 1) * this.options.widget_margins[0])); - return $w.fadeIn(); + return $w.fadeIn({complete: function () { if(callback) callback.call(this); }}); };