Release v0.6.1

This commit is contained in:
floyd_hawkes
2015-02-21 12:26:58 -05:00
parent dbc226d46c
commit 9ead8c04c1
8 changed files with 72 additions and 35 deletions
+11
View File
@@ -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)
+1 -1
View File
@@ -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 */
+27 -14
View File
@@ -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 */
@@ -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();
};
@@ -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;
@@ -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);
@@ -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]));
}
};
@@ -3761,7 +3761,7 @@
};
/**
*
* Generates the width of the grid columns based on the width of the window.
* @returns {number}
*/
fn.get_responsive_col_width = function() {
@@ -3769,13 +3769,25 @@
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({
@@ -3786,7 +3798,7 @@
this.$el.addClass('collapsed');
if(this.options.resize.enabled && this.resize_api) {
if(this.resize_api) {
this.disable_resize();
}
@@ -3800,7 +3812,7 @@
'min-height': 'auto'
});
this.$el.removeClass('collapsed');
if(this.options.resize.enabled && this.resize_api) {
if(this.resize_api) {
this.enable_resize();
}
@@ -3808,10 +3820,11 @@
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.
+1 -1
View File
@@ -1,2 +1,2 @@
/*! gridster.js - v0.6.0 - 2015-02-18 - * http://gridster.net/ - Copyright (c) 2015 decksterteam; Licensed */
/*! gridster.js - v0.6.1 - 2015-02-21 - * http://gridster.net/ - Copyright (c) 2015 decksterteam; Licensed */
.gridster{position:relative}.gridster>*{margin:0 auto;-webkit-transition:height .4s,width .4s;-moz-transition:height .4s,width .4s;-o-transition:height .4s,width .4s;-ms-transition:height .4s,width .4s;transition:height .4s,width .4s}.gridster .gs-w{z-index:2;position:absolute}.gridster.collapsed .gs-w{position:static!important}.ready .gs-w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s;-moz-transition:opacity .3s,left .3s,top .3s;-o-transition:opacity .3s,left .3s,top .3s;transition:opacity .3s,left .3s,top .3s}.ready .gs-w:not(.preview-holder),.ready .resize-preview-holder{-webkit-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-moz-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-o-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;transition:opacity .3s,left .3s,top .3s,width .3s,height .3s}.gridster .preview-holder{z-index:1;position:absolute;background-color:#fff;border-color:#fff;opacity:.3}.gridster .player-revert{z-index:10!important;-webkit-transition:left .3s,top .3s!important;-moz-transition:left .3s,top .3s!important;-o-transition:left .3s,top .3s!important;transition:left .3s,top .3s!important}.gridster .dragging,.gridster .resizing{z-index:10!important;-webkit-transition:all 0s!important;-moz-transition:all 0s!important;-o-transition:all 0s!important;transition:all 0s!important}.gs-resize-handle{position:absolute;z-index:1}.gs-resize-handle-both{width:20px;height:20px;bottom:-8px;right:-8px;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=);background-position:top left;background-repeat:no-repeat;cursor:se-resize;z-index:20}.gs-resize-handle-x{top:0;bottom:13px;right:-5px;width:10px;cursor:e-resize}.gs-resize-handle-y{left:0;right:13px;bottom:-5px;height:10px;cursor:s-resize}.gs-w:hover .gs-resize-handle,.resizing .gs-resize-handle{opacity:1}.gs-resize-handle,.gs-w.dragging .gs-resize-handle{opacity:0}.gs-resize-disabled .gs-resize-handle{display:none!important}[data-max-sizex="1"] .gs-resize-handle-x,[data-max-sizey="1"] .gs-resize-handle-y,[data-max-sizey="1"][data-max-sizex="1"] .gs-resize-handle{display:none!important}
+2 -2
View File
File diff suppressed because one or more lines are too long
+27 -14
View File
@@ -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 */
@@ -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();
};
@@ -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;
@@ -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);
@@ -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]));
}
};
@@ -3761,7 +3761,7 @@
};
/**
*
* Generates the width of the grid columns based on the width of the window.
* @returns {number}
*/
fn.get_responsive_col_width = function() {
@@ -3769,13 +3769,25 @@
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({
@@ -3786,7 +3798,7 @@
this.$el.addClass('collapsed');
if(this.options.resize.enabled && this.resize_api) {
if(this.resize_api) {
this.disable_resize();
}
@@ -3800,7 +3812,7 @@
'min-height': 'auto'
});
this.$el.removeClass('collapsed');
if(this.options.resize.enabled && this.resize_api) {
if(this.resize_api) {
this.enable_resize();
}
@@ -3808,10 +3820,11 @@
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.
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -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",