From 9dbad2b29eeacad747a560ec92fb4b0dc90e94e0 Mon Sep 17 00:00:00 2001 From: vieron Date: Fri, 20 Jul 2012 14:03:03 +0200 Subject: [PATCH] remove_widget accepts a callback as second argument --- src/jquery.gridster.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index fdd1375bae..8e6a5d7440 100644 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -221,7 +221,7 @@ * @param {HTMLElement} el The jQuery wrapped HTMLElement you want to remove. * @return {Class} Returns the instance of the Gridster Class. */ - fn.remove_widget = function(el) { + fn.remove_widget = function(el, callback) { var $el = el instanceof jQuery ? el : $(el); var wgd = $el.coords().grid; @@ -237,6 +237,10 @@ this.move_widget_up( $(widget), wgd.size_y ); }, this)); }, this)); + + if (callback) { + callback.apply(el); + }; };