remove_widget accepts a callback as second argument

This commit is contained in:
vieron
2012-07-20 14:03:03 +02:00
parent 7624182bf4
commit 9dbad2b29e

View File

@@ -221,7 +221,7 @@
* @param {HTMLElement} el The jQuery wrapped HTMLElement you want to remove. * @param {HTMLElement} el The jQuery wrapped HTMLElement you want to remove.
* @return {Class} Returns the instance of the Gridster Class. * @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 $el = el instanceof jQuery ? el : $(el);
var wgd = $el.coords().grid; var wgd = $el.coords().grid;
@@ -237,6 +237,10 @@
this.move_widget_up( $(widget), wgd.size_y ); this.move_widget_up( $(widget), wgd.size_y );
}, this)); }, this));
}, this)); }, this));
if (callback) {
callback.apply(el);
};
}; };