From 9296bef23a6f6825828d0c35b5ee305d1b0f9758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fr=C3=A9d=C3=A9ric=20Faust?= Date: Fri, 5 Jun 2015 15:38:16 -0400 Subject: [PATCH 1/2] Update README.md Updated some sentences so they are easier to understand and have a correct syntax Added missing 'new_node.el' to call of add_widget in the example for will_it_fit function. --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 734450f..281f969 100644 --- a/README.md +++ b/README.md @@ -113,17 +113,17 @@ $(function () { ## Options -- `always_show_resize_handle` - if `true` the resizing handles are shown even the user is not hovering over the widget +- `always_show_resize_handle` - if `true` the resizing handles are shown even if the user is not hovering over the widget (default: `false`) - `animate` - turns animation on (default: `false`) -- `auto` - if `false` it tells to do not initialize existing items (default: `true`) +- `auto` - if `false` it tells to not initialize existing items (default: `true`) - `cell_height` - one cell height (default: `60`) - `draggable` - allows to override jQuery UI draggable options. (default: `{handle: '.grid-stack-item-content', scroll: true, appendTo: 'body'}`) - `handle` - draggable handle selector (default: `'.grid-stack-item-content'`) - `height` - maximum rows amount. Default is `0` which means no maximum rows - `float` - enable floating widgets (default: `false`) See [example](http://troolee.github.io/gridstack.js/demo/float.html) - `item_class` - widget class (default: `'grid-stack-item'`) -- `min_width` - minimal width. If window width is less grid will be shown in one-column mode (default: `768`) +- `min_width` - minimal width. If window width is less, grid will be shown in one-column mode (default: `768`) - `placeholder_class` - class for placeholder (default: `'grid-stack-placeholder'`) - `resizable` - allows to override jQuery UI resizable options. (default: `{autoHide: true, handles: 'se'}`) - `vertical_margin` - vertical gap size (default: `20`) @@ -144,8 +144,8 @@ $(function () { - `data-gs-no-move` - disable element moving - `data-gs-auto-position` - tells to ignore `data-gs-x` and `data-gs-y` attributes and to place element to the first available position -- `data-gs-locked` - the widget will be locked. It means another widgets couldn't move it during dragging or resizing. -The widget is still can be dragged or resized. You need to add `data-gs-no-resize` and `data-gs-no-move` attributes +- `data-gs-locked` - the widget will be locked. It means another widget wouldn't be able to move it during dragging or resizing. +The widget can still be dragged or resized. You need to add `data-gs-no-resize` and `data-gs-no-move` attributes to completely lock the widget. ## Events @@ -214,8 +214,8 @@ Parameters: - `auto_position` - if `true` then `x`, `y` parameters will be ignored and widget will be places on the first available position -Widget will be always placed even if result height will be more then grid height. You need to use `will_it_fit` method -before call `add_widget` for additional check. +Widget will be always placed even if result height is more than actual grid height. You need to use `will_it_fit` method +before calling `add_widget` for additional check. ```javascript $('.grid-stack').gridstack(); @@ -350,7 +350,7 @@ have `height` constraint. ```javascript if (grid.will_it_fit(new_node.x, new_node.y, new_node.width, new_node.height, true)) { - grid.add_widget(new_node.x, new_node.y, new_node.width, new_node.height, true); + grid.add_widget(new_node.el, new_node.x, new_node.y, new_node.width, new_node.height, true); } else { alert('Not enough free space to place the widget'); From 27c0866b65b29a3a83fed0724858f4d4909e1850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fr=C3=A9d=C3=A9ric=20Faust?= Date: Fri, 5 Jun 2015 15:44:04 -0400 Subject: [PATCH 2/2] Update README.md Following the other pull request about the readme.md, I thought @wmak 's syntax was better --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 281f969..1062634 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ $(function () { - `always_show_resize_handle` - if `true` the resizing handles are shown even if the user is not hovering over the widget (default: `false`) - `animate` - turns animation on (default: `false`) -- `auto` - if `false` it tells to not initialize existing items (default: `true`) +- `auto` - if `false` gridstack will not initialize existing items (default: `true`) - `cell_height` - one cell height (default: `60`) - `draggable` - allows to override jQuery UI draggable options. (default: `{handle: '.grid-stack-item-content', scroll: true, appendTo: 'body'}`) - `handle` - draggable handle selector (default: `'.grid-stack-item-content'`)