Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 148963d

Browse files
committed
added max_size_x and max_size_y as configurable options. Fixes ducksboard#16.
The maximum number of columns/rows that a widget can span was hardcoded to 6. Maybe it makes sense for dashboards but not for other uses of gridster.
1 parent 151b3bf commit 148963d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/jquery.gridster.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
extra_cols: 0,
1616
min_cols: 1,
1717
min_rows: 15,
18+
max_size_x: 6,
19+
max_size_y: 6,
1820
autogenerate_stylesheet: true,
1921
avoid_overlapped_widgets: true,
2022
serialize_params: function($w, wgd) {
@@ -52,6 +54,10 @@
5254
* those that have been calculated.
5355
* @param {Number} [options.min_cols] The minimum required columns.
5456
* @param {Number} [options.min_rows] The minimum required rows.
57+
* @param {Number} [options.max_size_x] The maximum number of columns
58+
* that a widget can span.
59+
* @param {Number} [options.max_size_y] The maximum number of rows
60+
* that a widget can span.
5561
* @param {Boolean} [options.autogenerate_stylesheet] If true, all the
5662
* CSS required to position all widgets in their respective columns
5763
* and rows will be generated automatically and injected to the
@@ -1970,8 +1976,8 @@
19701976
fn.generate_stylesheet = function(opts) {
19711977
var styles = '';
19721978
var extra_cells = 10;
1973-
var max_size_y = 6;
1974-
var max_size_x = 6;
1979+
var max_size_y = this.options.max_size_y;
1980+
var max_size_x = this.options.max_size_x;
19751981
var i;
19761982
var rules;
19771983

0 commit comments

Comments
 (0)