updated dist

This commit is contained in:
vieron
2012-10-20 01:49:11 +02:00
parent 55edd11ef8
commit b538d64969
5 changed files with 65 additions and 11 deletions

View File

@@ -1129,12 +1129,21 @@
*
* @method remove_widget
* @param {HTMLElement} el The jQuery wrapped HTMLElement you want to remove.
* @param {Boolean|Function} silent If true, widgets below the removed one
* will not move up. If a Function is passed it will be used as callback.
* @param {Function} callback Function executed when the widget is removed.
* @return {Class} Returns the instance of the Gridster Class.
*/
fn.remove_widget = function(el, callback) {
fn.remove_widget = function(el, silent, callback) {
var $el = el instanceof jQuery ? el : $(el);
var wgd = $el.coords().grid;
// if silent is a function assume it's a callback
if ($.isFunction(silent)) {
callback = silent;
silent = false;
}
this.cells_occupied_by_placeholder = {};
this.$widgets = this.$widgets.not($el);
@@ -1145,9 +1154,11 @@
$el.fadeOut($.proxy(function() {
$el.remove();
$nexts.each($.proxy(function(i, widget) {
this.move_widget_up( $(widget), wgd.size_y );
}, this));
if (!silent) {
$nexts.each($.proxy(function(i, widget) {
this.move_widget_up( $(widget), wgd.size_y );
}, this));
}
this.set_dom_grid_height();
@@ -1158,6 +1169,22 @@
};
/**
* Remove all widgets from the grid.
*
* @method remove_all_widgets
* @param {Function} callback Function executed for each widget removed.
* @return {Class} Returns the instance of the Gridster Class.
*/
fn.remove_all_widgets = function(callback) {
this.$widgets.each($.proxy(function(i, el){
this.remove_widget(el, true, callback);
}, this));
return this;
};
/**
* Returns a serialized array of the widgets in the grid.
*