Merged changes

This commit is contained in:
martynsmall 2015-08-06 15:35:07 +01:00
commit 5e06c68e98
14 changed files with 2954 additions and 259 deletions

View file

@ -31,17 +31,21 @@ Inspired by [gridster.js](http://gridster.net). Built with love.
- [cell_height(val)](#cell_heightval)
- [cell_width()](#cell_width)
- [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)
- [locked(el, val)](#lockedel-val)
- [min_width(el, val)](#min_widthel-val)
- [min_height(el, val)](#min_heightel-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)
- [resize(el, width, height)](#resizeel-width-height)
- [move(el, x, y)](#moveel-x-y)
- [resizable(el, val)](#resizableel-val)
- [movable(el, val)](#movableel-val)
- [set_static(static_value)](#set_staticstatic_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)
- [Utils](#utils)
@ -49,13 +53,16 @@ Inspired by [gridster.js](http://gridster.net). Built with love.
- [Touch devices support](#touch-devices-support)
- [Use with knockout.js](#use-with-knockoutjs)
- [Change grid width](#change-grid-width)
- [Extra CSS](#extra-css)
- [Different grid widths](#different-grid-widths)
- [Save grid to array](#save-grid-to-array)
- [Load grid from array](#load-grid-from-array)
- [Override resizable/draggable options](#override-resizabledraggable-options)
- [IE8 support](#ie8-support)
- [Nested grids](#nested-grids)
- [Changes](#changes)
- [v0.2.3 (development version)](#v023-development-version)
- [v0.2.4 (development version)](#v024-development-version)
- [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)
- [v0.2.0 (2014-11-30)](#v020-2014-11-30)
@ -126,6 +133,7 @@ $(function () {
- `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'}`)
- `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`)
- `width` - amount of columns (default: `12`)
@ -152,7 +160,7 @@ to completely lock the widget.
### onchange(items)
Occurs when widgets change their position/size
Occurs when adding/removing widgets or existing widgets change their position/size
```javascript
var serialize_widget_map = function (items) {
@ -249,6 +257,10 @@ Gets current cell width.
Finishes batch updates. Updates DOM nodes. You must call it after `batch_update`.
### destroy()
Destroys a grid instance.
### disable()
Disables widgets moving/resizing. This is a shortcut for:
@ -288,6 +300,36 @@ Locks/unlocks widget.
- `el` - widget to modify.
- `val` - if `true` widget will be locked.
### min_width(el, val)
Set the minWidth for a widget.
- `el` - widget to modify.
- `val` - A numeric value of the number of columns
### min_height(el, val)
Set the minHeight for a widget.
- `el` - widget to modify.
- `val` - A numeric value of the number of rows
### movable(el, val)
Enables/Disables moving.
- `el` - widget to modify
- `val` - if `true` widget will be draggable.
### move(el, x, y)
Changes widget position
Parameters:
- `el` - widget to move
- `x`, `y` - new position. If value is `null` or `undefined` it will be ignored.
### remove_widget(el, detach_node)
Removes widget from the grid.
@ -310,15 +352,6 @@ Parameters:
- `el` - widget to resize
- `width`, `height` - new dimensions. If value is `null` or `undefined` it will be ignored.
### move(el, x, y)
Changes widget position
Parameters:
- `el` - widget to move
- `x`, `y` - new position. If value is `null` or `undefined` it will be ignored.
### resizable(el, val)
Enables/Disables resizing.
@ -326,12 +359,11 @@ Enables/Disables resizing.
- `el` - widget to modify
- `val` - if `true` widget will be resizable.
### movable(el, val)
### set_static(static_value)
Enables/Disables moving.
Toggle the grid static state. Also toggle the `grid-stack-static` class.
- `el` - widget to modify
- `val` - if `true` widget will be draggable.
- `static_value` - if `true` the grid become static.
### update(el, x, y, width, height)
@ -519,6 +551,25 @@ Here is a SASS code snipped which can make life easier (Thanks to @ascendantofra
}
```
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:
```html
<div class="grid-stack grid-stack-N">...</div>
```
```javascript
$('.grid-stack').gridstack({width: N});
```
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
@ -644,8 +695,16 @@ See example: [Nested grid demo](http://troolee.github.io/gridstack.js/demo/neste
Changes
=======
#### v0.2.3 (development version)
#### v0.2.4 (development version)
- fix closure compiler/linter warnings
- add `static_grid` option.
- add `min_width`/`min_height` methods (Thanks to @cvillemure)
- add `destroy` method (Thanks to @zspitzer)
#### v0.2.3 (2015-06-23)
- gridstack-extra.css
- add support of lodash.js
- add `is_area_empty` method
- nested grids

View file

@ -1,6 +1,6 @@
{
"name": "gridstack",
"version": "0.2.2",
"version": "0.2.3",
"homepage": "https://github.com/troolee/gridstack.js",
"authors": [
"Pavel Reznikov <pashka.reznikov@gmail.com>"

View file

@ -56,6 +56,7 @@
<script type="text/javascript">
$(function () {
var options = {
static_grid: true
};
$('.grid-stack').gridstack(options);

85
demo/two.html Normal file
View file

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Two grids demo</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="../dist/gridstack.css"/>
<link rel="stylesheet" href="../dist/gridstack-extra.css"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="../dist/gridstack.js"></script>
<style type="text/css">
#grid1 {
background: lightgoldenrodyellow;
}
#grid2 {
background: lightcyan;
}
.grid-stack-item-content {
color: #2c3e50;
text-align: center;
background-color: #18bc9c;
}
</style>
</head>
<body>
<div class="container-fluid">
<h1>Two grids demo</h1>
<div class="row">
<div class="col-md-6">
<div class="grid-stack grid-stack-6" id="grid1">
</div>
</div>
<div class="col-md-6">
<div class="grid-stack grid-stack-6" id="grid2">
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
var options = {
width: 6,
float: true
};
$('#grid1').gridstack(options);
$('#grid2').gridstack(options);
var items = [
{x: 0, y: 0, width: 2, height: 2},
{x: 3, y: 1, width: 1, height: 2},
{x: 4, y: 1, width: 1, height: 1},
{x: 2, y: 3, width: 3, height: 1},
{x: 2, y: 5, width: 1, height: 1}
];
$('.grid-stack').each(function () {
var grid = $(this).data('gridstack');
_.each(items, function (node) {
grid.add_widget($('<div><div class="grid-stack-item-content" /><div/>'),
node.x, node.y, node.width, node.height);
}, this);
});
});
</script>
</body>
</html>

983
dist/gridstack-extra.css vendored Normal file
View file

@ -0,0 +1,983 @@
.grid-stack.grid-stack-1 > .grid-stack-item {
min-width: 100%;
}
.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-width='1'] {
width: 100%;
}
.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-x='1'] {
left: 100%;
}
.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 100%;
}
.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 100%;
}
.grid-stack.grid-stack-2 > .grid-stack-item {
min-width: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-width='1'] {
width: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-x='1'] {
left: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-width='2'] {
width: 100%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-x='2'] {
left: 100%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 100%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 100%;
}
.grid-stack.grid-stack-3 > .grid-stack-item {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='1'] {
width: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='1'] {
left: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='2'] {
width: 66.66666667%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='2'] {
left: 66.66666667%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 66.66666667%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 66.66666667%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='3'] {
width: 100%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='3'] {
left: 100%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 100%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 100%;
}
.grid-stack.grid-stack-4 > .grid-stack-item {
min-width: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='1'] {
width: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='1'] {
left: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='2'] {
width: 50%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='2'] {
left: 50%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 50%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 50%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='3'] {
width: 75%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='3'] {
left: 75%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 75%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 75%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='4'] {
width: 100%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='4'] {
left: 100%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 100%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 100%;
}
.grid-stack.grid-stack-5 > .grid-stack-item {
min-width: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='1'] {
width: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='1'] {
left: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='2'] {
width: 40%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='2'] {
left: 40%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 40%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 40%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='3'] {
width: 60%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='3'] {
left: 60%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 60%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 60%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='4'] {
width: 80%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='4'] {
left: 80%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 80%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 80%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='5'] {
width: 100%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='5'] {
left: 100%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 100%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 100%;
}
.grid-stack.grid-stack-6 > .grid-stack-item {
min-width: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='1'] {
width: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='1'] {
left: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='2'] {
width: 33.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='2'] {
left: 33.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 33.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='3'] {
width: 50%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='3'] {
left: 50%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 50%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 50%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='4'] {
width: 66.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='4'] {
left: 66.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 66.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 66.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='5'] {
width: 83.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='5'] {
left: 83.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 83.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 83.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='6'] {
width: 100%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='6'] {
left: 100%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 100%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 100%;
}
.grid-stack.grid-stack-7 > .grid-stack-item {
min-width: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='1'] {
width: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='1'] {
left: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='2'] {
width: 28.57142857%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='2'] {
left: 28.57142857%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 28.57142857%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 28.57142857%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='3'] {
width: 42.85714286%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='3'] {
left: 42.85714286%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 42.85714286%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 42.85714286%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='4'] {
width: 57.14285714%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='4'] {
left: 57.14285714%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 57.14285714%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 57.14285714%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='5'] {
width: 71.42857143%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='5'] {
left: 71.42857143%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 71.42857143%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 71.42857143%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='6'] {
width: 85.71428571%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='6'] {
left: 85.71428571%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 85.71428571%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 85.71428571%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='7'] {
width: 100%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='7'] {
left: 100%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 100%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 100%;
}
.grid-stack.grid-stack-8 > .grid-stack-item {
min-width: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='1'] {
width: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='1'] {
left: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='2'] {
width: 25%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='2'] {
left: 25%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 25%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 25%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='3'] {
width: 37.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='3'] {
left: 37.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 37.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 37.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='4'] {
width: 50%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='4'] {
left: 50%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 50%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 50%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='5'] {
width: 62.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='5'] {
left: 62.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 62.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 62.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='6'] {
width: 75%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='6'] {
left: 75%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 75%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 75%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='7'] {
width: 87.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='7'] {
left: 87.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 87.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 87.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='8'] {
width: 100%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='8'] {
left: 100%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 100%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 100%;
}
.grid-stack.grid-stack-9 > .grid-stack-item {
min-width: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='1'] {
width: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='1'] {
left: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='2'] {
width: 22.22222222%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='2'] {
left: 22.22222222%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 22.22222222%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 22.22222222%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='3'] {
width: 33.33333333%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='3'] {
left: 33.33333333%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 33.33333333%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='4'] {
width: 44.44444444%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='4'] {
left: 44.44444444%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 44.44444444%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 44.44444444%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='5'] {
width: 55.55555556%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='5'] {
left: 55.55555556%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 55.55555556%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 55.55555556%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='6'] {
width: 66.66666667%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='6'] {
left: 66.66666667%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 66.66666667%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 66.66666667%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='7'] {
width: 77.77777778%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='7'] {
left: 77.77777778%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 77.77777778%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 77.77777778%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='8'] {
width: 88.88888889%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='8'] {
left: 88.88888889%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 88.88888889%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 88.88888889%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='9'] {
width: 100%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='9'] {
left: 100%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='9'] {
min-width: 100%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='9'] {
max-width: 100%;
}
.grid-stack.grid-stack-10 > .grid-stack-item {
min-width: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='1'] {
width: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='1'] {
left: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='2'] {
width: 20%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='2'] {
left: 20%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 20%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 20%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='3'] {
width: 30%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='3'] {
left: 30%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 30%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 30%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='4'] {
width: 40%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='4'] {
left: 40%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 40%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 40%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='5'] {
width: 50%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='5'] {
left: 50%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 50%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 50%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='6'] {
width: 60%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='6'] {
left: 60%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 60%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 60%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='7'] {
width: 70%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='7'] {
left: 70%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 70%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 70%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='8'] {
width: 80%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='8'] {
left: 80%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 80%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 80%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='9'] {
width: 90%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='9'] {
left: 90%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='9'] {
min-width: 90%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='9'] {
max-width: 90%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='10'] {
width: 100%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='10'] {
left: 100%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='10'] {
min-width: 100%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='10'] {
max-width: 100%;
}
.grid-stack.grid-stack-11 > .grid-stack-item {
min-width: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='1'] {
width: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='1'] {
left: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='2'] {
width: 18.18181818%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='2'] {
left: 18.18181818%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 18.18181818%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 18.18181818%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='3'] {
width: 27.27272727%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='3'] {
left: 27.27272727%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 27.27272727%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 27.27272727%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='4'] {
width: 36.36363636%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='4'] {
left: 36.36363636%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 36.36363636%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 36.36363636%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='5'] {
width: 45.45454545%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='5'] {
left: 45.45454545%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 45.45454545%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 45.45454545%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='6'] {
width: 54.54545455%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='6'] {
left: 54.54545455%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 54.54545455%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 54.54545455%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='7'] {
width: 63.63636364%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='7'] {
left: 63.63636364%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 63.63636364%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 63.63636364%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='8'] {
width: 72.72727273%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='8'] {
left: 72.72727273%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 72.72727273%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 72.72727273%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='9'] {
width: 81.81818182%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='9'] {
left: 81.81818182%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='9'] {
min-width: 81.81818182%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='9'] {
max-width: 81.81818182%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='10'] {
width: 90.90909091%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='10'] {
left: 90.90909091%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='10'] {
min-width: 90.90909091%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='10'] {
max-width: 90.90909091%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='11'] {
width: 100.0%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='11'] {
left: 100.0%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='11'] {
min-width: 100.0%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='11'] {
max-width: 100.0%;
}
.grid-stack.grid-stack-12 > .grid-stack-item {
min-width: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='1'] {
width: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='1'] {
left: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='2'] {
width: 16.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='2'] {
left: 16.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 16.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 16.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='3'] {
width: 25%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='3'] {
left: 25%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 25%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 25%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='4'] {
width: 33.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='4'] {
left: 33.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 33.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='5'] {
width: 41.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='5'] {
left: 41.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 41.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 41.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='6'] {
width: 50%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='6'] {
left: 50%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 50%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 50%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='7'] {
width: 58.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='7'] {
left: 58.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 58.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 58.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='8'] {
width: 66.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='8'] {
left: 66.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 66.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 66.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='9'] {
width: 75%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='9'] {
left: 75%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='9'] {
min-width: 75%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='9'] {
max-width: 75%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='10'] {
width: 83.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='10'] {
left: 83.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='10'] {
min-width: 83.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='10'] {
max-width: 83.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='11'] {
width: 91.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='11'] {
left: 91.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='11'] {
min-width: 91.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='11'] {
max-width: 91.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='12'] {
width: 100%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='12'] {
left: 100%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='12'] {
min-width: 100%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='12'] {
max-width: 100%;
}

1
dist/gridstack-extra.min.css vendored Normal file

File diff suppressed because one or more lines are too long

349
dist/gridstack.js vendored
View file

@ -1,54 +1,57 @@
// gridstack.js 0.2.3-dev
// gridstack.js 0.2.4-dev
// http://troolee.github.io/gridstack.js/
// (c) 2014-2015 Pavel Reznikov
// gridstack.js may be freely distributed under the MIT license.
(function (factory) {
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'lodash'], factory);
define(['jquery', 'lodash', 'jquery-ui/core', 'jquery-ui/widget', 'jquery-ui/mouse', 'jquery-ui/draggable',
'jquery-ui/resizable'], factory);
}
else {
factory(jQuery, _);
}
})(function ($, _) {
})(function($, _) {
var scope = window;
var Utils = {
is_intercepted: function (a, b) {
is_intercepted: function(a, b) {
return !(a.x + a.width <= b.x || b.x + b.width <= a.x || a.y + a.height <= b.y || b.y + b.height <= a.y);
},
sort: function (nodes, dir, width) {
width = width || _.chain(nodes).map(function (node) { return node.x + node.width; }).max().value();
sort: function(nodes, dir, width) {
width = width || _.chain(nodes).map(function(node) { return node.x + node.width; }).max().value();
dir = dir != -1 ? 1 : -1;
return _.sortBy(nodes, function (n) { return dir * (n.x + n.y * width); });
return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); });
},
create_stylesheet: function (id) {
var style = document.createElement("style");
style.setAttribute("type", "text/css");
style.setAttribute("data-gs-id", id);
create_stylesheet: function(id) {
var style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.setAttribute('data-gs-id', id);
if (style.styleSheet) {
style.styleSheet.cssText = "";
style.styleSheet.cssText = '';
}
else {
style.appendChild(document.createTextNode(""));
style.appendChild(document.createTextNode(''));
}
document.getElementsByTagName('head')[0].appendChild(style);
return style.sheet;
},
insert_css_rule: function (sheet, selector, rules, index) {
if(typeof sheet.insertRule === 'function') {
sheet.insertRule(selector + "{" + rules + "}", index);
remove_stylesheet: function(id) {
$("STYLE[data-gs-id=" + id +"]").remove();
},
insert_css_rule: function(sheet, selector, rules, index) {
if (typeof sheet.insertRule === 'function') {
sheet.insertRule(selector + '{' + rules + '}', index);
}
else if(typeof sheet.addRule === 'function') {
else if (typeof sheet.addRule === 'function') {
sheet.addRule(selector, rules, index);
}
},
toBool: function (v) {
toBool: function(v) {
if (typeof v == 'boolean')
return v;
if (typeof v == 'string') {
@ -61,24 +64,24 @@
var id_seq = 0;
var GridStackEngine = function (width, onchange, float, height, items) {
var GridStackEngine = function(width, onchange, float_mode, height, items) {
this.width = width;
this.float = float || false;
this['float'] = float_mode || false;
this.height = height || 0;
this.nodes = items || [];
this.onchange = onchange || function () {};
this.onchange = onchange || function() {};
this._update_counter = 0;
this._float = this.float;
this._float = this['float'];
};
GridStackEngine.prototype.batch_update = function () {
GridStackEngine.prototype.batch_update = function() {
this._update_counter = 1;
this.float = true;
};
GridStackEngine.prototype.commit = function () {
GridStackEngine.prototype.commit = function() {
this._update_counter = 0;
if (this._update_counter == 0) {
this.float = this._float;
@ -87,16 +90,16 @@
}
};
GridStackEngine.prototype._fix_collisions = function (node) {
GridStackEngine.prototype._fix_collisions = function(node) {
this._sort_nodes(-1);
var nn = node, has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
var nn = node, has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked }));
if (!this.float && !has_locked) {
nn = {x: 0, y: node.y, width: this.width, height: node.height};
}
while (true) {
var collision_node = _.find(this.nodes, function (n) {
var collision_node = _.find(this.nodes, function(n) {
return n != node && Utils.is_intercepted(n, nn);
}, this);
if (typeof collision_node == 'undefined') {
@ -107,31 +110,32 @@
}
};
GridStackEngine.prototype.is_area_empty = function (x, y, width, height) {
GridStackEngine.prototype.is_area_empty = function(x, y, width, height) {
var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1};
var collision_node = _.find(this.nodes, function (n) {
var collision_node = _.find(this.nodes, function(n) {
return Utils.is_intercepted(n, nn);
}, this);
return collision_node == null;
};
GridStackEngine.prototype._sort_nodes = function (dir) {
GridStackEngine.prototype._sort_nodes = function(dir) {
this.nodes = Utils.sort(this.nodes, dir, this.width);
};
GridStackEngine.prototype._pack_nodes = function () {
GridStackEngine.prototype._pack_nodes = function() {
this._sort_nodes();
if (this.float) {
_.each(this.nodes, function (n, i) {
_.each(this.nodes, function(n, i) {
if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y)
return;
var new_y = n.y;
while (new_y >= n._orig_y) {
var collision_node = _.chain(this.nodes)
.find(function (bn) {
return n != bn && Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
.find(function(bn) {
return n != bn &&
Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
})
.value();
@ -144,7 +148,7 @@
}, this);
}
else {
_.each(this.nodes, function (n, i) {
_.each(this.nodes, function(n, i) {
if (n.locked)
return;
while (n.y > 0) {
@ -154,7 +158,7 @@
if (i > 0) {
var collision_node = _.chain(this.nodes)
.take(i)
.find(function (bn) {
.find(function(bn) {
return Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
})
.value();
@ -171,7 +175,7 @@
}
};
GridStackEngine.prototype._prepare_node = function (node, resizing) {
GridStackEngine.prototype._prepare_node = function(node, resizing) {
node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0 });
node.x = parseInt('' + node.x);
@ -213,7 +217,7 @@
return node;
};
GridStackEngine.prototype._notify = function () {
GridStackEngine.prototype._notify = function() {
if (this._update_counter) {
return;
}
@ -222,12 +226,12 @@
this.onchange(deleted_nodes);
};
GridStackEngine.prototype.clean_nodes = function () {
_.each(this.nodes, function (n) {n._dirty = false });
GridStackEngine.prototype.clean_nodes = function() {
_.each(this.nodes, function(n) {n._dirty = false });
};
GridStackEngine.prototype.get_dirty_nodes = function () {
return _.filter(this.nodes, function (n) { return n._dirty; });
GridStackEngine.prototype.get_dirty_nodes = function() {
return _.filter(this.nodes, function(n) { return n._dirty; });
};
GridStackEngine.prototype.add_node = function(node) {
@ -244,12 +248,12 @@
if (node.auto_position) {
this._sort_nodes();
for (var i = 0; ; ++i) {
for (var i = 0;; ++i) {
var x = i % this.width, y = Math.floor(i / this.width);
if (x + node.width > this.width) {
continue;
}
if (!_.find(this.nodes, function (n) {
if (!_.find(this.nodes, function(n) {
return Utils.is_intercepted({x: x, y: y, width: node.width, height: node.height}, n);
})) {
node.x = x;
@ -267,15 +271,15 @@
return node;
};
GridStackEngine.prototype.remove_node = function (node) {
GridStackEngine.prototype.remove_node = function(node) {
node._id = null;
this.nodes = _.without(this.nodes, node);
this._pack_nodes();
this._notify(node);
};
GridStackEngine.prototype.can_move_node = function (node, x, y, width, height) {
var has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
GridStackEngine.prototype.can_move_node = function(node, x, y, width, height) {
var has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked }));
if (!this.height && !has_locked)
return true;
@ -286,21 +290,29 @@
null,
this.float,
0,
_.map(this.nodes, function (n) { if (n == node) { cloned_node = $.extend({}, n); return cloned_node; } return $.extend({}, n) }));
_.map(this.nodes, function(n) {
if (n == node) {
cloned_node = $.extend({}, n);
return cloned_node;
}
return $.extend({}, n);
}));
clone.move_node(cloned_node, x, y, width, height);
var res = true;
if (has_locked)
res &= !Boolean(_.find(clone.nodes, function (n) { return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty); }));
res &= !Boolean(_.find(clone.nodes, function(n) {
return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty);
}));
if (this.height)
res &= clone.get_grid_height() <= this.height;
return res;
};
GridStackEngine.prototype.can_be_placed_with_respect_to_height = function (node) {
GridStackEngine.prototype.can_be_placed_with_respect_to_height = function(node) {
if (!this.height)
return true;
@ -309,12 +321,12 @@
null,
this.float,
0,
_.map(this.nodes, function (n) { return $.extend({}, n) }));
_.map(this.nodes, function(n) { return $.extend({}, n) }));
clone.add_node(node);
return clone.get_grid_height() <= this.height;
};
GridStackEngine.prototype.move_node = function (node, x, y, width, height, no_pack) {
GridStackEngine.prototype.move_node = function(node, x, y, width, height, no_pack) {
if (typeof x != 'number') x = node.x;
if (typeof y != 'number') y = node.y;
if (typeof width != 'number') width = node.width;
@ -347,28 +359,28 @@
return node;
};
GridStackEngine.prototype.get_grid_height = function () {
return _.reduce(this.nodes, function (memo, n) { return Math.max(memo, n.y + n.height); }, 0);
GridStackEngine.prototype.get_grid_height = function() {
return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0);
};
GridStackEngine.prototype.begin_update = function (node) {
_.each(this.nodes, function (n) {
GridStackEngine.prototype.begin_update = function(node) {
_.each(this.nodes, function(n) {
n._orig_y = n.y;
});
node._updating = true;
};
GridStackEngine.prototype.end_update = function () {
_.each(this.nodes, function (n) {
GridStackEngine.prototype.end_update = function() {
_.each(this.nodes, function(n) {
n._orig_y = n.y;
});
var n = _.find(this.nodes, function (n) { return n._updating; });
var n = _.find(this.nodes, function(n) { return n._updating; });
if (n) {
n._updating = false;
}
};
var GridStack = function (el, opts) {
var GridStack = function(el, opts) {
var self = this, one_column_mode;
this.container = $(el);
@ -387,6 +399,7 @@
auto: true,
min_width: 768,
float: false,
static_grid: false,
_class: 'grid-stack-' + (Math.random() * 10000).toFixed(0),
animate: Boolean(this.container.attr('data-gs-animate')) || false,
always_show_resize_handle: opts.always_show_resize_handle || false,
@ -403,15 +416,18 @@
this.opts.is_nested = is_nested;
this.container.addClass(this.opts._class);
this._set_static_class();
if (is_nested) {
this.container.addClass('grid-stack-nested');
}
this._init_styles();
this.grid = new GridStackEngine(this.opts.width, function (nodes) {
this.grid = new GridStackEngine(this.opts.width, function(nodes) {
var max_height = 0;
_.each(nodes, function (n) {
_.each(nodes, function(n) {
if (n._id == null) {
n.el.remove();
}
@ -430,25 +446,29 @@
if (this.opts.auto) {
var elements = [];
var _this = this;
this.container.children('.' + this.opts.item_class).each(function (index, el) {
this.container.children('.' + this.opts.item_class).each(function(index, el) {
el = $(el);
elements.push({
el: el,
i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width // Use opts.width as weight for Y
i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width
});
});
_.chain(elements).sortBy(function (x) { return x.i; }).each(function (i) {
_.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) {
self._prepare_element(i.el);
}).value();
}
this.set_animation(this.opts.animate);
this.placeholder = $('<div class="' + this.opts.placeholder_class + ' ' + this.opts.item_class + '"><div class="placeholder-content" /></div>').hide();
this.container.append(this.placeholder);
this.container.height((this.grid.get_grid_height()) * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
this.placeholder = $(
'<div class="' + this.opts.placeholder_class + ' ' + this.opts.item_class + '">' +
'<div class="placeholder-content" /></div>').hide();
var on_resize_handler = function () {
this.container.height(
this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) -
this.opts.vertical_margin);
this.on_resize_handler = function() {
if (self._is_one_column_mode()) {
if (one_column_mode)
return;
@ -456,9 +476,12 @@
one_column_mode = true;
self.grid._sort_nodes();
_.each(self.grid.nodes, function (node) {
_.each(self.grid.nodes, function(node) {
self.container.append(node.el);
if (self.opts.static_grid) {
return;
}
if (!node.no_move) {
node.el.draggable('disable');
}
@ -473,7 +496,11 @@
one_column_mode = false;
_.each(self.grid.nodes, function (node) {
if (self.opts.static_grid) {
return;
}
_.each(self.grid.nodes, function(node) {
if (!node.no_move) {
node.el.draggable('enable');
}
@ -484,11 +511,26 @@
}
};
$(window).resize(on_resize_handler);
on_resize_handler();
$(window).resize(this.on_resize_handler);
this.on_resize_handler();
};
GridStack.prototype._trigger_change_event = function(forceTrigger) {
var elements = this.grid.get_dirty_nodes();
var hasChanges = false;
var eventParams = [];
if (elements && elements.length) {
eventParams.push(elements);
hasChanges = true;
}
if (hasChanges || forceTrigger === true) {
this.container.trigger('change', eventParams);
}
};
GridStack.prototype._init_styles = function () {
GridStack.prototype._init_styles = function() {
if (this._styles_id) {
$('[data-gs-id="' + this._styles_id + '"]').remove();
}
@ -498,7 +540,7 @@
this._styles._max = 0;
};
GridStack.prototype._update_styles = function (max_height) {
GridStack.prototype._update_styles = function(max_height) {
if (this._styles == null) {
return;
}
@ -542,18 +584,21 @@
}
};
GridStack.prototype._update_container_height = function () {
GridStack.prototype._update_container_height = function() {
if (this.grid._update_counter) {
return;
}
this.container.height(this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
this.container.height(
this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) -
this.opts.vertical_margin);
};
GridStack.prototype._is_one_column_mode = function () {
return $(window).width() <= this.opts.min_width;
GridStack.prototype._is_one_column_mode = function() {
return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <=
this.opts.min_width;
};
GridStack.prototype._prepare_element = function (el) {
GridStack.prototype._prepare_element = function(el) {
var self = this;
el = $(el);
@ -576,9 +621,14 @@
});
el.data('_gridstack_node', node);
if (self.opts.static_grid) {
return;
}
var cell_width, cell_height;
var on_start_moving = function (event, ui) {
var on_start_moving = function(event, ui) {
self.container.append(self.placeholder);
var o = $(this);
self.grid.clean_nodes();
self.grid.begin_update(node);
@ -596,7 +646,8 @@
el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1));
};
var on_end_moving = function (event, ui) {
var on_end_moving = function(event, ui) {
self.placeholder.detach();
var o = $(this);
node.el = o;
self.placeholder.hide();
@ -607,7 +658,7 @@
.attr('data-gs-height', node.height)
.removeAttr('style');
self._update_container_height();
self.container.trigger('change', [self.grid.get_dirty_nodes()]);
self._trigger_change_event();
self.grid.end_update();
};
@ -615,9 +666,9 @@
el.draggable(_.extend(this.opts.draggable, {
start: on_start_moving,
stop: on_end_moving,
drag: function (event, ui) {
drag: function(event, ui) {
var x = Math.round(ui.position.left / cell_width),
y = Math.floor((ui.position.top + cell_height/2) / cell_height);
y = Math.floor((ui.position.top + cell_height / 2) / cell_height);
if (!self.grid.can_move_node(node, x, y, node.width, node.height)) {
return;
}
@ -628,9 +679,9 @@
})).resizable(_.extend(this.opts.resizable, {
start: on_start_moving,
stop: on_end_moving,
resize: function (event, ui) {
resize: function(event, ui) {
var x = Math.round(ui.position.left / cell_width),
y = Math.floor((ui.position.top + cell_height/2) / cell_height),
y = Math.floor((ui.position.top + cell_height / 2) / cell_height),
width = Math.round(ui.size.width / cell_width),
height = Math.round(ui.size.height / cell_height);
if (!self.grid.can_move_node(node, x, y, width, height)) {
@ -652,7 +703,7 @@
el.attr('data-gs-locked', node.locked ? 'yes' : null);
};
GridStack.prototype.set_animation = function (enable) {
GridStack.prototype.set_animation = function(enable) {
if (enable) {
this.container.addClass('grid-stack-animate');
}
@ -661,7 +712,7 @@
}
};
GridStack.prototype.add_widget = function (el, x, y, width, height, auto_position) {
GridStack.prototype.add_widget = function(el, x, y, width, height, auto_position) {
el = $(el);
if (typeof x != 'undefined') el.attr('data-gs-x', x);
if (typeof y != 'undefined') el.attr('data-gs-y', y);
@ -671,16 +722,17 @@
this.container.append(el);
this._prepare_element(el);
this._update_container_height();
this._trigger_change_event(true);
return el;
};
GridStack.prototype.will_it_fit = function (x, y, width, height, auto_position) {
GridStack.prototype.will_it_fit = function(x, y, width, height, auto_position) {
var node = {x: x, y: y, width: width, height: height, auto_position: auto_position};
return this.grid.can_be_placed_with_respect_to_height(node);
};
GridStack.prototype.remove_widget = function (el, detach_node) {
GridStack.prototype.remove_widget = function(el, detach_node) {
detach_node = typeof detach_node === 'undefined' ? true : detach_node;
el = $(el);
var node = el.data('_gridstack_node');
@ -689,19 +741,29 @@
this._update_container_height();
if (detach_node)
el.remove();
this._trigger_change_event(true);
};
GridStack.prototype.remove_all = function (detach_node) {
_.each(this.grid.nodes, function (node) {
GridStack.prototype.remove_all = function(detach_node) {
_.each(this.grid.nodes, function(node) {
this.remove_widget(node.el, detach_node);
}, this);
this.grid.nodes = [];
this._update_container_height();
};
GridStack.prototype.resizable = function (el, val) {
GridStack.prototype.destroy = function() {
$(window).off("resize", this.on_resize_handler);
this.disable();
this.container.remove();
Utils.remove_stylesheet(this._styles_id);
if (this.grid)
this.grid = null;
};
GridStack.prototype.resizable = function(el, val) {
el = $(el);
el.each(function (index, el) {
el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@ -719,9 +781,9 @@
return this;
};
GridStack.prototype.movable = function (el, val) {
GridStack.prototype.movable = function(el, val) {
el = $(el);
el.each(function (index, el) {
el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@ -739,19 +801,19 @@
return this;
};
GridStack.prototype.disable = function () {
GridStack.prototype.disable = function() {
this.movable(this.container.children('.' + this.opts.item_class), false);
this.resizable(this.container.children('.' + this.opts.item_class), false);
};
GridStack.prototype.enable = function () {
GridStack.prototype.enable = function() {
this.movable(this.container.children('.' + this.opts.item_class), true);
this.resizable(this.container.children('.' + this.opts.item_class), true);
};
GridStack.prototype.locked = function (el, val) {
GridStack.prototype.locked = function(el, val) {
el = $(el);
el.each(function (index, el) {
el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@ -764,7 +826,41 @@
return this;
};
GridStack.prototype._update_element = function (el, callback) {
GridStack.prototype.min_height = function (el, val) {
el = $(el);
el.each(function (index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
return;
}
if(!isNaN(val)){
node.min_height = (val || false);
el.attr('data-gs-min-height', val);
}
});
return this;
};
GridStack.prototype.min_width = function (el, val) {
el = $(el);
el.each(function (index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
return;
}
if(!isNaN(val)){
node.min_width = (val || false);
el.attr('data-gs-min-width', val);
}
});
return this;
};
GridStack.prototype._update_element = function(el, callback) {
el = $(el).first();
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@ -779,13 +875,13 @@
callback.call(this, el, node);
self._update_container_height();
self.container.trigger('change', [self.grid.get_dirty_nodes()]);
self._trigger_change_event();
self.grid.end_update();
};
GridStack.prototype.resize = function (el, width, height) {
this._update_element(el, function (el, node) {
GridStack.prototype.resize = function(el, width, height) {
this._update_element(el, function(el, node) {
width = (width != null && typeof width != 'undefined') ? width : node.width;
height = (height != null && typeof height != 'undefined') ? height : node.height;
@ -793,8 +889,8 @@
});
};
GridStack.prototype.move = function (el, x, y) {
this._update_element(el, function (el, node) {
GridStack.prototype.move = function(el, x, y) {
this._update_element(el, function(el, node) {
x = (x != null && typeof x != 'undefined') ? x : node.x;
y = (y != null && typeof y != 'undefined') ? y : node.y;
@ -802,8 +898,8 @@
});
};
GridStack.prototype.update = function (el, x, y, width, height) {
this._update_element(el, function (el, node) {
GridStack.prototype.update = function(el, x, y, width, height) {
this._update_element(el, function(el, node) {
x = (x != null && typeof x != 'undefined') ? x : node.x;
y = (y != null && typeof y != 'undefined') ? y : node.y;
width = (width != null && typeof width != 'undefined') ? width : node.width;
@ -813,7 +909,7 @@
});
};
GridStack.prototype.cell_height = function (val) {
GridStack.prototype.cell_height = function(val) {
if (typeof val == 'undefined') {
return this.opts.cell_height;
}
@ -824,7 +920,7 @@
this._update_styles();
};
GridStack.prototype.cell_width = function () {
GridStack.prototype.cell_width = function() {
var o = this.container.children('.' + this.opts.item_class).first();
return Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
};
@ -840,25 +936,40 @@
return {x: Math.floor(relativeLeft / column_width), y: Math.floor(relativeTop / row_height)};
};
GridStack.prototype.batch_update = function () {
GridStack.prototype.batch_update = function() {
this.grid.batch_update();
};
GridStack.prototype.commit = function () {
GridStack.prototype.commit = function() {
this.grid.commit();
this._update_container_height()
this._update_container_height();
};
GridStack.prototype.is_area_empty = function (x, y, width, height) {
GridStack.prototype.is_area_empty = function(x, y, width, height) {
return this.grid.is_area_empty(x, y, width, height);
};
GridStack.prototype.set_static = function(static_value) {
this.opts.static_grid = (static_value === true);
this._set_static_class();
};
GridStack.prototype._set_static_class = function() {
var static_class_name = 'grid-stack-static';
if (this.opts.static_grid === true) {
this.container.addClass(static_class_name);
} else {
this.container.removeClass(static_class_name);
}
};
scope.GridStackUI = GridStack;
scope.GridStackUI.Utils = Utils;
$.fn.gridstack = function (opts) {
return this.each(function () {
$.fn.gridstack = function(opts) {
return this.each(function() {
if (!$(this).data('gridstack')) {
$(this).data('gridstack', new GridStack(this, opts));
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

22
package.json Normal file
View file

@ -0,0 +1,22 @@
{
"name": "gridstack",
"version": "0.2.3",
"description": "gridstack.js is a jQuery plugin for widget layout",
"repository": {
"type": "git",
"url": "git+https://github.com/troolee/gridstack.js.git"
},
"keywords": [
"gridstack",
"grid",
"gridster",
"layout",
"jquery"
],
"author": "Pavel Reznikov <pashka.reznikov@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/troolee/gridstack.js/issues"
},
"homepage": "http://troolee.github.io/gridstack.js/"
}

983
src/gridstack-extra.css Normal file
View file

@ -0,0 +1,983 @@
.grid-stack.grid-stack-1 > .grid-stack-item {
min-width: 100%;
}
.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-width='1'] {
width: 100%;
}
.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-x='1'] {
left: 100%;
}
.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 100%;
}
.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 100%;
}
.grid-stack.grid-stack-2 > .grid-stack-item {
min-width: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-width='1'] {
width: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-x='1'] {
left: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 50%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-width='2'] {
width: 100%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-x='2'] {
left: 100%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 100%;
}
.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 100%;
}
.grid-stack.grid-stack-3 > .grid-stack-item {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='1'] {
width: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='1'] {
left: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 33.33333333%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='2'] {
width: 66.66666667%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='2'] {
left: 66.66666667%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 66.66666667%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 66.66666667%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='3'] {
width: 100%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='3'] {
left: 100%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 100%;
}
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 100%;
}
.grid-stack.grid-stack-4 > .grid-stack-item {
min-width: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='1'] {
width: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='1'] {
left: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 25%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='2'] {
width: 50%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='2'] {
left: 50%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 50%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 50%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='3'] {
width: 75%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='3'] {
left: 75%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 75%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 75%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='4'] {
width: 100%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='4'] {
left: 100%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 100%;
}
.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 100%;
}
.grid-stack.grid-stack-5 > .grid-stack-item {
min-width: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='1'] {
width: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='1'] {
left: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 20%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='2'] {
width: 40%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='2'] {
left: 40%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 40%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 40%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='3'] {
width: 60%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='3'] {
left: 60%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 60%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 60%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='4'] {
width: 80%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='4'] {
left: 80%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 80%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 80%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='5'] {
width: 100%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='5'] {
left: 100%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 100%;
}
.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 100%;
}
.grid-stack.grid-stack-6 > .grid-stack-item {
min-width: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='1'] {
width: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='1'] {
left: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 16.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='2'] {
width: 33.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='2'] {
left: 33.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 33.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='3'] {
width: 50%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='3'] {
left: 50%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 50%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 50%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='4'] {
width: 66.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='4'] {
left: 66.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 66.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 66.66666667%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='5'] {
width: 83.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='5'] {
left: 83.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 83.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 83.33333333%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='6'] {
width: 100%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='6'] {
left: 100%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 100%;
}
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 100%;
}
.grid-stack.grid-stack-7 > .grid-stack-item {
min-width: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='1'] {
width: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='1'] {
left: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 14.28571429%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='2'] {
width: 28.57142857%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='2'] {
left: 28.57142857%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 28.57142857%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 28.57142857%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='3'] {
width: 42.85714286%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='3'] {
left: 42.85714286%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 42.85714286%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 42.85714286%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='4'] {
width: 57.14285714%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='4'] {
left: 57.14285714%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 57.14285714%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 57.14285714%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='5'] {
width: 71.42857143%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='5'] {
left: 71.42857143%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 71.42857143%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 71.42857143%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='6'] {
width: 85.71428571%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='6'] {
left: 85.71428571%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 85.71428571%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 85.71428571%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='7'] {
width: 100%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='7'] {
left: 100%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 100%;
}
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 100%;
}
.grid-stack.grid-stack-8 > .grid-stack-item {
min-width: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='1'] {
width: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='1'] {
left: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 12.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='2'] {
width: 25%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='2'] {
left: 25%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 25%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 25%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='3'] {
width: 37.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='3'] {
left: 37.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 37.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 37.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='4'] {
width: 50%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='4'] {
left: 50%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 50%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 50%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='5'] {
width: 62.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='5'] {
left: 62.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 62.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 62.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='6'] {
width: 75%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='6'] {
left: 75%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 75%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 75%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='7'] {
width: 87.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='7'] {
left: 87.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 87.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 87.5%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='8'] {
width: 100%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='8'] {
left: 100%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 100%;
}
.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 100%;
}
.grid-stack.grid-stack-9 > .grid-stack-item {
min-width: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='1'] {
width: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='1'] {
left: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 11.11111111%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='2'] {
width: 22.22222222%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='2'] {
left: 22.22222222%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 22.22222222%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 22.22222222%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='3'] {
width: 33.33333333%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='3'] {
left: 33.33333333%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 33.33333333%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='4'] {
width: 44.44444444%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='4'] {
left: 44.44444444%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 44.44444444%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 44.44444444%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='5'] {
width: 55.55555556%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='5'] {
left: 55.55555556%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 55.55555556%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 55.55555556%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='6'] {
width: 66.66666667%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='6'] {
left: 66.66666667%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 66.66666667%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 66.66666667%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='7'] {
width: 77.77777778%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='7'] {
left: 77.77777778%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 77.77777778%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 77.77777778%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='8'] {
width: 88.88888889%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='8'] {
left: 88.88888889%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 88.88888889%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 88.88888889%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='9'] {
width: 100%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='9'] {
left: 100%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='9'] {
min-width: 100%;
}
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='9'] {
max-width: 100%;
}
.grid-stack.grid-stack-10 > .grid-stack-item {
min-width: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='1'] {
width: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='1'] {
left: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 10%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='2'] {
width: 20%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='2'] {
left: 20%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 20%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 20%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='3'] {
width: 30%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='3'] {
left: 30%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 30%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 30%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='4'] {
width: 40%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='4'] {
left: 40%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 40%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 40%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='5'] {
width: 50%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='5'] {
left: 50%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 50%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 50%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='6'] {
width: 60%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='6'] {
left: 60%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 60%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 60%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='7'] {
width: 70%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='7'] {
left: 70%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 70%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 70%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='8'] {
width: 80%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='8'] {
left: 80%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 80%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 80%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='9'] {
width: 90%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='9'] {
left: 90%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='9'] {
min-width: 90%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='9'] {
max-width: 90%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='10'] {
width: 100%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='10'] {
left: 100%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='10'] {
min-width: 100%;
}
.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='10'] {
max-width: 100%;
}
.grid-stack.grid-stack-11 > .grid-stack-item {
min-width: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='1'] {
width: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='1'] {
left: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 9.09090909%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='2'] {
width: 18.18181818%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='2'] {
left: 18.18181818%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 18.18181818%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 18.18181818%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='3'] {
width: 27.27272727%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='3'] {
left: 27.27272727%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 27.27272727%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 27.27272727%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='4'] {
width: 36.36363636%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='4'] {
left: 36.36363636%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 36.36363636%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 36.36363636%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='5'] {
width: 45.45454545%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='5'] {
left: 45.45454545%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 45.45454545%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 45.45454545%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='6'] {
width: 54.54545455%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='6'] {
left: 54.54545455%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 54.54545455%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 54.54545455%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='7'] {
width: 63.63636364%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='7'] {
left: 63.63636364%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 63.63636364%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 63.63636364%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='8'] {
width: 72.72727273%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='8'] {
left: 72.72727273%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 72.72727273%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 72.72727273%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='9'] {
width: 81.81818182%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='9'] {
left: 81.81818182%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='9'] {
min-width: 81.81818182%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='9'] {
max-width: 81.81818182%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='10'] {
width: 90.90909091%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='10'] {
left: 90.90909091%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='10'] {
min-width: 90.90909091%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='10'] {
max-width: 90.90909091%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='11'] {
width: 100.0%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='11'] {
left: 100.0%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='11'] {
min-width: 100.0%;
}
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='11'] {
max-width: 100.0%;
}
.grid-stack.grid-stack-12 > .grid-stack-item {
min-width: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='1'] {
width: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='1'] {
left: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='1'] {
min-width: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='1'] {
max-width: 8.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='2'] {
width: 16.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='2'] {
left: 16.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='2'] {
min-width: 16.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='2'] {
max-width: 16.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='3'] {
width: 25%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='3'] {
left: 25%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='3'] {
min-width: 25%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='3'] {
max-width: 25%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='4'] {
width: 33.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='4'] {
left: 33.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='4'] {
min-width: 33.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='4'] {
max-width: 33.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='5'] {
width: 41.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='5'] {
left: 41.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='5'] {
min-width: 41.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='5'] {
max-width: 41.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='6'] {
width: 50%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='6'] {
left: 50%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='6'] {
min-width: 50%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='6'] {
max-width: 50%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='7'] {
width: 58.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='7'] {
left: 58.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='7'] {
min-width: 58.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='7'] {
max-width: 58.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='8'] {
width: 66.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='8'] {
left: 66.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='8'] {
min-width: 66.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='8'] {
max-width: 66.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='9'] {
width: 75%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='9'] {
left: 75%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='9'] {
min-width: 75%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='9'] {
max-width: 75%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='10'] {
width: 83.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='10'] {
left: 83.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='10'] {
min-width: 83.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='10'] {
max-width: 83.33333333%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='11'] {
width: 91.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='11'] {
left: 91.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='11'] {
min-width: 91.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='11'] {
max-width: 91.66666667%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='12'] {
width: 100%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='12'] {
left: 100%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='12'] {
min-width: 100%;
}
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='12'] {
max-width: 100%;
}

21
src/gridstack-extra.scss Normal file
View file

@ -0,0 +1,21 @@
$gridstack-columns: 12;
@mixin grid-stack-items($gridstack-columns) {
.grid-stack.grid-stack-#{$gridstack-columns} {
> .grid-stack-item {
min-width: 100% / $gridstack-columns;
@for $i from 1 through $gridstack-columns {
&[data-gs-width='#{$i}'] { width: (100% / $gridstack-columns) * $i; }
&[data-gs-x='#{$i}'] { left: (100% / $gridstack-columns) * $i; }
&[data-gs-min-width='#{$i}'] { min-width: (100% / $gridstack-columns) * $i; }
&[data-gs-max-width='#{$i}'] { max-width: (100% / $gridstack-columns) * $i; }
}
}
}
}
@for $j from 1 through $gridstack-columns {
@include grid-stack-items($j)
}

318
src/gridstack.css Normal file
View file

@ -0,0 +1,318 @@
:root .grid-stack-item > .ui-resizable-handle {
filter: none;
}
.grid-stack {
position: relative;
}
.grid-stack .grid-stack-placeholder > .placeholder-content {
border: 1px dashed lightgray;
margin: 0;
position: absolute;
top: 0;
left: 10px;
right: 10px;
bottom: 0;
width: auto;
z-index: 0 !important;
}
.grid-stack > .grid-stack-item {
min-width: 8.33333333%;
position: absolute;
padding: 0;
}
.grid-stack > .grid-stack-item > .grid-stack-item-content {
margin: 0;
position: absolute;
top: 0;
left: 10px;
right: 10px;
bottom: 0;
width: auto;
z-index: 0 !important;
overflow-x: hidden;
overflow-y: auto;
}
.grid-stack > .grid-stack-item > .ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
.grid-stack > .grid-stack-item.ui-resizable-disabled > .ui-resizable-handle, .grid-stack > .grid-stack-item.ui-resizable-autohide > .ui-resizable-handle {
display: none;
}
.grid-stack > .grid-stack-item.ui-draggable-dragging, .grid-stack > .grid-stack-item.ui-resizable-resizing {
z-index: 100;
}
.grid-stack > .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content,
.grid-stack > .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content, .grid-stack > .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content,
.grid-stack > .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content {
box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2);
opacity: 0.8;
}
.grid-stack > .grid-stack-item > .ui-resizable-se,
.grid-stack > .grid-stack-item > .ui-resizable-sw {
text-align: right;
color: gray;
padding: 2px 3px 0 0;
margin: 0;
font: normal normal normal 10px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.grid-stack > .grid-stack-item > .ui-resizable-se::before,
.grid-stack > .grid-stack-item > .ui-resizable-sw::before {
content: "\f065";
}
.grid-stack > .grid-stack-item > .ui-resizable-se {
display: inline-block;
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}
.grid-stack > .grid-stack-item > .ui-resizable-nw {
cursor: nw-resize;
width: 20px;
height: 20px;
left: 10px;
top: 0;
}
.grid-stack > .grid-stack-item > .ui-resizable-n {
cursor: n-resize;
height: 10px;
top: 0;
left: 25px;
right: 25px;
}
.grid-stack > .grid-stack-item > .ui-resizable-ne {
cursor: ne-resize;
width: 20px;
height: 20px;
right: 10px;
top: 0;
}
.grid-stack > .grid-stack-item > .ui-resizable-e {
cursor: e-resize;
width: 10px;
right: 10px;
top: 15px;
bottom: 15px;
}
.grid-stack > .grid-stack-item > .ui-resizable-se {
cursor: se-resize;
width: 20px;
height: 20px;
right: 10px;
bottom: 0;
}
.grid-stack > .grid-stack-item > .ui-resizable-s {
cursor: s-resize;
height: 10px;
left: 25px;
bottom: 0;
right: 25px;
}
.grid-stack > .grid-stack-item > .ui-resizable-sw {
cursor: sw-resize;
width: 20px;
height: 20px;
left: 10px;
bottom: 0;
}
.grid-stack > .grid-stack-item > .ui-resizable-w {
cursor: w-resize;
width: 10px;
left: 10px;
top: 15px;
bottom: 15px;
}
.grid-stack > .grid-stack-item[data-gs-width='1'] {
width: 8.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-x='1'] {
left: 8.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='1'] {
min-width: 8.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='1'] {
max-width: 8.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-width='2'] {
width: 16.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-x='2'] {
left: 16.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='2'] {
min-width: 16.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='2'] {
max-width: 16.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-width='3'] {
width: 25%;
}
.grid-stack > .grid-stack-item[data-gs-x='3'] {
left: 25%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='3'] {
min-width: 25%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='3'] {
max-width: 25%;
}
.grid-stack > .grid-stack-item[data-gs-width='4'] {
width: 33.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-x='4'] {
left: 33.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='4'] {
min-width: 33.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='4'] {
max-width: 33.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-width='5'] {
width: 41.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-x='5'] {
left: 41.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='5'] {
min-width: 41.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='5'] {
max-width: 41.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-width='6'] {
width: 50%;
}
.grid-stack > .grid-stack-item[data-gs-x='6'] {
left: 50%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='6'] {
min-width: 50%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='6'] {
max-width: 50%;
}
.grid-stack > .grid-stack-item[data-gs-width='7'] {
width: 58.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-x='7'] {
left: 58.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='7'] {
min-width: 58.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='7'] {
max-width: 58.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-width='8'] {
width: 66.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-x='8'] {
left: 66.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='8'] {
min-width: 66.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='8'] {
max-width: 66.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-width='9'] {
width: 75%;
}
.grid-stack > .grid-stack-item[data-gs-x='9'] {
left: 75%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='9'] {
min-width: 75%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='9'] {
max-width: 75%;
}
.grid-stack > .grid-stack-item[data-gs-width='10'] {
width: 83.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-x='10'] {
left: 83.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='10'] {
min-width: 83.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='10'] {
max-width: 83.33333333%;
}
.grid-stack > .grid-stack-item[data-gs-width='11'] {
width: 91.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-x='11'] {
left: 91.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='11'] {
min-width: 91.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='11'] {
max-width: 91.66666667%;
}
.grid-stack > .grid-stack-item[data-gs-width='12'] {
width: 100%;
}
.grid-stack > .grid-stack-item[data-gs-x='12'] {
left: 100%;
}
.grid-stack > .grid-stack-item[data-gs-min-width='12'] {
min-width: 100%;
}
.grid-stack > .grid-stack-item[data-gs-max-width='12'] {
max-width: 100%;
}
.grid-stack.grid-stack-animate, .grid-stack.grid-stack-animate .grid-stack-item {
-webkit-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s;
-moz-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s;
-ms-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s;
-o-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s;
transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s;
}
.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging, .grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing, .grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder {
-webkit-transition: left 0s, top 0s, height 0s, width 0s;
-moz-transition: left 0s, top 0s, height 0s, width 0s;
-ms-transition: left 0s, top 0s, height 0s, width 0s;
-o-transition: left 0s, top 0s, height 0s, width 0s;
transition: left 0s, top 0s, height 0s, width 0s;
}
/** Uncomment this to show bottom-left resize handle **/
/*
.grid-stack > .grid-stack-item > .ui-resizable-sw {
display: inline-block;
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
@include vendor(transform, rotate(180deg));
}
*/
@media (max-width: 768px) {
.grid-stack-item {
position: relative !important;
width: auto !important;
left: 0 !important;
top: auto !important;
margin-bottom: 20px;
}
.grid-stack-item .ui-resizable-handle {
display: none;
}
.grid-stack {
height: auto !important;
}
}

View file

@ -1,54 +1,57 @@
// gridstack.js 0.2.3-dev
// gridstack.js 0.2.4-dev
// http://troolee.github.io/gridstack.js/
// (c) 2014-2015 Pavel Reznikov
// gridstack.js may be freely distributed under the MIT license.
(function (factory) {
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'lodash', 'jquery-ui/core', 'jquery-ui/widget', 'jquery-ui/mouse', 'jquery-ui/draggable', 'jquery-ui/resizable'], factory);
define(['jquery', 'lodash', 'jquery-ui/core', 'jquery-ui/widget', 'jquery-ui/mouse', 'jquery-ui/draggable',
'jquery-ui/resizable'], factory);
}
else {
factory(jQuery, _);
}
})(function ($, _) {
})(function($, _) {
var scope = window;
var Utils = {
is_intercepted: function (a, b) {
is_intercepted: function(a, b) {
return !(a.x + a.width <= b.x || b.x + b.width <= a.x || a.y + a.height <= b.y || b.y + b.height <= a.y);
},
sort: function (nodes, dir, width) {
width = width || _.chain(nodes).map(function (node) { return node.x + node.width; }).max().value();
sort: function(nodes, dir, width) {
width = width || _.chain(nodes).map(function(node) { return node.x + node.width; }).max().value();
dir = dir != -1 ? 1 : -1;
return _.sortBy(nodes, function (n) { return dir * (n.x + n.y * width); });
return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); });
},
create_stylesheet: function (id) {
var style = document.createElement("style");
style.setAttribute("type", "text/css");
style.setAttribute("data-gs-id", id);
create_stylesheet: function(id) {
var style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.setAttribute('data-gs-id', id);
if (style.styleSheet) {
style.styleSheet.cssText = "";
style.styleSheet.cssText = '';
}
else {
style.appendChild(document.createTextNode(""));
style.appendChild(document.createTextNode(''));
}
document.getElementsByTagName('head')[0].appendChild(style);
return style.sheet;
},
insert_css_rule: function (sheet, selector, rules, index) {
if(typeof sheet.insertRule === 'function') {
sheet.insertRule(selector + "{" + rules + "}", index);
remove_stylesheet: function(id) {
$("STYLE[data-gs-id=" + id +"]").remove();
},
insert_css_rule: function(sheet, selector, rules, index) {
if (typeof sheet.insertRule === 'function') {
sheet.insertRule(selector + '{' + rules + '}', index);
}
else if(typeof sheet.addRule === 'function') {
else if (typeof sheet.addRule === 'function') {
sheet.addRule(selector, rules, index);
}
},
toBool: function (v) {
toBool: function(v) {
if (typeof v == 'boolean')
return v;
if (typeof v == 'string') {
@ -61,24 +64,24 @@
var id_seq = 0;
var GridStackEngine = function (width, onchange, float, height, items) {
var GridStackEngine = function(width, onchange, float_mode, height, items) {
this.width = width;
this.float = float || false;
this['float'] = float_mode || false;
this.height = height || 0;
this.nodes = items || [];
this.onchange = onchange || function () {};
this.onchange = onchange || function() {};
this._update_counter = 0;
this._float = this.float;
this._float = this['float'];
};
GridStackEngine.prototype.batch_update = function () {
GridStackEngine.prototype.batch_update = function() {
this._update_counter = 1;
this.float = true;
};
GridStackEngine.prototype.commit = function () {
GridStackEngine.prototype.commit = function() {
this._update_counter = 0;
if (this._update_counter == 0) {
this.float = this._float;
@ -87,16 +90,16 @@
}
};
GridStackEngine.prototype._fix_collisions = function (node) {
GridStackEngine.prototype._fix_collisions = function(node) {
this._sort_nodes(-1);
var nn = node, has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
var nn = node, has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked }));
if (!this.float && !has_locked) {
nn = {x: 0, y: node.y, width: this.width, height: node.height};
}
while (true) {
var collision_node = _.find(this.nodes, function (n) {
var collision_node = _.find(this.nodes, function(n) {
return n != node && Utils.is_intercepted(n, nn);
}, this);
if (typeof collision_node == 'undefined') {
@ -107,31 +110,32 @@
}
};
GridStackEngine.prototype.is_area_empty = function (x, y, width, height) {
GridStackEngine.prototype.is_area_empty = function(x, y, width, height) {
var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1};
var collision_node = _.find(this.nodes, function (n) {
var collision_node = _.find(this.nodes, function(n) {
return Utils.is_intercepted(n, nn);
}, this);
return collision_node == null;
};
GridStackEngine.prototype._sort_nodes = function (dir) {
GridStackEngine.prototype._sort_nodes = function(dir) {
this.nodes = Utils.sort(this.nodes, dir, this.width);
};
GridStackEngine.prototype._pack_nodes = function () {
GridStackEngine.prototype._pack_nodes = function() {
this._sort_nodes();
if (this.float) {
_.each(this.nodes, function (n, i) {
_.each(this.nodes, function(n, i) {
if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y)
return;
var new_y = n.y;
while (new_y >= n._orig_y) {
var collision_node = _.chain(this.nodes)
.find(function (bn) {
return n != bn && Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
.find(function(bn) {
return n != bn &&
Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
})
.value();
@ -144,7 +148,7 @@
}, this);
}
else {
_.each(this.nodes, function (n, i) {
_.each(this.nodes, function(n, i) {
if (n.locked)
return;
while (n.y > 0) {
@ -154,7 +158,7 @@
if (i > 0) {
var collision_node = _.chain(this.nodes)
.take(i)
.find(function (bn) {
.find(function(bn) {
return Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
})
.value();
@ -171,7 +175,7 @@
}
};
GridStackEngine.prototype._prepare_node = function (node, resizing) {
GridStackEngine.prototype._prepare_node = function(node, resizing) {
node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0 });
node.x = parseInt('' + node.x);
@ -213,7 +217,7 @@
return node;
};
GridStackEngine.prototype._notify = function () {
GridStackEngine.prototype._notify = function() {
if (this._update_counter) {
return;
}
@ -222,12 +226,12 @@
this.onchange(deleted_nodes);
};
GridStackEngine.prototype.clean_nodes = function () {
_.each(this.nodes, function (n) {n._dirty = false });
GridStackEngine.prototype.clean_nodes = function() {
_.each(this.nodes, function(n) {n._dirty = false });
};
GridStackEngine.prototype.get_dirty_nodes = function () {
return _.filter(this.nodes, function (n) { return n._dirty; });
GridStackEngine.prototype.get_dirty_nodes = function() {
return _.filter(this.nodes, function(n) { return n._dirty; });
};
GridStackEngine.prototype.add_node = function(node) {
@ -244,12 +248,12 @@
if (node.auto_position) {
this._sort_nodes();
for (var i = 0; ; ++i) {
for (var i = 0;; ++i) {
var x = i % this.width, y = Math.floor(i / this.width);
if (x + node.width > this.width) {
continue;
}
if (!_.find(this.nodes, function (n) {
if (!_.find(this.nodes, function(n) {
return Utils.is_intercepted({x: x, y: y, width: node.width, height: node.height}, n);
})) {
node.x = x;
@ -267,15 +271,15 @@
return node;
};
GridStackEngine.prototype.remove_node = function (node) {
GridStackEngine.prototype.remove_node = function(node) {
node._id = null;
this.nodes = _.without(this.nodes, node);
this._pack_nodes();
this._notify(node);
};
GridStackEngine.prototype.can_move_node = function (node, x, y, width, height) {
var has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
GridStackEngine.prototype.can_move_node = function(node, x, y, width, height) {
var has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked }));
if (!this.height && !has_locked)
return true;
@ -286,21 +290,29 @@
null,
this.float,
0,
_.map(this.nodes, function (n) { if (n == node) { cloned_node = $.extend({}, n); return cloned_node; } return $.extend({}, n) }));
_.map(this.nodes, function(n) {
if (n == node) {
cloned_node = $.extend({}, n);
return cloned_node;
}
return $.extend({}, n);
}));
clone.move_node(cloned_node, x, y, width, height);
var res = true;
if (has_locked)
res &= !Boolean(_.find(clone.nodes, function (n) { return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty); }));
res &= !Boolean(_.find(clone.nodes, function(n) {
return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty);
}));
if (this.height)
res &= clone.get_grid_height() <= this.height;
return res;
};
GridStackEngine.prototype.can_be_placed_with_respect_to_height = function (node) {
GridStackEngine.prototype.can_be_placed_with_respect_to_height = function(node) {
if (!this.height)
return true;
@ -309,12 +321,12 @@
null,
this.float,
0,
_.map(this.nodes, function (n) { return $.extend({}, n) }));
_.map(this.nodes, function(n) { return $.extend({}, n) }));
clone.add_node(node);
return clone.get_grid_height() <= this.height;
};
GridStackEngine.prototype.move_node = function (node, x, y, width, height, no_pack) {
GridStackEngine.prototype.move_node = function(node, x, y, width, height, no_pack) {
if (typeof x != 'number') x = node.x;
if (typeof y != 'number') y = node.y;
if (typeof width != 'number') width = node.width;
@ -347,28 +359,28 @@
return node;
};
GridStackEngine.prototype.get_grid_height = function () {
return _.reduce(this.nodes, function (memo, n) { return Math.max(memo, n.y + n.height); }, 0);
GridStackEngine.prototype.get_grid_height = function() {
return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0);
};
GridStackEngine.prototype.begin_update = function (node) {
_.each(this.nodes, function (n) {
GridStackEngine.prototype.begin_update = function(node) {
_.each(this.nodes, function(n) {
n._orig_y = n.y;
});
node._updating = true;
};
GridStackEngine.prototype.end_update = function () {
_.each(this.nodes, function (n) {
GridStackEngine.prototype.end_update = function() {
_.each(this.nodes, function(n) {
n._orig_y = n.y;
});
var n = _.find(this.nodes, function (n) { return n._updating; });
var n = _.find(this.nodes, function(n) { return n._updating; });
if (n) {
n._updating = false;
}
};
var GridStack = function (el, opts) {
var GridStack = function(el, opts) {
var self = this, one_column_mode;
this.container = $(el);
@ -387,6 +399,7 @@
auto: true,
min_width: 768,
float: false,
static_grid: false,
_class: 'grid-stack-' + (Math.random() * 10000).toFixed(0),
animate: Boolean(this.container.attr('data-gs-animate')) || false,
always_show_resize_handle: opts.always_show_resize_handle || false,
@ -403,15 +416,18 @@
this.opts.is_nested = is_nested;
this.container.addClass(this.opts._class);
this._set_static_class();
if (is_nested) {
this.container.addClass('grid-stack-nested');
}
this._init_styles();
this.grid = new GridStackEngine(this.opts.width, function (nodes) {
this.grid = new GridStackEngine(this.opts.width, function(nodes) {
var max_height = 0;
_.each(nodes, function (n) {
_.each(nodes, function(n) {
if (n._id == null) {
n.el.remove();
}
@ -430,25 +446,29 @@
if (this.opts.auto) {
var elements = [];
var _this = this;
this.container.children('.' + this.opts.item_class).each(function (index, el) {
this.container.children('.' + this.opts.item_class).each(function(index, el) {
el = $(el);
elements.push({
el: el,
i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width // Use opts.width as weight for Y
i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width
});
});
_.chain(elements).sortBy(function (x) { return x.i; }).each(function (i) {
_.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) {
self._prepare_element(i.el);
}).value();
}
this.set_animation(this.opts.animate);
this.placeholder = $('<div class="' + this.opts.placeholder_class + ' ' + this.opts.item_class + '"><div class="placeholder-content" /></div>').hide();
this.container.append(this.placeholder);
this.container.height((this.grid.get_grid_height()) * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
this.placeholder = $(
'<div class="' + this.opts.placeholder_class + ' ' + this.opts.item_class + '">' +
'<div class="placeholder-content" /></div>').hide();
var on_resize_handler = function () {
this.container.height(
this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) -
this.opts.vertical_margin);
this.on_resize_handler = function() {
if (self._is_one_column_mode()) {
if (one_column_mode)
return;
@ -456,9 +476,12 @@
one_column_mode = true;
self.grid._sort_nodes();
_.each(self.grid.nodes, function (node) {
_.each(self.grid.nodes, function(node) {
self.container.append(node.el);
if (self.opts.static_grid) {
return;
}
if (!node.no_move) {
node.el.draggable('disable');
}
@ -473,7 +496,11 @@
one_column_mode = false;
_.each(self.grid.nodes, function (node) {
if (self.opts.static_grid) {
return;
}
_.each(self.grid.nodes, function(node) {
if (!node.no_move) {
node.el.draggable('enable');
}
@ -484,11 +511,26 @@
}
};
$(window).resize(on_resize_handler);
on_resize_handler();
$(window).resize(this.on_resize_handler);
this.on_resize_handler();
};
GridStack.prototype._trigger_change_event = function(forceTrigger) {
var elements = this.grid.get_dirty_nodes();
var hasChanges = false;
var eventParams = [];
if (elements && elements.length) {
eventParams.push(elements);
hasChanges = true;
}
if (hasChanges || forceTrigger === true) {
this.container.trigger('change', eventParams);
}
};
GridStack.prototype._init_styles = function () {
GridStack.prototype._init_styles = function() {
if (this._styles_id) {
$('[data-gs-id="' + this._styles_id + '"]').remove();
}
@ -498,7 +540,7 @@
this._styles._max = 0;
};
GridStack.prototype._update_styles = function (max_height) {
GridStack.prototype._update_styles = function(max_height) {
if (this._styles == null) {
return;
}
@ -542,18 +584,21 @@
}
};
GridStack.prototype._update_container_height = function () {
GridStack.prototype._update_container_height = function() {
if (this.grid._update_counter) {
return;
}
this.container.height(this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
this.container.height(
this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) -
this.opts.vertical_margin);
};
GridStack.prototype._is_one_column_mode = function () {
return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= this.opts.min_width;
GridStack.prototype._is_one_column_mode = function() {
return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <=
this.opts.min_width;
};
GridStack.prototype._prepare_element = function (el) {
GridStack.prototype._prepare_element = function(el) {
var self = this;
el = $(el);
@ -576,9 +621,14 @@
});
el.data('_gridstack_node', node);
if (self.opts.static_grid) {
return;
}
var cell_width, cell_height;
var on_start_moving = function (event, ui) {
var on_start_moving = function(event, ui) {
self.container.append(self.placeholder);
var o = $(this);
self.grid.clean_nodes();
self.grid.begin_update(node);
@ -596,7 +646,8 @@
el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1));
};
var on_end_moving = function (event, ui) {
var on_end_moving = function(event, ui) {
self.placeholder.detach();
var o = $(this);
node.el = o;
self.placeholder.hide();
@ -607,7 +658,7 @@
.attr('data-gs-height', node.height)
.removeAttr('style');
self._update_container_height();
self.container.trigger('change', [self.grid.get_dirty_nodes()]);
self._trigger_change_event();
self.grid.end_update();
};
@ -615,9 +666,9 @@
el.draggable(_.extend(this.opts.draggable, {
start: on_start_moving,
stop: on_end_moving,
drag: function (event, ui) {
drag: function(event, ui) {
var x = Math.round(ui.position.left / cell_width),
y = Math.floor((ui.position.top + cell_height/2) / cell_height);
y = Math.floor((ui.position.top + cell_height / 2) / cell_height);
if (!self.grid.can_move_node(node, x, y, node.width, node.height)) {
return;
}
@ -628,9 +679,9 @@
})).resizable(_.extend(this.opts.resizable, {
start: on_start_moving,
stop: on_end_moving,
resize: function (event, ui) {
resize: function(event, ui) {
var x = Math.round(ui.position.left / cell_width),
y = Math.floor((ui.position.top + cell_height/2) / cell_height),
y = Math.floor((ui.position.top + cell_height / 2) / cell_height),
width = Math.round(ui.size.width / cell_width),
height = Math.round(ui.size.height / cell_height);
if (!self.grid.can_move_node(node, x, y, width, height)) {
@ -652,7 +703,7 @@
el.attr('data-gs-locked', node.locked ? 'yes' : null);
};
GridStack.prototype.set_animation = function (enable) {
GridStack.prototype.set_animation = function(enable) {
if (enable) {
this.container.addClass('grid-stack-animate');
}
@ -661,7 +712,7 @@
}
};
GridStack.prototype.add_widget = function (el, x, y, width, height, auto_position) {
GridStack.prototype.add_widget = function(el, x, y, width, height, auto_position) {
el = $(el);
if (typeof x != 'undefined') el.attr('data-gs-x', x);
if (typeof y != 'undefined') el.attr('data-gs-y', y);
@ -671,16 +722,17 @@
this.container.append(el);
this._prepare_element(el);
this._update_container_height();
this._trigger_change_event(true);
return el;
};
GridStack.prototype.will_it_fit = function (x, y, width, height, auto_position) {
GridStack.prototype.will_it_fit = function(x, y, width, height, auto_position) {
var node = {x: x, y: y, width: width, height: height, auto_position: auto_position};
return this.grid.can_be_placed_with_respect_to_height(node);
};
GridStack.prototype.remove_widget = function (el, detach_node) {
GridStack.prototype.remove_widget = function(el, detach_node) {
detach_node = typeof detach_node === 'undefined' ? true : detach_node;
el = $(el);
var node = el.data('_gridstack_node');
@ -689,20 +741,30 @@
this._update_container_height();
if (detach_node)
el.remove();
this._trigger_change_event(true);
};
GridStack.prototype.remove_all = function (detach_node) {
_.each(this.grid.nodes, function (node) {
GridStack.prototype.remove_all = function(detach_node) {
_.each(this.grid.nodes, function(node) {
this.remove_widget(node.el, detach_node);
}, this);
this.grid.nodes = [];
this._update_container_height();
};
GridStack.prototype.resizable = function (el, val) {
GridStack.prototype.destroy = function() {
$(window).off("resize", this.on_resize_handler);
this.disable();
this.container.remove();
Utils.remove_stylesheet(this._styles_id);
if (this.grid)
this.grid = null;
};
GridStack.prototype.resizable = function(el, val) {
var self = this;
el = $(el);
el.each(function (index, el) {
el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@ -720,10 +782,10 @@
return this;
};
GridStack.prototype.movable = function (el, val) {
GridStack.prototype.movable = function(el, val) {
var self = this;
el = $(el);
el.each(function (index, el) {
el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@ -741,19 +803,19 @@
return this;
};
GridStack.prototype.disable = function () {
GridStack.prototype.disable = function() {
this.movable(this.container.children('.' + this.opts.item_class), false);
this.resizable(this.container.children('.' + this.opts.item_class), false);
};
GridStack.prototype.enable = function () {
GridStack.prototype.enable = function() {
this.movable(this.container.children('.' + this.opts.item_class), true);
this.resizable(this.container.children('.' + this.opts.item_class), true);
};
GridStack.prototype.locked = function (el, val) {
GridStack.prototype.locked = function(el, val) {
el = $(el);
el.each(function (index, el) {
el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@ -766,7 +828,41 @@
return this;
};
GridStack.prototype._update_element = function (el, callback) {
GridStack.prototype.min_height = function (el, val) {
el = $(el);
el.each(function (index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
return;
}
if(!isNaN(val)){
node.min_height = (val || false);
el.attr('data-gs-min-height', val);
}
});
return this;
};
GridStack.prototype.min_width = function (el, val) {
el = $(el);
el.each(function (index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
return;
}
if(!isNaN(val)){
node.min_width = (val || false);
el.attr('data-gs-min-width', val);
}
});
return this;
};
GridStack.prototype._update_element = function(el, callback) {
el = $(el).first();
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@ -781,13 +877,13 @@
callback.call(this, el, node);
self._update_container_height();
self.container.trigger('change', [self.grid.get_dirty_nodes()]);
self._trigger_change_event();
self.grid.end_update();
};
GridStack.prototype.resize = function (el, width, height) {
this._update_element(el, function (el, node) {
GridStack.prototype.resize = function(el, width, height) {
this._update_element(el, function(el, node) {
width = (width != null && typeof width != 'undefined') ? width : node.width;
height = (height != null && typeof height != 'undefined') ? height : node.height;
@ -795,8 +891,8 @@
});
};
GridStack.prototype.move = function (el, x, y) {
this._update_element(el, function (el, node) {
GridStack.prototype.move = function(el, x, y) {
this._update_element(el, function(el, node) {
x = (x != null && typeof x != 'undefined') ? x : node.x;
y = (y != null && typeof y != 'undefined') ? y : node.y;
@ -804,8 +900,8 @@
});
};
GridStack.prototype.update = function (el, x, y, width, height) {
this._update_element(el, function (el, node) {
GridStack.prototype.update = function(el, x, y, width, height) {
this._update_element(el, function(el, node) {
x = (x != null && typeof x != 'undefined') ? x : node.x;
y = (y != null && typeof y != 'undefined') ? y : node.y;
width = (width != null && typeof width != 'undefined') ? width : node.width;
@ -815,7 +911,7 @@
});
};
GridStack.prototype.cell_height = function (val) {
GridStack.prototype.cell_height = function(val) {
if (typeof val == 'undefined') {
return this.opts.cell_height;
}
@ -826,7 +922,7 @@
this._update_styles();
};
GridStack.prototype.cell_width = function () {
GridStack.prototype.cell_width = function() {
var o = this.container.children('.' + this.opts.item_class).first();
return Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
};
@ -842,25 +938,40 @@
return {x: Math.floor(relativeLeft / column_width), y: Math.floor(relativeTop / row_height)};
};
GridStack.prototype.batch_update = function () {
GridStack.prototype.batch_update = function() {
this.grid.batch_update();
};
GridStack.prototype.commit = function () {
GridStack.prototype.commit = function() {
this.grid.commit();
this._update_container_height()
this._update_container_height();
};
GridStack.prototype.is_area_empty = function (x, y, width, height) {
GridStack.prototype.is_area_empty = function(x, y, width, height) {
return this.grid.is_area_empty(x, y, width, height);
};
GridStack.prototype.set_static = function(static_value) {
this.opts.static_grid = (static_value === true);
this._set_static_class();
};
GridStack.prototype._set_static_class = function() {
var static_class_name = 'grid-stack-static';
if (this.opts.static_grid === true) {
this.container.addClass(static_class_name);
} else {
this.container.removeClass(static_class_name);
}
};
scope.GridStackUI = GridStack;
scope.GridStackUI.Utils = Utils;
$.fn.gridstack = function (opts) {
return this.each(function () {
$.fn.gridstack = function(opts) {
return this.each(function() {
if (!$(this).data('gridstack')) {
$(this).data('gridstack', new GridStack(this, opts));
}