Skip to content

Commit

Permalink
Release v0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
floyd_hawkes committed Feb 21, 2015
1 parent dbc226d commit 9ead8c0
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 35 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
<a name="v0.6.1"></a>
### v0.6.1 (2015-02-21)


#### Bug Fixes

* **gridster:**
* fixed expand_widget bug not expanding full width of window fix(gridster): user c ([dbc226d4](http://github.com/DecksterTeam/gridster.js/commit/dbc226d46c8224f753c07af6aff259785c60425f))
* fixing drag limit issues when using autogrow_cols ([afd83fea](http://github.com/DecksterTeam/gridster.js/commit/afd83fead8c719615ae01ef7b5d3863701ff2243))
* changed the way widgets were getting positioned so that margins are actually the ([a3913043](http://github.com/DecksterTeam/gridster.js/commit/a3913043579bae9f5ef28e34524ad7a8ae7dcafd))

<a name="v0.6.0"></a>
## v0.6.0 (2015-02-18)

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.gridster.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! gridster.js - v0.6.0 - 2015-02-18
/*! gridster.js - v0.6.1 - 2015-02-21
* http://gridster.net/
* Copyright (c) 2015 decksterteam; Licensed */

Expand Down
41 changes: 27 additions & 14 deletions dist/jquery.gridster.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! gridster.js - v0.6.0 - 2015-02-18
/*! gridster.js - v0.6.1 - 2015-02-21
* http://gridster.net/
* Copyright (c) 2015 decksterteam; Licensed */

Expand Down Expand Up @@ -1216,7 +1216,7 @@
this.set_dom_grid_width();
this.set_dom_grid_height();

this.drag_api.set_limits(this.cols * this.min_widget_width);
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols + 1) * this.options.widget_margins[0]));

return $w.fadeIn();
};
Expand Down Expand Up @@ -1346,15 +1346,15 @@
* @method expand_widget
* @param {HTMLElement} $widget The jQuery wrapped HTMLElement
* representing the widget.
* @param {Number} size_x The number of cols that will occupy the widget.
* @param {Number} size_y The number of rows that will occupy the widget.
* @param {Function} [callback] Function executed when the widget is removed.
* @return {HTMLElement} Returns $widget.
*/
fn.expand_widget = function($widget, size_y, callback) {
fn.expand_widget = function($widget, size_x, size_y, callback) {
var wgd = $widget.coords().grid;
var max_size_x = Math.floor(($(window).width() - this.options.widget_margins[0] * 2) /
(this.min_widget_width + this.options.widget_margins[0] * 2));
var size_x = Math.min(max_size_x, this.cols);
var max_size_x = Math.floor(($(window).width() - this.options.widget_margins[0] * 2) / this.min_widget_width);
size_x = size_x || Math.min(max_size_x, this.cols);
size_y || (size_y = wgd.size_y);

var old_size_y = wgd.size_y;
Expand Down Expand Up @@ -2080,7 +2080,7 @@
if (prcol >= this.cols - 1 && this.options.max_cols >= this.cols + 1) {
this.add_faux_cols(1);
this.set_dom_grid_width(this.cols + 1);
this.drag_api.set_limits(this.container_width);
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols + 1) * this.options.widget_margins[0]));
}

this.collision_api.set_colliders(this.faux_grid);
Expand Down Expand Up @@ -2171,7 +2171,7 @@
this.set_dom_grid_width();

if (this.options.autogrow_cols) {
this.drag_api.set_limits(this.cols * this.min_widget_width);
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols + 1) * this.options.widget_margins[0]));
}
};

Expand Down Expand Up @@ -3761,21 +3761,33 @@
};

/**
*
* Generates the width of the grid columns based on the width of the window.
* @returns {number}
*/
fn.get_responsive_col_width = function() {
var cols = this.cols || this.options.max_cols;
return (this.$el.width() - ((cols + 1) * this.options.widget_margins[0])) / cols;
};

/**
* Changes the minimum width of a widget based on the width of the window and the number of cols that can
* fit in it.
* @returns {Gridster}
*/
fn.resize_responsive_layout = function() {
this.min_widget_width = this.get_responsive_col_width();
this.generate_grid_and_stylesheet();
this.update_widgets_dimensions();
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols) * this.options.widget_margins[0]));
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols + 1) * this.options.widget_margins[0]));
return this;
};

