From 148963d12fb54a829ae53b32c50b67eeb98fa032 Mon Sep 17 00:00:00 2001 From: vieron Date: Wed, 8 Aug 2012 01:18:04 +0200 Subject: [PATCH] added max_size_x and max_size_y as configurable options. Fixes #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. --- src/jquery.gridster.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index fba6ce8e9b..93f83ba2ff 100644 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -15,6 +15,8 @@ extra_cols: 0, min_cols: 1, min_rows: 15, + max_size_x: 6, + max_size_y: 6, autogenerate_stylesheet: true, avoid_overlapped_widgets: true, serialize_params: function($w, wgd) { @@ -52,6 +54,10 @@ * those that have been calculated. * @param {Number} [options.min_cols] The minimum required columns. * @param {Number} [options.min_rows] The minimum required rows. + * @param {Number} [options.max_size_x] The maximum number of columns + * that a widget can span. + * @param {Number} [options.max_size_y] The maximum number of rows + * that a widget can span. * @param {Boolean} [options.autogenerate_stylesheet] If true, all the * CSS required to position all widgets in their respective columns * and rows will be generated automatically and injected to the @@ -1970,8 +1976,8 @@ fn.generate_stylesheet = function(opts) { var styles = ''; var extra_cells = 10; - var max_size_y = 6; - var max_size_x = 6; + var max_size_y = this.options.max_size_y; + var max_size_x = this.options.max_size_x; var i; var rules;