Check to avoid generation of duplicated stylesheet-tags shouldn't have
been removed from Gridster. It's useful when calling multiple times
`generate_stylesheet` method once Gridster is initializated. We use it
at ducksboard to generate a TVmode version of the grid with bigger widgets.
Refactored the way stylesheet tags are removed. When created I push them
to a jQuery collection which is removed when `destroy` method is executed.
Is it possible to add a callback to the resize_widget function, that is
called when the resizing of a widget is finished? This may help to
update the widget content properly.
Right now the number of columns is calculated by dividing the available
space by the necessary space. I want to have an option to limit the
number of calculated columns, without changing the width of the div my
grid lives in.
In order to limit the number of calculated columns max_cols is set to a
number. To have 'unlimited' columns set the value of max_cols to -1 (as
ids done in the default settings). This provides the arbitrary useful
functionality to set the max number of columns to 0. Any sideeffect
caused by this are mitigated by checking that the max_cols is larger
than the min_cols setting.
Remove multiple widgets without chaining callbacks was not possible so I've added a new argument to remove_widget method named `silent` which if it's value is true, widgets below the removed will not move up.
Also added the method remove_all_widgets.
Fixes#63
When defining the gridster, you can now define a draggable.handle selector:
For example:
$("#widgets").gridster({
widget_margins: [10, 10],
widget_base_dimensions: [565, 400],
draggable: {
stop: function(event, ui) {
console.log('save new columns');
},
handle: '.title'
}
});
If handle is omitted (or left blank), it works as it did previously. If a value is specified, then dragging only starts if the element which was clicked matches the selector specified.
Added by @vieron:
Closes#29
Some new methods we need at Ducksboard to implement TV mode.
Two new distributions of Gridster are generated with grunt:
- jquery.gridster.with-extras.js
- jquery.gridster.with-extras.min.js