diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 0000000..423b011
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,14 @@
+{
+ "preset": "google",
+ "validateIndentation": "\t",
+ "maximumLineLength": 120,
+ "jsDoc": {
+ "checkAnnotations": {
+ "preset": "jsdoc3",
+ "extra": {
+ "preserve": true
+ }
+ }
+ },
+ "requireCamelCaseOrUpperCaseIdentifiers": true
+}
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..1ae9dd9
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,62 @@
+module.exports = function (grunt) {
+ grunt.loadNpmTasks('grunt-sass');
+ grunt.loadNpmTasks('grunt-contrib-cssmin');
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-doctoc');
+
+ grunt.initConfig({
+ sass: {
+ options: {
+ outputStyle: 'expanded'
+ },
+ dist: {
+ files: {
+ 'dist/gridstack.css': 'src/gridstack.scss',
+ 'dist/gridstack-extra.css': 'src/gridstack-extra.scss'
+ }
+ }
+ },
+
+ cssmin: {
+ dist: {
+ files: {
+ 'dist/gridstack.min.css': ['dist/gridstack.css'],
+ 'dist/gridstack-extra.min.css': ['dist/gridstack-extra.css']
+ }
+ }
+ },
+
+ copy: {
+ dist: {
+ files: {
+ 'dist/gridstack.js': ['src/gridstack.js']
+ }
+ }
+ },
+
+ uglify: {
+ options: {
+ sourceMap: true,
+ sourceMapName: 'dist/gridstack.min.map',
+ preserveComments: 'some'
+ },
+ dist: {
+ files: {
+ 'dist/gridstack.min.js': ['src/gridstack.js']
+ }
+ }
+ },
+
+ doctoc: {
+ options: {
+ removeAd: false
+ },
+ readme: {
+ target: "./README.md"
+ }
+ }
+ });
+
+ grunt.registerTask('default', ['sass', 'cssmin', 'copy', 'uglify', 'doctoc']);
+};
diff --git a/LICENSE b/LICENSE
index 4739150..bf1cc11 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2014-2015 Pavel Reznikov
+Copyright (c) 2014-2016 Pavel Reznikov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 675da5e..d76fd7d 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,25 @@
gridstack.js
============
-gridstack.js is a jQuery plugin for widget layout. This is drag-and-drop multi-column grid. It allows you to build
-draggable responsive bootstrap v3 friendly layouts. It also works great with [knockout.js](http://knockoutjs.com) and
-touch devices.
+gridstack.js is a jQuery plugin for widget layout. This is drag-and-drop multi-column grid. It allows you to build
+draggable responsive bootstrap v3 friendly layouts. It also works great with [knockout.js](http://knockoutjs.com), [angular.js](https://angularjs.org) and touch devices.
Inspired by [gridster.js](http://gridster.net). Built with love.
+Join gridstack.js on Slack: https://gridstackjs.troolee.com
+
+[](https://gridstackjs.troolee.com)
+
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
- [Demo](#demo)
- [Usage](#usage)
- [Requirements](#requirements)
- - [Rails integration](#rails-integration)
+ - [Install](#install)
- [Basic usage](#basic-usage)
+ - [Migrating to v0.2.5](#migrating-to-v025)
- [Options](#options)
- [Grid attributes](#grid-attributes)
- [Item attributes](#item-attributes)
@@ -25,34 +29,41 @@ Inspired by [gridster.js](http://gridster.net). Built with love.
- [ondragstop(event, ui)](#ondragstopevent-ui)
- [onresizestart(event, ui)](#onresizestartevent-ui)
- [onresizestop(event, ui)](#onresizestopevent-ui)
+ - [disable(event)](#disableevent)
+ - [enable(event)](#enableevent)
- [API](#api)
- - [add_widget(el, x, y, width, height, auto_position)](#add_widgetel-x-y-width-height-auto_position)
- - [batch_update()](#batch_update)
- - [cell_height()](#cell_height)
- - [cell_height(val)](#cell_heightval)
- - [cell_width()](#cell_width)
+ - [addWidget(el, x, y, width, height, autoPosition)](#addwidgetel-x-y-width-height-autoposition)
+ - [batchUpdate()](#batchupdate)
+ - [cellHeight()](#cellheight)
+ - [cellHeight(val)](#cellheightval)
+ - [cellWidth()](#cellwidth)
- [commit()](#commit)
- [destroy()](#destroy)
- [disable()](#disable)
- [enable()](#enable)
- - [get_cell_from_pixel(position)](#get_cell_from_pixelposition)
- - [is_area_empty(x, y, width, height)](#is_area_emptyx-y-width-height)
+ - [getCellFromPixel(position)](#getcellfrompixelposition)
+ - [isAreaEmpty(x, y, width, height)](#isareaemptyx-y-width-height)
- [locked(el, val)](#lockedel-val)
- - [min_width(el, val)](#min_widthel-val)
- - [min_height(el, val)](#min_heightel-val)
+ - [makeWidget(el)](#makewidgetel)
+ - [maxHeight(el, val)](#maxheightel-val)
+ - [minHeight(el, val)](#minheightel-val)
+ - [maxWidth(el, val)](#maxwidthel-val)
+ - [minWidth(el, val)](#minwidthel-val)
- [movable(el, val)](#movableel-val)
- [move(el, x, y)](#moveel-x-y)
- - [remove_widget(el, detach_node)](#remove_widgetel-detach_node)
- - [remove_all()](#remove_all)
+ - [removeWidget(el, detachNode)](#removewidgetel-detachnode)
+ - [removeAll()](#removeall)
- [resize(el, width, height)](#resizeel-width-height)
- [resizable(el, val)](#resizableel-val)
- - [set_static(static_value)](#set_staticstatic_value)
+ - [setStatic(static_value)](#setstaticstatic_value)
- [update(el, x, y, width, height)](#updateel-x-y-width-height)
- - [will_it_fit(x, y, width, height, auto_position)](#will_it_fitx-y-width-height-auto_position)
+ - [willItFit(x, y, width, height, autoPosition)](#willitfitx-y-width-height-autoposition)
- [Utils](#utils)
- [GridStackUI.Utils.sort(nodes[, dir[, width]])](#gridstackuiutilssortnodes-dir-width)
- [Touch devices support](#touch-devices-support)
- [Use with knockout.js](#use-with-knockoutjs)
+ - [Use with angular.js](#use-with-angularjs)
+ - [Rails integration](#rails-integration)
- [Change grid width](#change-grid-width)
- [Extra CSS](#extra-css)
- [Different grid widths](#different-grid-widths)
@@ -62,7 +73,8 @@ Inspired by [gridster.js](http://gridster.net). Built with love.
- [IE8 support](#ie8-support)
- [Nested grids](#nested-grids)
- [Changes](#changes)
- - [v0.2.4 (development version)](#v024-development-version)
+ - [v0.2.5-dev (Development version)](#v025-dev-development-version)
+ - [v0.2.4 (2016-02-15)](#v024-2016-02-15)
- [v0.2.3 (2015-06-23)](#v023-2015-06-23)
- [v0.2.2 (2014-12-23)](#v022-2014-12-23)
- [v0.2.1 (2014-12-09)](#v021-2014-12-09)
@@ -85,28 +97,46 @@ Usage
## Requirements
* [lodash.js](https://lodash.com) (>= 3.5.0)
-* [jQuery](http://jquery.com) (>= 1.11.0)
+* [jQuery](http://jquery.com) (>= 1.11.0)
* [jQuery UI](http://jqueryui.com) (>= 1.11.0). Minimum required components: Core, Widget, Mouse, Draggable, Resizable
-* (Optional) [knockout.js](http://knockoutjs.com) (>= 3.2.0)
* (Optional) [jquery-ui-touch-punch](https://github.com/furf/jquery-ui-touch-punch) for touch-based devices support
Note: You can still use [underscore.js](http://underscorejs.org) (>= 1.7.0) instead of lodash.js
-## Rails integration
+## Install
-For rails users, integration of gridstack.js and its dependencies can be done through [gridstack-js-rails](https://github.com/randoum/gridstack-js-rails)
+* Using CDN:
+
+```html
+
+
+```
+
+* Using bower:
+
+```bash
+$ bower install gridstack
+```
+
+* Using npm:
+
+```bash
+$ npm install gridstack
+```
+
+You can download files from `dist` directory as well.
## Basic usage
```html
-
-
@@ -123,31 +153,44 @@ $(function () {
```
+## Migrating to v0.2.5
+
+As of v0.2.5 all methods and parameters are in camel case to respect [JavaScript Style Guide and Coding Conventions](http://www.w3schools.com/js/js_conventions.asp).
+All old methods and parameters are marked as deprecated and still available but a warning will be displayed in js console. They will be available until v1.0
+when they will be completely removed.
+
## Options
-- `always_show_resize_handle` - if `true` the resizing handles are shown even if the user is not hovering over the widget
- (default: `false`)
+- `alwaysShowResizeHandle` - 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` 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'}`)
+- `cellHeight` - one cell height (default: `60`). Can be:
+ - an integer (px)
+ - a string (ex: '10em', '100px', '10rem')
+ - 0 or null, in which case the library will not generate styles for rows. Everything will have to be defined in CSS files.
+- `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'`)
-- `handle_class` - draggable handle class (e.g. `'grid-stack-item-content'`). If set `handle` is ignored (default: `null`)
+- `handleClass` - draggable handle class (e.g. `'grid-stack-item-content'`). If set `handle` is ignored (default: `null`)
- `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`)
-- `placeholder_class` - class for placeholder (default: `'grid-stack-placeholder'`)
+- `itemClass` - widget class (default: `'grid-stack-item'`)
+- `minWidth` - minimal width. If window width is less, grid will be shown in one-column mode. You need also update your css file (`@media (max-width: 768px) {...}`) with corresponding value (default: `768`)
+- `placeholderClass` - class for placeholder (default: `'grid-stack-placeholder'`)
+- `placeholderText` - placeholder default content (default: `''`)
- `resizable` - allows to override jQuery UI resizable options. (default: `{autoHide: true, handles: 'se'}`)
-- `static_grid` - makes grid static (default `false`). If true widgets are not movable/resizable. You don't even need jQueryUI draggable/resizable. A CSS class `grid-stack-static` is also added to the container.
-- `vertical_margin` - vertical gap size (default: `20`)
+- `staticGrid` - makes grid static (default `false`). If true widgets are not movable/resizable. You don't even need jQueryUI draggable/resizable. A CSS class `grid-stack-static` is also added to the container.
+- `verticalMargin` - vertical gap size (default: `20`). Can be:
+ - an integer (px)
+ - a string (ex: '2em', '20px', '2rem')
- `width` - amount of columns (default: `12`)
## Grid attributes
-- `data-gs-animate` - turns animation on
+- `data-gs-animate` - turns animation on
- `data-gs-width` - amount of columns
- `data-gs-height` - maximum rows amount. Default is `0` which means no maximum rows.
+- `data-gs-current-height` - current rows amount. Set by the library only. Can be used by the CSS rules.
## Item attributes
@@ -155,13 +198,13 @@ $(function () {
- `data-gs-width`, `data-gs-height` - element size
- `data-gs-max-width`, `data-gs-min-width`, `data-gs-max-height`, `data-gs-min-height` - element constraints
- `data-gs-no-resize` - disable element resizing
-- `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
+- `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 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
### onchange(items)
@@ -169,12 +212,12 @@ to completely lock the widget.
Occurs when adding/removing widgets or existing widgets change their position/size
```javascript
-var serialize_widget_map = function (items) {
+var serializeWidgetMap = function (items) {
console.log(items);
};
$('.grid-stack').on('change', function (e, items) {
- serialize_widget_map(items);
+ serializeWidgetMap(items);
});
```
@@ -214,10 +257,25 @@ $('.grid-stack').on('resizestop', function (event, ui) {
});
```
+### disable(event)
+
+```javascript
+$('.grid-stack').on('disable', function(event) {
+ var grid = event.target;
+});
+```
+
+### enable(event)
+
+```javascript
+$('.grid-stack').on('enable', function(event) {
+ var grid = event.target;
+});
+```
## API
-### add_widget(el, x, y, width, height, auto_position)
+### addWidget(el, x, y, width, height, autoPosition)
Creates new widget and returns it.
@@ -225,7 +283,7 @@ Parameters:
- `el` - widget to add
- `x`, `y`, `width`, `height` - widget position/dimensions (Optional)
-- `auto_position` - if `true` then `x`, `y` parameters will be ignored and widget will be places on the first available
+- `autoPosition` - 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 is more than actual grid height. You need to use `will_it_fit` method
@@ -235,37 +293,37 @@ before calling `add_widget` for additional check.
$('.grid-stack').gridstack();
var grid = $('.grid-stack').data('gridstack');
-grid.add_widget(el, 0, 0, 3, 2, true);
+grid.addWidget(el, 0, 0, 3, 2, true);
```
-### batch_update()
+### batchUpdate()
-Initailizes batch updates. You will see no changes until `commit` method is called.
+Initailizes batch updates. You will see no changes until `commit` method is called.
-### cell_height()
+### cellHeight()
Gets current cell height.
-### cell_height(val)
+### cellHeight(val)
Update current cell height. This method rebuilds an internal CSS stylesheet. Note: You can expect performance issues if
call this method too often.
```javascript
-grid.cell_height(grid.cell_width() * 1.2);
+grid.cellHeight(grid.cellWidth() * 1.2);
```
-### cell_width()
+### cellWidth()
Gets current cell width.
### commit()
-Finishes batch updates. Updates DOM nodes. You must call it after `batch_update`.
+Finishes batch updates. Updates DOM nodes. You must call it after `batchUpdate`.
### destroy()
-Destroys a grid instance.
+Destroys a grid instance.
### disable()
@@ -285,7 +343,7 @@ grid.movable('.grid-stack-item', true);
grid.resizable('.grid-stack-item', true);
```
-### get_cell_from_pixel(position)
+### getCellFromPixel(position)
Get the position of the cell under a pixel on screen.
@@ -295,7 +353,7 @@ Parameters :
Returns an object with properties `x` and `y` i.e. the column and row in the grid.
-### is_area_empty(x, y, width, height)
+### isAreaEmpty(x, y, width, height)
Checks if specified area is empty.
@@ -304,21 +362,52 @@ Checks if specified area is empty.
Locks/unlocks widget.
- `el` - widget to modify.
-- `val` - if `true` widget will be locked.
+- `val` - if `true` widget will be locked.
-### min_width(el, val)
+### makeWidget(el)
-Set the minWidth for a widget.
+If you add elements to your gridstack container by hand, you have to tell gridstack afterwards to make them widgets. If you want gridstack to add the elements for you, use `add_widget` instead.
+Makes the given element a widget and returns it.
+
+Parameters:
+
+- `el` - element to convert to a widget
+
+```javascript
+$('.grid-stack').gridstack();
+
+$('.grid-stack').append('')
+var grid = $('.grid-stack').data('gridstack');
+grid.makeWidget('gsi-1');
+```
+
+### maxHeight(el, val)
+
+Set the `maxHeight` for a widget.
+
+- `el` - widget to modify.
+- `val` - A numeric value of the number of rows
+
+### minHeight(el, val)
+
+Set the `minHeight` for a widget.
+
+- `el` - widget to modify.
+- `val` - A numeric value of the number of rows
+
+### maxWidth(el, val)
+
+Set the `maxWidth` for a widget.
- `el` - widget to modify.
- `val` - A numeric value of the number of columns
-### min_height(el, val)
+### minWidth(el, val)
-Set the minHeight for a widget.
+Set the `minWidth` for a widget.
- `el` - widget to modify.
-- `val` - A numeric value of the number of rows
+- `val` - A numeric value of the number of columns
### movable(el, val)
@@ -336,16 +425,16 @@ Parameters:
- `el` - widget to move
- `x`, `y` - new position. If value is `null` or `undefined` it will be ignored.
-### remove_widget(el, detach_node)
+### removeWidget(el, detachNode)
Removes widget from the grid.
Parameters:
- `el` - widget to remove.
-- `detach_node` - if `false` DOM node won't be removed from the tree (Optional. Default `true`).
+- `detachNode` - if `false` DOM node won't be removed from the tree (Optional. Default `true`).
-### remove_all()
+### removeAll()
Removes all widgets from the grid.
@@ -363,13 +452,13 @@ Parameters:
Enables/Disables resizing.
- `el` - widget to modify
-- `val` - if `true` widget will be resizable.
+- `val` - if `true` widget will be resizable.
-### set_static(static_value)
+### setStatic(static_value)
Toggle the grid static state. Also toggle the `grid-stack-static` class.
-- `static_value` - if `true` the grid become static.
+- `static_value` - if `true` the grid become static.
### update(el, x, y, width, height)
@@ -381,20 +470,20 @@ Parameters:
Updates widget position/size.
-### will_it_fit(x, y, width, height, auto_position)
+### willItFit(x, y, width, height, autoPosition)
Returns `true` if the `height` of the grid will be less the vertical constraint. Always returns `true` if grid doesn't
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.el, new_node.x, new_node.y, new_node.width, new_node.height, true);
+if (grid.willItFit(newNode.x, newNode.y, newNode.width, newNode.height, true)) {
+ grid.addWidget(newNode.el, newNode.x, newNode.y, newNode.width, newNode.height, true);
}
else {
alert('Not enough free space to place the widget');
}
```
-
+
## Utils
@@ -420,7 +509,7 @@ working on touch-based devices.
```
-Also `always_show_resize_handle` option may be useful:
+Also `alwaysShowResizeHandle` option may be useful:
```javascript
$(function () {
@@ -450,9 +539,9 @@ ko.components.register('dashboard-grid', {
}
var item = _.find(items, function (i) { return i.nodeType == 1 });
- grid.add_widget(item);
+ grid.addWidget(item);
ko.utils.domNodeDisposal.addDisposeCallback(item, function () {
- grid.remove_widget(item);
+ grid.removeWidget(item);
});
};
};
@@ -496,7 +585,7 @@ See examples: [example 1](http://troolee.github.io/gridstack.js/demo/knockout.ht
**Notes:** It's very important to exclude training spaces after widget template:
-```
+```javascript
template:
[
'
',
@@ -504,16 +593,26 @@ template:
' ....',
'
', // <-- NO SPACE **AFTER**
' ' // <-- NO SPACE **BEFORE**
- ].join('') // <-- JOIN WITH **EMPTY** STRING
+ ].join('') // <-- JOIN WITH **EMPTY** STRING
```
Otherwise `addDisposeCallback` won't work.
+## Use with angular.js
+
+Please check [gridstack-angular](https://github.com/kdietrich/gridstack-angular)
+
+
+## Rails integration
+
+For rails users, integration of gridstack.js and its dependencies can be done through [gridstack-js-rails](https://github.com/randoum/gridstack-js-rails)
+
+
## Change grid width
-To change grid width (columns count), to addition to `width` option, CSS rules
-for `.grid-stack-item[data-gs-width="X"]` and `.grid-stack-item[data-gs-x="X"]` have to be changed accordingly.
+To change grid width (columns count), to addition to `width` option, CSS rules
+for `.grid-stack-item[data-gs-width="X"]` and `.grid-stack-item[data-gs-x="X"]` have to be changed accordingly.
For instance for 3-column grid you need to rewrite CSS to be:
@@ -562,7 +661,7 @@ Or you can include `gridstack-extra.css`. See below for more details.
## Extra CSS
There are few extra CSS batteries in `gridstack-extra.css` (`gridstack-extra.min.css`).
-
+
### Different grid widths
You can use other than 12 grid width:
@@ -579,7 +678,7 @@ See example: [2 grids demo](http://troolee.github.io/gridstack.js/demo/two.html)
## Save grid to array
Because gridstack doesn't track any kind of user-defined widget id there is no reason to make serialization to be part
-of gridstack API. To serialize grid you can simply do something like this (let's say you store widget id inside `data-custom-id`
+of gridstack API. To serialize grid you can simply do something like this (let's say you store widget id inside `data-custom-id`
attribute):
```javascript
@@ -599,7 +698,7 @@ alert(JSON.stringify(res));
See example: [Serialization demo](http://troolee.github.io/gridstack.js/demo/serialization.html)
-You can also use `onchange` event if you need to save only changed widgets right away they have been changed.
+You can also use `onchange` event if you need to save only changed widgets right away they have been changed.
## Load grid from array
@@ -618,10 +717,10 @@ var serialization = [
serialization = GridStackUI.Utils.sort(serialization);
var grid = $('.grid-stack').data('gridstack');
-grid.remove_all();
+grid.removeAll();
_.each(serialization, function (node) {
- grid.add_widget($('
'),
+ grid.addWidget($('
'),
node.x, node.y, node.width, node.height);
});
```
@@ -687,26 +786,36 @@ for i in range(N):
print '.grid-stack > .grid-stack-item[data-gs-y="%(index)s"] { top: %(height)spx }' % {'index': i , 'height': h}
```
-There are at least two more issues with gridstack in IE8 with jQueryUI resizable (it seems it doesn't work) and
-droppable. If you have any suggestions about support of IE8 you are welcome here: https://github.com/troolee/gridstack.js/issues/76
+There are at least two more issues with gridstack in IE8 with jQueryUI resizable (it seems it doesn't work) and
+droppable. If you have any suggestions about support of IE8 you are welcome here: https://github.com/troolee/gridstack.js/issues/76
## Nested grids
-Gridstack may be nested. All nested grids have an additional class `grid-stack-nested` which is assigned automatically
-during initialization.
+Gridstack may be nested. All nested grids have an additional class `grid-stack-nested` which is assigned automatically
+during initialization.
See example: [Nested grid demo](http://troolee.github.io/gridstack.js/demo/nested.html)
Changes
=======
-#### v0.2.4 (development version)
+#### v0.2.5-dev (Development version)
+
+- update names to respect js naming convention
+- `cellHeight` and `verticalMargin` can now be string (e.g. '3em', '20px') (Thanks to @jlowcs)
+- add `maxWidth`/`maxHeight` methods.
+
+#### v0.2.4 (2016-02-15)
- fix closure compiler/linter warnings
- add `static_grid` option.
- add `min_width`/`min_height` methods (Thanks to @cvillemure)
- add `destroy` method (Thanks to @zspitzer)
+- add `placeholder_text` option (Thanks to @slauyama)
+- add `handle_class` option.
+- add `make_widget` method.
+- lodash v 4.x support (Thanks to Andy Robbins)
#### v0.2.3 (2015-06-23)
@@ -748,7 +857,7 @@ Changes
- auto-generate css rules (widgets `height` and `top`)
- add `GridStackUI.Utils.sort` utility function
- add `remove_all` API method
-- add `resize` and `move` API methods
+- add `resize` and `move` API methods
- add `resizable` and `movable` API methods
- add `data-gs-no-move` attribute
- add `float` option
@@ -765,7 +874,7 @@ License
The MIT License (MIT)
-Copyright (c) 2014-2015 Pavel Reznikov
+Copyright (c) 2014-2016 Pavel Reznikov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -784,4 +893,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-
diff --git a/bower.json b/bower.json
index 4428d53..704477a 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "gridstack",
- "version": "0.2.3",
+ "version": "0.2.5-dev",
"homepage": "https://github.com/troolee/gridstack.js",
"authors": [
"Pavel Reznikov "
diff --git a/demo/float.html b/demo/float.html
index 638ec2a..fe5bc7c 100644
--- a/demo/float.html
+++ b/demo/float.html
@@ -68,18 +68,19 @@
this.grid = $('.grid-stack').data('gridstack');
- this.add_new_widget = function () {
+ this.addNewWidget = function () {
var node = this.items.pop() || {
x: 12 * Math.random(),
y: 5 * Math.random(),
width: 1 + 3 * Math.random(),
height: 1 + 3 * Math.random()
};
- this.grid.add_widget($('