/**
* Switches between collapsed widgets the span the full width when the responsive_breakpoint is triggered.
* @param collapse
* @param opts
* @returns {Gridster}
*/
fn.toggle_collapsed_grid = function(collapse, opts) {
if(collapse) {
this.$widgets.css({
Expand All @@ -3786,7 +3798,7 @@

this.$el.addClass('collapsed');

if(this.options.resize.enabled && this.resize_api) {
if(this.resize_api) {
this.disable_resize();
}

Expand All @@ -3800,18 +3812,19 @@
'min-height': 'auto'
});
this.$el.removeClass('collapsed');
if(this.options.resize.enabled && this.resize_api) {
if(this.resize_api) {
this.enable_resize();
}

if(this.drag_api) {
this.enable();
}
}
}
return this;
};

/**
* It generates the neccessary styles to position the widgets.
* It generates the necessary styles to position the widgets.
*
* @method generate_stylesheet
* @param {Number} rows Number of columns.
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.gridster.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/jquery.gridster.min.js

Large diffs are not rendered by default.

41 changes: 27 additions & 14 deletions dist/jquery.gridster.with-extras.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! gridster.js - v0.6.0 - 2015-02-18
/*! gridster.js - v0.6.1 - 2015-02-21
* http://gridster.net/
* Copyright (c) 2015 decksterteam; Licensed */

Expand Down Expand Up @@ -1216,7 +1216,7 @@
this.set_dom_grid_width();
this.set_dom_grid_height();

this.drag_api.set_limits(this.cols * this.min_widget_width);
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols + 1) * this.options.widget_margins[0]));

return $w.fadeIn();
};
Expand Down Expand Up @@ -1346,15 +1346,15 @@
* @method expand_widget
* @param {HTMLElement} $widget The jQuery wrapped HTMLElement
* representing the widget.
* @param {Number} size_x The number of cols that will occupy the widget.
* @param {Number} size_y The number of rows that will occupy the widget.
* @param {Function} [callback] Function executed when the widget is removed.
* @return {HTMLElement} Returns $widget.
*/
fn.expand_widget = function($widget, size_y, callback) {
fn.expand_widget = function($widget, size_x, size_y, callback) {
var wgd = $widget.coords().grid;
var max_size_x = Math.floor(($(window).width() - this.options.widget_margins[0] * 2) /
(this.min_widget_width + this.options.widget_margins[0] * 2));
var size_x = Math.min(max_size_x, this.cols);
var max_size_x = Math.floor(($(window).width() - this.options.widget_margins[0] * 2) / this.min_widget_width);
size_x = size_x || Math.min(max_size_x, this.cols);
size_y || (size_y = wgd.size_y);

var old_size_y = wgd.size_y;
Expand Down Expand Up @@ -2080,7 +2080,7 @@
if (prcol >= this.cols - 1 && this.options.max_cols >= this.cols + 1) {
this.add_faux_cols(1);
this.set_dom_grid_width(this.cols + 1);
this.drag_api.set_limits(this.container_width);
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols + 1) * this.options.widget_margins[0]));
}

this.collision_api.set_colliders(this.faux_grid);
Expand Down Expand Up @@ -2171,7 +2171,7 @@
this.set_dom_grid_width();

if (this.options.autogrow_cols) {
this.drag_api.set_limits(this.cols * this.min_widget_width);
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols + 1) * this.options.widget_margins[0]));
}
};

Expand Down Expand Up @@ -3761,21 +3761,33 @@
};

/**
*
* Generates the width of the grid columns based on the width of the window.
* @returns {number}
*/
fn.get_responsive_col_width = function() {
var cols = this.cols || this.options.max_cols;
return (this.$el.width() - ((cols + 1) * this.options.widget_margins[0])) / cols;
};

/**
* Changes the minimum width of a widget based on the width of the window and the number of cols that can
* fit in it.
* @returns {Gridster}
*/
fn.resize_responsive_layout = function() {
this.min_widget_width = this.get_responsive_col_width();
this.generate_grid_and_stylesheet();
this.update_widgets_dimensions();
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols) * this.options.widget_margins[0]));
this.drag_api.set_limits((this.cols * this.min_widget_width) + ((this.cols + 1) * this.options.widget_margins[0]));
return this;
};

/**
* Switches between collapsed widgets the span the full width when the responsive_breakpoint is triggered.
* @param collapse
* @param opts
* @returns {Gridster}
*/
fn.toggle_collapsed_grid = function(collapse, opts) {
if(collapse) {
this.$widgets.css({
Expand All @@ -3786,7 +3798,7 @@

this.$el.addClass('collapsed');

if(this.options.resize.enabled && this.resize_api) {
if(this.resize_api) {
this.disable_resize();
}

Expand All @@ -3800,18 +3812,19 @@
'min-height': 'auto'
});
this.$el.removeClass('collapsed');
if(this.options.resize.enabled && this.resize_api) {
if(this.resize_api) {
this.enable_resize();
}

if(this.drag_api) {
this.enable();
}
}
}
return this;
};

/**
* It generates the neccessary styles to position the widgets.
* It generates the necessary styles to position the widgets.
*
* @method generate_stylesheet
* @param {Number} rows Number of columns.
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.gridster.with-extras.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gridster",
"title": "gridster.js",
"description": "a drag-and-drop multi-column jQuery grid plugin",
"version": "0.6.0",
"version": "0.6.1",
"homepage": "http://gridster.net/",
"author": {
"name": "decksterteam",
Expand Down

0 comments on commit 9ead8c0

Please sign in to comment.