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

knockout.js Demo

- +

@@ -64,9 +64,9 @@ } var item = _.find(items, function (i) { return i.nodeType == 1 }); - grid.add_widget(item); + grid.addWidget(item); ko.utils.domNodeDisposal.addDisposeCallback(item, function () { - grid.remove_widget(item); + grid.removeWidget(item); }); }; }; @@ -78,7 +78,7 @@ [ '
', '
', - '
', + '
', '
', '
' ].join('') @@ -90,7 +90,7 @@ this.widgets = ko.observableArray(widgets); - this.add_new_widget = function () { + this.addNewWidget = function () { this.widgets.push({ x: 0, y: 0, @@ -98,10 +98,12 @@ height: Math.floor(1 + 3 * Math.random()), auto_position: true }); + return false; }; - this.delete_widget = function (item) { + this.deleteWidget = function (item) { self.widgets.remove(item); + return false; }; }; diff --git a/demo/knockout2.html b/demo/knockout2.html index af558ec..96d2819 100644 --- a/demo/knockout2.html +++ b/demo/knockout2.html @@ -38,7 +38,7 @@

knockout.js Demo

- +

@@ -64,9 +64,9 @@ } var item = _.find(items, function (i) { return i.nodeType == 1 }); - grid.add_widget(item); + grid.addWidget(item); ko.utils.domNodeDisposal.addDisposeCallback(item, function () { - grid.remove_widget(item); + grid.removeWidget(item); }); }; }; @@ -83,7 +83,7 @@ this.widgets = ko.observableArray(widgets); - this.add_new_widget = function () { + this.addNewWidget = function () { this.widgets.push({ x: 0, y: 0, @@ -91,10 +91,12 @@ height: Math.floor(1 + 3 * Math.random()), auto_position: true }); + return false; }; - this.delete_widget = function (item) { + this.deleteWidget = function (item) { self.widgets.remove(item); + return false; }; }; @@ -113,7 +115,7 @@ diff --git a/demo/serialization.html b/demo/serialization.html index 06ddbc6..b8484ea 100644 --- a/demo/serialization.html +++ b/demo/serialization.html @@ -56,12 +56,11 @@ diff --git a/demo/two.html b/demo/two.html index a9f64f7..7219455 100644 --- a/demo/two.html +++ b/demo/two.html @@ -75,7 +75,7 @@ var grid = $(this).data('gridstack'); _.each(items, function (node) { - grid.add_widget($('
'), + grid.addWidget($('
'), node.x, node.y, node.width, node.height); }, this); }); diff --git a/dist/gridstack-extra.css b/dist/gridstack-extra.css index 2ea5adb..0f51e59 100644 --- a/dist/gridstack-extra.css +++ b/dist/gridstack-extra.css @@ -1,15 +1,19 @@ .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%; } @@ -17,67 +21,87 @@ .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%; + min-width: 33.3333333333%; } + .grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='1'] { - width: 33.33333333%; + width: 33.3333333333%; } + .grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='1'] { - left: 33.33333333%; + left: 33.3333333333%; } + .grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 33.33333333%; + min-width: 33.3333333333%; } + .grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 33.33333333%; + max-width: 33.3333333333%; } + .grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='2'] { - width: 66.66666667%; + width: 66.6666666667%; } + .grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='2'] { - left: 66.66666667%; + left: 66.6666666667%; } + .grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 66.66666667%; + min-width: 66.6666666667%; } + .grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 66.66666667%; + max-width: 66.6666666667%; } + .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%; } @@ -85,51 +109,67 @@ .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%; } @@ -137,227 +177,299 @@ .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%; + min-width: 16.6666666667%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='1'] { - width: 16.66666667%; + width: 16.6666666667%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='1'] { - left: 16.66666667%; + left: 16.6666666667%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 16.66666667%; + min-width: 16.6666666667%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 16.66666667%; + max-width: 16.6666666667%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='2'] { - width: 33.33333333%; + width: 33.3333333333%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='2'] { - left: 33.33333333%; + left: 33.3333333333%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 33.33333333%; + min-width: 33.3333333333%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 33.33333333%; + max-width: 33.3333333333%; } + .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%; + width: 66.6666666667%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='4'] { - left: 66.66666667%; + left: 66.6666666667%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 66.66666667%; + min-width: 66.6666666667%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 66.66666667%; + max-width: 66.6666666667%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='5'] { - width: 83.33333333%; + width: 83.3333333333%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='5'] { - left: 83.33333333%; + left: 83.3333333333%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 83.33333333%; + min-width: 83.3333333333%; } + .grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 83.33333333%; + max-width: 83.3333333333%; } + .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%; + min-width: 14.2857142857%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='1'] { - width: 14.28571429%; + width: 14.2857142857%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='1'] { - left: 14.28571429%; + left: 14.2857142857%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 14.28571429%; + min-width: 14.2857142857%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 14.28571429%; + max-width: 14.2857142857%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='2'] { - width: 28.57142857%; + width: 28.5714285714%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='2'] { - left: 28.57142857%; + left: 28.5714285714%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 28.57142857%; + min-width: 28.5714285714%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 28.57142857%; + max-width: 28.5714285714%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='3'] { - width: 42.85714286%; + width: 42.8571428571%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='3'] { - left: 42.85714286%; + left: 42.8571428571%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 42.85714286%; + min-width: 42.8571428571%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 42.85714286%; + max-width: 42.8571428571%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='4'] { - width: 57.14285714%; + width: 57.1428571429%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='4'] { - left: 57.14285714%; + left: 57.1428571429%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 57.14285714%; + min-width: 57.1428571429%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 57.14285714%; + max-width: 57.1428571429%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='5'] { - width: 71.42857143%; + width: 71.4285714286%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='5'] { - left: 71.42857143%; + left: 71.4285714286%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 71.42857143%; + min-width: 71.4285714286%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 71.42857143%; + max-width: 71.4285714286%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='6'] { - width: 85.71428571%; + width: 85.7142857143%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='6'] { - left: 85.71428571%; + left: 85.7142857143%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 85.71428571%; + min-width: 85.7142857143%; } + .grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 85.71428571%; + max-width: 85.7142857143%; } + .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%; } @@ -365,211 +477,279 @@ .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%; + min-width: 11.1111111111%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='1'] { - width: 11.11111111%; + width: 11.1111111111%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='1'] { - left: 11.11111111%; + left: 11.1111111111%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 11.11111111%; + min-width: 11.1111111111%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 11.11111111%; + max-width: 11.1111111111%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='2'] { - width: 22.22222222%; + width: 22.2222222222%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='2'] { - left: 22.22222222%; + left: 22.2222222222%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 22.22222222%; + min-width: 22.2222222222%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 22.22222222%; + max-width: 22.2222222222%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='3'] { - width: 33.33333333%; + width: 33.3333333333%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='3'] { - left: 33.33333333%; + left: 33.3333333333%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 33.33333333%; + min-width: 33.3333333333%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 33.33333333%; + max-width: 33.3333333333%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='4'] { - width: 44.44444444%; + width: 44.4444444444%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='4'] { - left: 44.44444444%; + left: 44.4444444444%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 44.44444444%; + min-width: 44.4444444444%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 44.44444444%; + max-width: 44.4444444444%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='5'] { - width: 55.55555556%; + width: 55.5555555556%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='5'] { - left: 55.55555556%; + left: 55.5555555556%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 55.55555556%; + min-width: 55.5555555556%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 55.55555556%; + max-width: 55.5555555556%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='6'] { - width: 66.66666667%; + width: 66.6666666667%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='6'] { - left: 66.66666667%; + left: 66.6666666667%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 66.66666667%; + min-width: 66.6666666667%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 66.66666667%; + max-width: 66.6666666667%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='7'] { - width: 77.77777778%; + width: 77.7777777778%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='7'] { - left: 77.77777778%; + left: 77.7777777778%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 77.77777778%; + min-width: 77.7777777778%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 77.77777778%; + max-width: 77.7777777778%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='8'] { - width: 88.88888889%; + width: 88.8888888889%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='8'] { - left: 88.88888889%; + left: 88.8888888889%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 88.88888889%; + min-width: 88.8888888889%; } + .grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 88.88888889%; + max-width: 88.8888888889%; } + .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%; } @@ -577,407 +757,539 @@ .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%; + min-width: 9.0909090909%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='1'] { - width: 9.09090909%; + width: 9.0909090909%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='1'] { - left: 9.09090909%; + left: 9.0909090909%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 9.09090909%; + min-width: 9.0909090909%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 9.09090909%; + max-width: 9.0909090909%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='2'] { - width: 18.18181818%; + width: 18.1818181818%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='2'] { - left: 18.18181818%; + left: 18.1818181818%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 18.18181818%; + min-width: 18.1818181818%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 18.18181818%; + max-width: 18.1818181818%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='3'] { - width: 27.27272727%; + width: 27.2727272727%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='3'] { - left: 27.27272727%; + left: 27.2727272727%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 27.27272727%; + min-width: 27.2727272727%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 27.27272727%; + max-width: 27.2727272727%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='4'] { - width: 36.36363636%; + width: 36.3636363636%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='4'] { - left: 36.36363636%; + left: 36.3636363636%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 36.36363636%; + min-width: 36.3636363636%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 36.36363636%; + max-width: 36.3636363636%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='5'] { - width: 45.45454545%; + width: 45.4545454545%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='5'] { - left: 45.45454545%; + left: 45.4545454545%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 45.45454545%; + min-width: 45.4545454545%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 45.45454545%; + max-width: 45.4545454545%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='6'] { - width: 54.54545455%; + width: 54.5454545455%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='6'] { - left: 54.54545455%; + left: 54.5454545455%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 54.54545455%; + min-width: 54.5454545455%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 54.54545455%; + max-width: 54.5454545455%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='7'] { - width: 63.63636364%; + width: 63.6363636364%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='7'] { - left: 63.63636364%; + left: 63.6363636364%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 63.63636364%; + min-width: 63.6363636364%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 63.63636364%; + max-width: 63.6363636364%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='8'] { - width: 72.72727273%; + width: 72.7272727273%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='8'] { - left: 72.72727273%; + left: 72.7272727273%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 72.72727273%; + min-width: 72.7272727273%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 72.72727273%; + max-width: 72.7272727273%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='9'] { - width: 81.81818182%; + width: 81.8181818182%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='9'] { - left: 81.81818182%; + left: 81.8181818182%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='9'] { - min-width: 81.81818182%; + min-width: 81.8181818182%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='9'] { - max-width: 81.81818182%; + max-width: 81.8181818182%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='10'] { - width: 90.90909091%; + width: 90.9090909091%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='10'] { - left: 90.90909091%; + left: 90.9090909091%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='10'] { - min-width: 90.90909091%; + min-width: 90.9090909091%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='10'] { - max-width: 90.90909091%; + max-width: 90.9090909091%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='11'] { - width: 100.0%; + width: 100%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='11'] { - left: 100.0%; + left: 100%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='11'] { - min-width: 100.0%; + min-width: 100%; } + .grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='11'] { - max-width: 100.0%; + max-width: 100%; } .grid-stack.grid-stack-12 > .grid-stack-item { - min-width: 8.33333333%; + min-width: 8.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='1'] { - width: 8.33333333%; + width: 8.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='1'] { - left: 8.33333333%; + left: 8.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 8.33333333%; + min-width: 8.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 8.33333333%; + max-width: 8.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='2'] { - width: 16.66666667%; + width: 16.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='2'] { - left: 16.66666667%; + left: 16.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 16.66666667%; + min-width: 16.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 16.66666667%; + max-width: 16.6666666667%; } + .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%; + width: 33.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='4'] { - left: 33.33333333%; + left: 33.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 33.33333333%; + min-width: 33.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 33.33333333%; + max-width: 33.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='5'] { - width: 41.66666667%; + width: 41.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='5'] { - left: 41.66666667%; + left: 41.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 41.66666667%; + min-width: 41.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 41.66666667%; + max-width: 41.6666666667%; } + .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%; + width: 58.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='7'] { - left: 58.33333333%; + left: 58.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 58.33333333%; + min-width: 58.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 58.33333333%; + max-width: 58.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='8'] { - width: 66.66666667%; + width: 66.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='8'] { - left: 66.66666667%; + left: 66.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 66.66666667%; + min-width: 66.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 66.66666667%; + max-width: 66.6666666667%; } + .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%; + width: 83.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='10'] { - left: 83.33333333%; + left: 83.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='10'] { - min-width: 83.33333333%; + min-width: 83.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='10'] { - max-width: 83.33333333%; + max-width: 83.3333333333%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='11'] { - width: 91.66666667%; + width: 91.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='11'] { - left: 91.66666667%; + left: 91.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='11'] { - min-width: 91.66666667%; + min-width: 91.6666666667%; } + .grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='11'] { - max-width: 91.66666667%; + max-width: 91.6666666667%; } + .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%; } diff --git a/dist/gridstack-extra.min.css b/dist/gridstack-extra.min.css index fb9b777..074f4d5 100644 --- a/dist/gridstack-extra.min.css +++ b/dist/gridstack-extra.min.css @@ -1 +1 @@ -.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%} \ No newline at end of file +.grid-stack.grid-stack-1>.grid-stack-item,.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-width='1']{width:100%}.grid-stack.grid-stack-1>.grid-stack-item[data-gs-x='1']{left:100%}.grid-stack.grid-stack-2>.grid-stack-item,.grid-stack.grid-stack-2>.grid-stack-item[data-gs-min-width='1']{min-width:50%}.grid-stack.grid-stack-1>.grid-stack-item[data-gs-max-width='1']{max-width:100%}.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-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-3>.grid-stack-item,.grid-stack.grid-stack-3>.grid-stack-item[data-gs-min-width='1']{min-width:33.3333333333%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-max-width='2']{max-width:100%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-width='1']{width:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-x='1']{left:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-max-width='1']{max-width:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-width='2']{width:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-x='2']{left:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-min-width='2']{min-width:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-max-width='2']{max-width:66.6666666667%}.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-4>.grid-stack-item,.grid-stack.grid-stack-4>.grid-stack-item[data-gs-min-width='1']{min-width:25%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-max-width='3']{max-width:100%}.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-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-5>.grid-stack-item,.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='1']{min-width:20%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-max-width='4']{max-width:100%}.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-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-6>.grid-stack-item,.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='1']{min-width:16.6666666667%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='5']{max-width:100%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='1']{width:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='1']{left:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='1']{max-width:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='2']{width:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='2']{left:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='2']{min-width:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='2']{max-width:33.3333333333%}.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.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='4']{left:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='4']{min-width:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='4']{max-width:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='5']{width:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='5']{left:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='5']{min-width:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='5']{max-width:83.3333333333%}.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-7>.grid-stack-item,.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='1']{min-width:14.2857142857%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='6']{max-width:100%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='1']{width:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='1']{left:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='1']{max-width:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='2']{width:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='2']{left:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='2']{min-width:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='2']{max-width:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='3']{width:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='3']{left:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='3']{min-width:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='3']{max-width:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='4']{width:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='4']{left:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='4']{min-width:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='4']{max-width:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='5']{width:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='5']{left:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='5']{min-width:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='5']{max-width:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='6']{width:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='6']{left:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='6']{min-width:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='6']{max-width:85.7142857143%}.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-8>.grid-stack-item,.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='1']{min-width:12.5%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='7']{max-width:100%}.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-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-9>.grid-stack-item,.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='1']{min-width:11.1111111111%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='8']{max-width:100%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='1']{width:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='1']{left:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='1']{max-width:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='2']{width:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='2']{left:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='2']{min-width:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='2']{max-width:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='3']{width:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='3']{left:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='3']{min-width:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='3']{max-width:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='4']{width:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='4']{left:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='4']{min-width:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='4']{max-width:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='5']{width:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='5']{left:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='5']{min-width:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='5']{max-width:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='6']{width:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='6']{left:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='6']{min-width:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='6']{max-width:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='7']{width:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='7']{left:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='7']{min-width:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='7']{max-width:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='8']{width:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='8']{left:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='8']{min-width:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='8']{max-width:88.8888888889%}.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-10>.grid-stack-item,.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='1']{min-width:10%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='9']{max-width:100%}.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-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-11>.grid-stack-item,.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='1']{min-width:9.0909090909%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='10']{max-width:100%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='1']{width:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='1']{left:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='1']{max-width:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='2']{width:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='2']{left:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='2']{min-width:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='2']{max-width:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='3']{width:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='3']{left:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='3']{min-width:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='3']{max-width:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='4']{width:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='4']{left:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='4']{min-width:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='4']{max-width:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='5']{width:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='5']{left:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='5']{min-width:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='5']{max-width:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='6']{width:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='6']{left:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='6']{min-width:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='6']{max-width:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='7']{width:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='7']{left:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='7']{min-width:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='7']{max-width:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='8']{width:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='8']{left:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='8']{min-width:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='8']{max-width:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='9']{width:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='9']{left:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='9']{min-width:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='9']{max-width:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='10']{width:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='10']{left:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='10']{min-width:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='10']{max-width:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='11']{width:100%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='11']{left:100%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='11']{min-width:100%}.grid-stack.grid-stack-12>.grid-stack-item,.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='1']{min-width:8.3333333333%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='11']{max-width:100%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='1']{width:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='1']{left:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='1']{max-width:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='2']{width:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='2']{left:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='2']{min-width:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='2']{max-width:16.6666666667%}.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.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='4']{left:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='4']{min-width:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='4']{max-width:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='5']{width:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='5']{left:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='5']{min-width:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='5']{max-width:41.6666666667%}.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.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='7']{left:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='7']{min-width:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='7']{max-width:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='8']{width:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='8']{left:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='8']{min-width:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='8']{max-width:66.6666666667%}.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.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='10']{left:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='10']{min-width:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='10']{max-width:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='11']{width:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='11']{left:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='11']{min-width:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='11']{max-width:91.6666666667%}.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%} \ No newline at end of file diff --git a/dist/gridstack.css b/dist/gridstack.css index 50d468e..70ec399 100644 --- a/dist/gridstack.css +++ b/dist/gridstack.css @@ -5,6 +5,7 @@ .grid-stack { position: relative; } + .grid-stack .grid-stack-placeholder > .placeholder-content { border: 1px dashed lightgray; margin: 0; @@ -15,12 +16,15 @@ bottom: 0; width: auto; z-index: 0 !important; + text-align: center; } + .grid-stack > .grid-stack-item { - min-width: 8.33333333%; + min-width: 8.3333333333%; position: absolute; padding: 0; } + .grid-stack > .grid-stack-item > .grid-stack-item-content { margin: 0; position: absolute; @@ -33,6 +37,7 @@ overflow-x: hidden; overflow-y: auto; } + .grid-stack > .grid-stack-item > .ui-resizable-handle { position: absolute; font-size: 0.1px; @@ -40,18 +45,23 @@ -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 { + +.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; @@ -64,19 +74,21 @@ -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; @@ -84,6 +96,7 @@ left: 10px; top: 0; } + .grid-stack > .grid-stack-item > .ui-resizable-n { cursor: n-resize; height: 10px; @@ -91,6 +104,7 @@ left: 25px; right: 25px; } + .grid-stack > .grid-stack-item > .ui-resizable-ne { cursor: ne-resize; width: 20px; @@ -98,6 +112,7 @@ right: 10px; top: 0; } + .grid-stack > .grid-stack-item > .ui-resizable-e { cursor: e-resize; width: 10px; @@ -105,6 +120,7 @@ top: 15px; bottom: 15px; } + .grid-stack > .grid-stack-item > .ui-resizable-se { cursor: se-resize; width: 20px; @@ -112,6 +128,7 @@ right: 10px; bottom: 0; } + .grid-stack > .grid-stack-item > .ui-resizable-s { cursor: s-resize; height: 10px; @@ -119,6 +136,7 @@ bottom: 0; right: 25px; } + .grid-stack > .grid-stack-item > .ui-resizable-sw { cursor: sw-resize; width: 20px; @@ -126,6 +144,7 @@ left: 10px; bottom: 0; } + .grid-stack > .grid-stack-item > .ui-resizable-w { cursor: w-resize; width: 10px; @@ -133,158 +152,211 @@ top: 15px; bottom: 15px; } + .grid-stack > .grid-stack-item[data-gs-width='1'] { - width: 8.33333333%; + width: 8.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-x='1'] { - left: 8.33333333%; + left: 8.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-min-width='1'] { - min-width: 8.33333333%; + min-width: 8.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-max-width='1'] { - max-width: 8.33333333%; + max-width: 8.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-width='2'] { - width: 16.66666667%; + width: 16.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-x='2'] { - left: 16.66666667%; + left: 16.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-min-width='2'] { - min-width: 16.66666667%; + min-width: 16.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-max-width='2'] { - max-width: 16.66666667%; + max-width: 16.6666666667%; } + .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%; + width: 33.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-x='4'] { - left: 33.33333333%; + left: 33.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-min-width='4'] { - min-width: 33.33333333%; + min-width: 33.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-max-width='4'] { - max-width: 33.33333333%; + max-width: 33.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-width='5'] { - width: 41.66666667%; + width: 41.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-x='5'] { - left: 41.66666667%; + left: 41.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-min-width='5'] { - min-width: 41.66666667%; + min-width: 41.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-max-width='5'] { - max-width: 41.66666667%; + max-width: 41.6666666667%; } + .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%; + width: 58.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-x='7'] { - left: 58.33333333%; + left: 58.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-min-width='7'] { - min-width: 58.33333333%; + min-width: 58.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-max-width='7'] { - max-width: 58.33333333%; + max-width: 58.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-width='8'] { - width: 66.66666667%; + width: 66.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-x='8'] { - left: 66.66666667%; + left: 66.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-min-width='8'] { - min-width: 66.66666667%; + min-width: 66.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-max-width='8'] { - max-width: 66.66666667%; + max-width: 66.6666666667%; } + .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%; + width: 83.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-x='10'] { - left: 83.33333333%; + left: 83.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-min-width='10'] { - min-width: 83.33333333%; + min-width: 83.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-max-width='10'] { - max-width: 83.33333333%; + max-width: 83.3333333333%; } + .grid-stack > .grid-stack-item[data-gs-width='11'] { - width: 91.66666667%; + width: 91.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-x='11'] { - left: 91.66666667%; + left: 91.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-min-width='11'] { - min-width: 91.66666667%; + min-width: 91.6666666667%; } + .grid-stack > .grid-stack-item[data-gs-max-width='11'] { - max-width: 91.66666667%; + max-width: 91.6666666667%; } + .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 { + +.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 { + +.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; @@ -296,7 +368,6 @@ /* .grid-stack > .grid-stack-item > .ui-resizable-sw { display: inline-block; - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); @include vendor(transform, rotate(180deg)); } */ @@ -311,7 +382,6 @@ .grid-stack-item .ui-resizable-handle { display: none; } - .grid-stack { height: auto !important; } diff --git a/dist/gridstack.js b/dist/gridstack.js index 9b7aaa7..73bdd28 100644 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -1,22 +1,43 @@ -// 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. - +/** + * gridstack.js 0.2.5-dev + * http://troolee.github.io/gridstack.js/ + * (c) 2014-2016 Pavel Reznikov + * gridstack.js may be freely distributed under the MIT license. + * @preserve +*/ (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); - } - else { + } else if (typeof exports !== 'undefined') { + try { jQuery = require('jquery'); } catch (e) {} + try { _ = require('lodash'); } catch (e) {} + factory(jQuery, _); + } else { factory(jQuery, _); } })(function($, _) { var scope = window; + var obsolete = function(f, oldName, newName) { + var wrapper = function() { + console.warn('gridstack.js: Function `' + oldName + '` is deprecated as of v0.2.5 and has been replaced with `' + + newName + '`. It will be **completely** removed in v1.0.'); + return f.apply(this, arguments); + }; + wrapper.prototype = f.prototype; + + return wrapper; + }; + + var obsoleteOpts = function(oldName, newName) { + console.warn('gridstack.js: Option `' + oldName + '` is deprecated as of v0.2.5 and has been replaced with `' + + newName + '`. It will be **completely** removed in v1.0.'); + }; + var Utils = { - is_intercepted: function(a, b) { + isIntercepted: 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); }, @@ -26,170 +47,192 @@ return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); }); }, - create_stylesheet: function(id) { + createStylesheet: function(id) { var style = document.createElement('style'); style.setAttribute('type', 'text/css'); style.setAttribute('data-gs-id', id); if (style.styleSheet) { style.styleSheet.cssText = ''; - } - else { + } else { style.appendChild(document.createTextNode('')); } document.getElementsByTagName('head')[0].appendChild(style); return style.sheet; }, - remove_stylesheet: function(id) { - $("STYLE[data-gs-id=" + id +"]").remove(); + + removeStylesheet: function(id) { + $('STYLE[data-gs-id=' + id + ']').remove(); }, - insert_css_rule: function(sheet, selector, rules, index) { + + insertCSSRule: 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) { - if (typeof v == 'boolean') + if (typeof v == 'boolean') { return v; + } if (typeof v == 'string') { v = v.toLowerCase(); - return !(v == '' || v == 'no' || v == 'false' || v == '0'); + return !(v === '' || v == 'no' || v == 'false' || v == '0'); } return Boolean(v); + }, + + _collisionNodeCheck: function(n) { + return n != this.node && Utils.isIntercepted(n, this.nn); + }, + + _didCollideFloat: function(bn) { + return this.n != bn && + Utils.isIntercepted({x: this.n.x, y: this.newY, width: this.n.width, height: this.n.height}, bn); + }, + + _didCollide: function(bn) { + return Utils.isIntercepted({x: this.n.x, y: this.newY, width: this.n.width, height: this.n.height}, bn); + }, + + _isAddNodeIntercepted: function(n) { + return Utils.isIntercepted({x: this.x, y: this.y, width: this.node.width, height: this.node.height}, n); } }; - var id_seq = 0; + // jscs:disable requireCamelCaseOrUpperCaseIdentifiers + Utils.is_intercepted = obsolete(Utils.isIntercepted, 'is_intercepted', 'isIntercepted'); - var GridStackEngine = function(width, onchange, float_mode, height, items) { + Utils.create_stylesheet = obsolete(Utils.createStylesheet, 'create_stylesheet', 'createStylesheet'); + + Utils.remove_stylesheet = obsolete(Utils.removeStylesheet, 'remove_stylesheet', 'removeStylesheet'); + + Utils.insert_css_rule = obsolete(Utils.insertCSSRule, 'insert_css_rule', 'insertCSSRule'); + // jscs:enable requireCamelCaseOrUpperCaseIdentifiers + + var idSeq = 0; + + var GridStackEngine = function(width, onchange, floatMode, height, items) { this.width = width; - this['float'] = float_mode || false; + this.float = floatMode || false; this.height = height || 0; this.nodes = items || []; this.onchange = onchange || function() {}; - this._update_counter = 0; - this._float = this['float']; + this._updateCounter = 0; + this._float = this.float; }; - GridStackEngine.prototype.batch_update = function() { - this._update_counter = 1; + GridStackEngine.prototype.batchUpdate = function() { + this._updateCounter = 1; this.float = true; }; GridStackEngine.prototype.commit = function() { - this._update_counter = 0; - if (this._update_counter == 0) { + this._updateCounter = 0; + if (this._updateCounter === 0) { this.float = this._float; - this._pack_nodes(); + this._packNodes(); this._notify(); } }; - GridStackEngine.prototype._fix_collisions = function(node) { - this._sort_nodes(-1); + GridStackEngine.prototype._fixCollisions = function(node) { + var self = this; + this._sortNodes(-1); - var nn = node, has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked })); - if (!this.float && !has_locked) { + var nn = node; + var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; })); + if (!this.float && !hasLocked) { nn = {x: 0, y: node.y, width: this.width, height: node.height}; } - while (true) { - var collision_node = _.find(this.nodes, function(n) { - return n != node && Utils.is_intercepted(n, nn); - }, this); - if (typeof collision_node == 'undefined') { + var collisionNode = _.find(this.nodes, _.bind(Utils._collisionNodeCheck, {node: node, nn: nn})); + if (typeof collisionNode == 'undefined') { return; } - this.move_node(collision_node, collision_node.x, node.y + node.height, - collision_node.width, collision_node.height, true); + this.moveNode(collisionNode, collisionNode.x, node.y + node.height, + collisionNode.width, collisionNode.height, true); } }; - GridStackEngine.prototype.is_area_empty = function(x, y, width, height) { + GridStackEngine.prototype.isAreaEmpty = 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) { - return Utils.is_intercepted(n, nn); - }, this); - return collision_node == null; + var collisionNode = _.find(this.nodes, _.bind(function(n) { + return Utils.isIntercepted(n, nn); + }, this)); + return collisionNode === null; }; - GridStackEngine.prototype._sort_nodes = function(dir) { + GridStackEngine.prototype._sortNodes = function(dir) { this.nodes = Utils.sort(this.nodes, dir, this.width); }; - GridStackEngine.prototype._pack_nodes = function() { - this._sort_nodes(); + GridStackEngine.prototype._packNodes = function() { + this._sortNodes(); if (this.float) { - _.each(this.nodes, function(n, i) { - if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y) + _.each(this.nodes, _.bind(function(n, i) { + if (n._updating || typeof n._origY == 'undefined' || n.y == n._origY) { 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); - }) + var newY = n.y; + while (newY >= n._origY) { + var collisionNode = _.chain(this.nodes) + .find(_.bind(Utils._didCollide, {n: n, newY: newY})) .value(); - if (!collision_node) { + if (!collisionNode) { n._dirty = true; - n.y = new_y; + n.y = newY; } - --new_y; + --newY; } - }, this); - } - else { - _.each(this.nodes, function(n, i) { - if (n.locked) + }, this)); + } else { + _.each(this.nodes, _.bind(function(n, i) { + if (n.locked) { return; + } while (n.y > 0) { - var new_y = n.y - 1; - var can_be_moved = i == 0; + var newY = n.y - 1; + var canBeMoved = i === 0; if (i > 0) { - var collision_node = _.chain(this.nodes) + var collisionNode = _.chain(this.nodes) .take(i) - .find(function(bn) { - return Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn); - }) + .find(_.bind(Utils._didCollide, {n: n, newY: newY})) .value(); - can_be_moved = typeof collision_node == 'undefined'; + canBeMoved = typeof collisionNode == 'undefined'; } - if (!can_be_moved) { + if (!canBeMoved) { break; } - n._dirty = n.y != new_y; - n.y = new_y; + n._dirty = n.y != newY; + n.y = newY; } - }, this); + }, this)); } }; - GridStackEngine.prototype._prepare_node = function(node, resizing) { - node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0 }); + GridStackEngine.prototype._prepareNode = function(node, resizing) { + node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0}); node.x = parseInt('' + node.x); node.y = parseInt('' + node.y); node.width = parseInt('' + node.width); node.height = parseInt('' + node.height); - node.auto_position = node.auto_position || false; - node.no_resize = node.no_resize || false; - node.no_move = node.no_move || false; + node.autoPosition = node.autoPosition || false; + node.noResize = node.noResize || false; + node.noMove = node.noMove || false; if (node.width > this.width) { node.width = this.width; - } - else if (node.width < 1) { + } else if (node.width < 1) { node.width = 1; } @@ -204,8 +247,7 @@ if (node.x + node.width > this.width) { if (resizing) { node.width = this.width - node.x; - } - else { + } else { node.x = this.width - node.width; } } @@ -218,44 +260,43 @@ }; GridStackEngine.prototype._notify = function() { - if (this._update_counter) { + if (this._updateCounter) { return; } - var deleted_nodes = Array.prototype.slice.call(arguments, 1).concat(this.get_dirty_nodes()); - deleted_nodes = deleted_nodes.concat(this.get_dirty_nodes()); - this.onchange(deleted_nodes); + var deletedNodes = Array.prototype.slice.call(arguments, 1).concat(this.getDirtyNodes()); + deletedNodes = deletedNodes.concat(this.getDirtyNodes()); + this.onchange(deletedNodes); }; - GridStackEngine.prototype.clean_nodes = function() { - _.each(this.nodes, function(n) {n._dirty = false }); + GridStackEngine.prototype.cleanNodes = function() { + _.each(this.nodes, function(n) {n._dirty = false; }); }; - GridStackEngine.prototype.get_dirty_nodes = function() { + GridStackEngine.prototype.getDirtyNodes = function() { return _.filter(this.nodes, function(n) { return n._dirty; }); }; - GridStackEngine.prototype.add_node = function(node) { - node = this._prepare_node(node); + GridStackEngine.prototype.addNode = function(node) { + node = this._prepareNode(node); - if (typeof node.max_width != 'undefined') node.width = Math.min(node.width, node.max_width); - if (typeof node.max_height != 'undefined') node.height = Math.min(node.height, node.max_height); - if (typeof node.min_width != 'undefined') node.width = Math.max(node.width, node.min_width); - if (typeof node.min_height != 'undefined') node.height = Math.max(node.height, node.min_height); + if (typeof node.maxWidth != 'undefined') { node.width = Math.min(node.width, node.maxWidth); } + if (typeof node.maxHeight != 'undefined') { node.height = Math.min(node.height, node.maxHeight); } + if (typeof node.minWidth != 'undefined') { node.width = Math.max(node.width, node.minWidth); } + if (typeof node.minHeight != 'undefined') { node.height = Math.max(node.height, node.minHeight); } - node._id = ++id_seq; + node._id = ++idSeq; node._dirty = true; - if (node.auto_position) { - this._sort_nodes(); + if (node.autoPosition) { + this._sortNodes(); for (var i = 0;; ++i) { - var x = i % this.width, y = Math.floor(i / this.width); + var x = i % this.width; + var y = Math.floor(i / this.width); if (x + node.width > this.width) { continue; } - if (!_.find(this.nodes, function(n) { - return Utils.is_intercepted({x: x, y: y, width: node.width, height: node.height}, n); - })) { + if (!_.find(this.nodes, _.bind(Utils._isAddNodeIntercepted, {x: x, y: y, node: node}))) { node.x = x; node.y = y; break; @@ -265,26 +306,27 @@ this.nodes.push(node); - this._fix_collisions(node); - this._pack_nodes(); + this._fixCollisions(node); + this._packNodes(); this._notify(); return node; }; - GridStackEngine.prototype.remove_node = function(node) { + GridStackEngine.prototype.removeNode = function(node) { node._id = null; this.nodes = _.without(this.nodes, node); - this._pack_nodes(); + this._packNodes(); 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.canMoveNode = function(node, x, y, width, height) { + var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; })); - if (!this.height && !has_locked) + if (!this.height && !hasLocked) { return true; + } - var cloned_node; + var clonedNode; var clone = new GridStackEngine( this.width, null, @@ -292,50 +334,53 @@ 0, _.map(this.nodes, function(n) { if (n == node) { - cloned_node = $.extend({}, n); - return cloned_node; + clonedNode = $.extend({}, n); + return clonedNode; } return $.extend({}, n); })); - clone.move_node(cloned_node, x, y, width, height); + clone.moveNode(clonedNode, x, y, width, height); var res = true; - if (has_locked) + if (hasLocked) { res &= !Boolean(_.find(clone.nodes, function(n) { - return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty); + return n != clonedNode && Boolean(n.locked) && Boolean(n._dirty); })); - if (this.height) - res &= clone.get_grid_height() <= this.height; + } + if (this.height) { + res &= clone.getGridHeight() <= this.height; + } return res; }; - GridStackEngine.prototype.can_be_placed_with_respect_to_height = function(node) { - if (!this.height) + GridStackEngine.prototype.canBePlacedWithRespectToHeight = function(node) { + if (!this.height) { return true; + } var clone = new GridStackEngine( this.width, null, this.float, 0, - _.map(this.nodes, function(n) { return $.extend({}, n) })); - clone.add_node(node); - return clone.get_grid_height() <= this.height; + _.map(this.nodes, function(n) { return $.extend({}, n); })); + clone.addNode(node); + return clone.getGridHeight() <= this.height; }; - 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; - if (typeof height != 'number') height = node.height; + GridStackEngine.prototype.moveNode = function(node, x, y, width, height, noPack) { + if (typeof x != 'number') { x = node.x; } + if (typeof y != 'number') { y = node.y; } + if (typeof width != 'number') { width = node.width; } + if (typeof height != 'number') { height = node.height; } - if (typeof node.max_width != 'undefined') width = Math.min(width, node.max_width); - if (typeof node.max_height != 'undefined') height = Math.min(height, node.max_height); - if (typeof node.min_width != 'undefined') width = Math.max(width, node.min_width); - if (typeof node.min_height != 'undefined') height = Math.max(height, node.min_height); + if (typeof node.maxWidth != 'undefined') { width = Math.min(width, node.maxWidth); } + if (typeof node.maxHeight != 'undefined') { height = Math.min(height, node.maxHeight); } + if (typeof node.minWidth != 'undefined') { width = Math.max(width, node.minWidth); } + if (typeof node.minHeight != 'undefined') { height = Math.max(height, node.minHeight); } if (node.x == x && node.y == y && node.width == width && node.height == height) { return node; @@ -349,30 +394,30 @@ node.width = width; node.height = height; - node = this._prepare_node(node, resizing); + node = this._prepareNode(node, resizing); - this._fix_collisions(node); - if (!no_pack) { - this._pack_nodes(); + this._fixCollisions(node); + if (!noPack) { + this._packNodes(); this._notify(); } return node; }; - GridStackEngine.prototype.get_grid_height = function() { + GridStackEngine.prototype.getGridHeight = function() { return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0); }; - GridStackEngine.prototype.begin_update = function(node) { + GridStackEngine.prototype.beginUpdate = function(node) { _.each(this.nodes, function(n) { - n._orig_y = n.y; + n._origY = n.y; }); node._updating = true; }; - GridStackEngine.prototype.end_update = function() { + GridStackEngine.prototype.endUpdate = function() { _.each(this.nodes, function(n) { - n._orig_y = n.y; + n._origY = n.y; }); var n = _.find(this.nodes, function(n) { return n._updating; }); if (n) { @@ -381,75 +426,128 @@ }; var GridStack = function(el, opts) { - var self = this, one_column_mode; + var self = this; + var oneColumnMode; opts = opts || {}; this.container = $(el); - opts.item_class = opts.item_class || 'grid-stack-item'; - var is_nested = this.container.closest('.' + opts.item_class).size() > 0; + // jscs:disable requireCamelCaseOrUpperCaseIdentifiers + if (typeof opts.handle_class !== 'undefined') { + opts.handleClass = opts.handle_class; + obsoleteOpts('handle_class', 'handleClass'); + } + if (typeof opts.item_class !== 'undefined') { + opts.itemClass = opts.item_class; + obsoleteOpts('item_class', 'itemClass'); + } + if (typeof opts.placeholder_class !== 'undefined') { + opts.placeholderClass = opts.placeholder_class; + obsoleteOpts('placeholder_class', 'placeholderClass'); + } + if (typeof opts.placeholder_text !== 'undefined') { + opts.placeholderText = opts.placeholder_text; + obsoleteOpts('placeholder_text', 'placeholderText'); + } + if (typeof opts.item_class !== 'undefined') { + opts.itemClass = opts.item_class; + obsoleteOpts('item_class', 'itemClass'); + } + if (typeof opts.cell_height !== 'undefined') { + opts.cellHeight = opts.cell_height; + obsoleteOpts('cell_height', 'cellHeight'); + } + if (typeof opts.vertical_margin !== 'undefined') { + opts.verticalMargin = opts.vertical_margin; + obsoleteOpts('vertical_margin', 'verticalMargin'); + } + if (typeof opts.min_width !== 'undefined') { + opts.minWidth = opts.min_width; + obsoleteOpts('min_width', 'minWidth'); + } + if (typeof opts.static_grid !== 'undefined') { + opts.staticGrid = opts.static_grid; + obsoleteOpts('static_grid', 'staticGrid'); + } + if (typeof opts.is_nested !== 'undefined') { + opts.isNested = opts.is_nested; + obsoleteOpts('is_nested', 'isNested'); + } + if (typeof opts.always_show_resize_handle !== 'undefined') { + opts.alwaysShowResizeHandle = opts.always_show_resize_handle; + obsoleteOpts('always_show_resize_handle', 'alwaysShowResizeHandle'); + } + // jscs:enable requireCamelCaseOrUpperCaseIdentifiers + + opts.itemClass = opts.itemClass || 'grid-stack-item'; + var isNested = this.container.closest('.' + opts.itemClass).size() > 0; this.opts = _.defaults(opts || {}, { width: parseInt(this.container.attr('data-gs-width')) || 12, height: parseInt(this.container.attr('data-gs-height')) || 0, - item_class: 'grid-stack-item', - placeholder_class: 'grid-stack-placeholder', + itemClass: 'grid-stack-item', + placeholderClass: 'grid-stack-placeholder', + placeholderText: '', handle: '.grid-stack-item-content', - handle_class: null, - cell_height: 60, - vertical_margin: 20, + handleClass: null, + cellHeight: 60, + verticalMargin: 20, auto: true, - min_width: 768, + minWidth: 768, float: false, - static_grid: false, - _class: 'grid-stack-' + (Math.random() * 10000).toFixed(0), + staticGrid: false, + _class: 'grid-stack-instance-' + (Math.random() * 10000).toFixed(0), animate: Boolean(this.container.attr('data-gs-animate')) || false, - always_show_resize_handle: opts.always_show_resize_handle || false, + alwaysShowResizeHandle: opts.alwaysShowResizeHandle || false, resizable: _.defaults(opts.resizable || {}, { - autoHide: !(opts.always_show_resize_handle || false), + autoHide: !(opts.alwaysShowResizeHandle || false), handles: 'se' }), draggable: _.defaults(opts.draggable || {}, { - handle: (opts.handle_class ? '.' + opts.handle_class : (opts.handle ? opts.handle : '')) || '.grid-stack-item-content', + handle: (opts.handleClass ? '.' + opts.handleClass : (opts.handle ? opts.handle : '')) || + '.grid-stack-item-content', scroll: false, appendTo: 'body' }) }); - this.opts.is_nested = is_nested; + this.opts.isNested = isNested; + + this.cellHeight(this.opts.cellHeight, true); + this.verticalMargin(this.opts.verticalMargin, true); this.container.addClass(this.opts._class); - this._set_static_class(); + this._setStaticClass(); - if (is_nested) { + if (isNested) { this.container.addClass('grid-stack-nested'); } - this._init_styles(); + this._initStyles(); this.grid = new GridStackEngine(this.opts.width, function(nodes) { - var max_height = 0; + var maxHeight = 0; _.each(nodes, function(n) { - if (n._id == null) { + if (n._id === null) { n.el.remove(); - } - else { + } else { n.el .attr('data-gs-x', n.x) .attr('data-gs-y', n.y) .attr('data-gs-width', n.width) .attr('data-gs-height', n.height); - max_height = Math.max(max_height, n.y + n.height); + maxHeight = Math.max(maxHeight, n.y + n.height); } }); - self._update_styles(max_height + 10); + self._updateStyles(maxHeight + 10); }, this.opts.float, this.opts.height); if (this.opts.auto) { var elements = []; var _this = this; - this.container.children('.' + this.opts.item_class + ':not(.' + this.opts.placeholder_class + ')').each(function(index, el) { + this.container.children('.' + this.opts.itemClass + ':not(.' + this.opts.placeholderClass + ')') + .each(function(index, el) { el = $(el); elements.push({ el: el, @@ -457,69 +555,68 @@ }); }); _.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) { - self._prepare_element(i.el); + self._prepareElement(i.el); }).value(); } - this.set_animation(this.opts.animate); + this.setAnimation(this.opts.animate); this.placeholder = $( - '
' + - '
').hide(); + '
' + + '
' + this.opts.placeholderText + '
').hide(); - this.container.height( - this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - - this.opts.vertical_margin); + this._updateContainerHeight(); - this.on_resize_handler = function() { - if (self._is_one_column_mode()) { - if (one_column_mode) + this.onResizeHandler = function() { + if (self._isOneColumnMode()) { + if (oneColumnMode) { return; + } - one_column_mode = true; + oneColumnMode = true; - self.grid._sort_nodes(); + self.grid._sortNodes(); _.each(self.grid.nodes, function(node) { self.container.append(node.el); - if (self.opts.static_grid) { + if (self.opts.staticGrid) { return; } - if (!node.no_move) { + if (!node.noMove) { node.el.draggable('disable'); } - if (!node.no_resize) { + if (!node.noResize) { node.el.resizable('disable'); } }); - } - else { - if (!one_column_mode) + } else { + if (!oneColumnMode) { return; + } - one_column_mode = false; + oneColumnMode = false; - if (self.opts.static_grid) { + if (self.opts.staticGrid) { return; } _.each(self.grid.nodes, function(node) { - if (!node.no_move) { + if (!node.noMove) { node.el.draggable('enable'); } - if (!node.no_resize) { + if (!node.noResize) { node.el.resizable('enable'); } }); } }; - $(window).resize(this.on_resize_handler); - this.on_resize_handler(); + $(window).resize(this.onResizeHandler); + this.onResizeHandler(); }; - GridStack.prototype._trigger_change_event = function(forceTrigger) { - var elements = this.grid.get_dirty_nodes(); + GridStack.prototype._triggerChangeEvent = function(forceTrigger) { + var elements = this.grid.getDirtyNodes(); var hasChanges = false; var eventParams = []; @@ -533,110 +630,165 @@ } }; - GridStack.prototype._init_styles = function() { - if (this._styles_id) { - $('[data-gs-id="' + this._styles_id + '"]').remove(); + GridStack.prototype._initStyles = function() { + if (!this.opts.cellHeight) { //that will be handled by CSS + return ; } - this._styles_id = 'gridstack-style-' + (Math.random() * 100000).toFixed(); - this._styles = Utils.create_stylesheet(this._styles_id); - if (this._styles != null) + if (this._stylesId) { + $('[data-gs-id="' + this._stylesId + '"]').remove(); + } + this._stylesId = 'gridstack-style-' + (Math.random() * 100000).toFixed(); + this._styles = Utils.createStylesheet(this._stylesId); + if (this._styles != null) { this._styles._max = 0; + } }; - GridStack.prototype._update_styles = function(max_height) { - if (this._styles == null) { + GridStack.prototype._updateStyles = function(maxHeight) { + if (this._styles === null) { return; } - var prefix = '.' + this.opts._class + ' .' + this.opts.item_class; + var prefix = '.' + this.opts._class + ' .' + this.opts.itemClass; + var self = this; + var getHeight; - if (typeof max_height == 'undefined') { - max_height = this._styles._max; - this._init_styles(); - this._update_container_height(); + if (typeof maxHeight == 'undefined') { + maxHeight = this._styles._max; + this._initStyles(); + this._updateContainerHeight(); + } + if (!this.opts.cellHeight) { //the rest will be handled by CSS + return ; + } + if (this._styles._max !== 0 && maxHeight <= this._styles._max) { + return ; } - if (this._styles._max == 0) { - Utils.insert_css_rule(this._styles, prefix, 'min-height: ' + (this.opts.cell_height) + 'px;', 0); + if (!this.opts.verticalMargin || this.opts.cellHeightUnit === this.opts.verticalMarginUnit) { + getHeight = function(nbRows, nbMargins) { + return (self.opts.cellHeight * nbRows + self.opts.verticalMargin * nbMargins) + self.opts.cellHeightUnit; + }; + } else { + getHeight = function(nbRows, nbMargins) { + if (!nbRows || !nbMargins) { + return (self.opts.cellHeight * nbRows + self.opts.verticalMargin * nbMargins) + self.opts.cellHeightUnit; + } + return 'calc(' + ((self.opts.cellHeight * nbRows) + self.opts.cellHeightUnit) + ' + ' + + ((self.opts.verticalMargin * nbMargins) + self.opts.verticalMarginUnit) + ')'; + }; } - if (max_height > this._styles._max) { - for (var i = this._styles._max; i < max_height; ++i) { - Utils.insert_css_rule(this._styles, + if (this._styles._max === 0) { + Utils.insertCSSRule(this._styles, prefix, 'min-height: ' + getHeight(1, 0) + ';', 0); + } + + if (maxHeight > this._styles._max) { + for (var i = this._styles._max; i < maxHeight; ++i) { + Utils.insertCSSRule(this._styles, prefix + '[data-gs-height="' + (i + 1) + '"]', - 'height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', + 'height: ' + getHeight(i + 1, i) + ';', i ); - Utils.insert_css_rule(this._styles, + Utils.insertCSSRule(this._styles, prefix + '[data-gs-min-height="' + (i + 1) + '"]', - 'min-height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', + 'min-height: ' + getHeight(i + 1, i) + ';', i ); - Utils.insert_css_rule(this._styles, + Utils.insertCSSRule(this._styles, prefix + '[data-gs-max-height="' + (i + 1) + '"]', - 'max-height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', + 'max-height: ' + getHeight(i + 1, i) + ';', i ); - Utils.insert_css_rule(this._styles, + Utils.insertCSSRule(this._styles, prefix + '[data-gs-y="' + i + '"]', - 'top: ' + (this.opts.cell_height * i + this.opts.vertical_margin * i) + 'px;', + 'top: ' + getHeight(i, i) + ';', i ); } - this._styles._max = max_height; + this._styles._max = maxHeight; } }; - GridStack.prototype._update_container_height = function() { - if (this.grid._update_counter) { + GridStack.prototype._updateContainerHeight = function() { + if (this.grid._updateCounter) { return; } - this.container.height( - this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - - this.opts.vertical_margin); + var height = this.grid.getGridHeight(); + this.container.attr('data-gs-current-height', height); + if (!this.opts.cellHeight) { + return ; + } + if (!this.opts.verticalMargin) { + this.container.css('height', (height * (this.opts.cellHeight)) + this.opts.cellHeightUnit); + } else if (this.opts.cellHeightUnit === this.opts.verticalMarginUnit) { + this.container.css('height', (height * (this.opts.cellHeight + this.opts.verticalMargin) - + this.opts.verticalMargin) + this.opts.cellHeightUnit); + } else { + this.container.css('height', 'calc(' + ((height * (this.opts.cellHeight)) + this.opts.cellHeightUnit) + + ' + ' + ((height * (this.opts.verticalMargin - 1)) + this.opts.verticalMarginUnit) + ')'); + } }; - GridStack.prototype._is_one_column_mode = function() { + GridStack.prototype._isOneColumnMode = function() { return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= - this.opts.min_width; + this.opts.minWidth; }; - GridStack.prototype._prepare_element = function(el) { + GridStack.prototype._prepareElement = function(el) { var self = this; el = $(el); - el.addClass(this.opts.item_class); - - var node = self.grid.add_node({ + el.addClass(this.opts.itemClass); + var node = self.grid.addNode({ x: el.attr('data-gs-x'), y: el.attr('data-gs-y'), width: el.attr('data-gs-width'), height: el.attr('data-gs-height'), - max_width: el.attr('data-gs-max-width'), - min_width: el.attr('data-gs-min-width'), - max_height: el.attr('data-gs-max-height'), - min_height: el.attr('data-gs-min-height'), - auto_position: Utils.toBool(el.attr('data-gs-auto-position')), - no_resize: Utils.toBool(el.attr('data-gs-no-resize')), - no_move: Utils.toBool(el.attr('data-gs-no-move')), + maxWidth: el.attr('data-gs-max-width'), + minWidth: el.attr('data-gs-min-width'), + maxHeight: el.attr('data-gs-max-height'), + minHeight: el.attr('data-gs-min-height'), + autoPosition: Utils.toBool(el.attr('data-gs-auto-position')), + noResize: Utils.toBool(el.attr('data-gs-no-resize')), + noMove: Utils.toBool(el.attr('data-gs-no-move')), locked: Utils.toBool(el.attr('data-gs-locked')), el: el }); el.data('_gridstack_node', node); - if (self.opts.static_grid) { + if (self.opts.staticGrid) { return; } - var cell_width, cell_height; + var cellWidth; + var cellHeight; - var on_start_moving = function(event, ui) { + var dragOrResize = function(event, ui) { + var x = Math.round(ui.position.left / cellWidth); + var y = Math.floor((ui.position.top + cellHeight / 2) / cellHeight); + var width; + var height; + if (event.type != 'drag') { + width = Math.round(ui.size.width / cellWidth); + height = Math.round(ui.size.height / cellHeight); + } + + if (!self.grid.canMoveNode(node, x, y, width, height)) { + return; + } + self.grid.moveNode(node, x, y, width, height); + self._updateContainerHeight(); + }; + + var onStartMoving = function(event, ui) { self.container.append(self.placeholder); var o = $(this); - self.grid.clean_nodes(); - self.grid.begin_update(node); - cell_width = Math.ceil(o.outerWidth() / o.attr('data-gs-width')); - cell_height = self.opts.cell_height + self.opts.vertical_margin; + self.grid.cleanNodes(); + self.grid.beginUpdate(node); + cellWidth = Math.ceil(o.outerWidth() / o.attr('data-gs-width')); + var strictCellHeight = Math.ceil(o.outerHeight() / o.attr('data-gs-height')); + cellHeight = self.container.height() / parseInt(self.container.attr('data-gs-current-height')); self.placeholder .attr('data-gs-x', o.attr('data-gs-x')) .attr('data-gs-y', o.attr('data-gs-y')) @@ -645,11 +797,15 @@ .show(); node.el = self.placeholder; - el.resizable('option', 'minWidth', cell_width * (node.min_width || 1)); - el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); + el.resizable('option', 'minWidth', cellWidth * (node.minWidth || 1)); + el.resizable('option', 'minHeight', strictCellHeight * (node.minHeight || 1)); + + if (event.type == 'resizestart') { + o.find('.grid-stack-item').trigger('resizestart'); + } }; - var on_end_moving = function(event, ui) { + var onEndMoving = function(event, ui) { self.placeholder.detach(); var o = $(this); node.el = o; @@ -660,124 +816,126 @@ .attr('data-gs-width', node.width) .attr('data-gs-height', node.height) .removeAttr('style'); - self._update_container_height(); - self._trigger_change_event(); + self._updateContainerHeight(); + self._triggerChangeEvent(); - self.grid.end_update(); + self.grid.endUpdate(); + + var nestedGrids = o.find('.grid-stack'); + if (nestedGrids.length && event.type == 'resizestop') { + nestedGrids.each(function(index, el) { + $(el).data('gridstack').onResizeHandler(); + }); + o.find('.grid-stack-item').trigger('resizestop'); + } }; - el.draggable(_.extend(this.opts.draggable, { - start: on_start_moving, - stop: on_end_moving, - drag: function(event, ui) { - var x = Math.round(ui.position.left / cell_width), - 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; - } - self.grid.move_node(node, x, y); - self._update_container_height(); - }, - containment: this.opts.is_nested ? this.container.parent() : null - })).resizable(_.extend(this.opts.resizable, { - start: on_start_moving, - stop: on_end_moving, - resize: function(event, ui) { - var x = Math.round(ui.position.left / cell_width), - 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)) { - return; - } - self.grid.move_node(node, x, y, width, height); - self._update_container_height(); - } - })); + el + .draggable(_.extend(this.opts.draggable, { + containment: this.opts.isNested ? this.container.parent() : null, + start: onStartMoving, + stop: onEndMoving, + drag: dragOrResize + })) + .resizable(_.extend(this.opts.resizable, { + start: onStartMoving, + stop: onEndMoving, + resize: dragOrResize + })); - if (node.no_move || this._is_one_column_mode()) { + if (node.noMove || this._isOneColumnMode()) { el.draggable('disable'); } - if (node.no_resize || this._is_one_column_mode()) { + if (node.noResize || this._isOneColumnMode()) { el.resizable('disable'); } el.attr('data-gs-locked', node.locked ? 'yes' : null); }; - GridStack.prototype.set_animation = function(enable) { + GridStack.prototype.setAnimation = function(enable) { if (enable) { this.container.addClass('grid-stack-animate'); - } - else { + } else { this.container.removeClass('grid-stack-animate'); } }; - GridStack.prototype.add_widget = function(el, x, y, width, height, auto_position) { + GridStack.prototype.addWidget = function(el, x, y, width, height, autoPosition) { el = $(el); - if (typeof x != 'undefined') el.attr('data-gs-x', x); - if (typeof y != 'undefined') el.attr('data-gs-y', y); - if (typeof width != 'undefined') el.attr('data-gs-width', width); - if (typeof height != 'undefined') el.attr('data-gs-height', height); - if (typeof auto_position != 'undefined') el.attr('data-gs-auto-position', auto_position ? 'yes' : null); + if (typeof x != 'undefined') { el.attr('data-gs-x', x); } + if (typeof y != 'undefined') { el.attr('data-gs-y', y); } + if (typeof width != 'undefined') { el.attr('data-gs-width', width); } + if (typeof height != 'undefined') { el.attr('data-gs-height', height); } + if (typeof autoPosition != 'undefined') { el.attr('data-gs-auto-position', autoPosition ? 'yes' : null); } this.container.append(el); - this._prepare_element(el); - this._update_container_height(); - this._trigger_change_event(true); + this._prepareElement(el); + this._updateContainerHeight(); + this._triggerChangeEvent(true); return el; }; - 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.makeWidget = function(el) { + el = $(el); + this._prepareElement(el); + this._updateContainerHeight(); + this._triggerChangeEvent(true); + + return el; }; - GridStack.prototype.remove_widget = function(el, detach_node) { - detach_node = typeof detach_node === 'undefined' ? true : detach_node; + GridStack.prototype.willItFit = function(x, y, width, height, autoPosition) { + var node = {x: x, y: y, width: width, height: height, autoPosition: autoPosition}; + return this.grid.canBePlacedWithRespectToHeight(node); + }; + + GridStack.prototype.removeWidget = function(el, detachNode) { + detachNode = typeof detachNode === 'undefined' ? true : detachNode; el = $(el); var node = el.data('_gridstack_node'); - this.grid.remove_node(node); + this.grid.removeNode(node); el.removeData('_gridstack_node'); - this._update_container_height(); - if (detach_node) + this._updateContainerHeight(); + if (detachNode) { el.remove(); - this._trigger_change_event(true); + } + this._triggerChangeEvent(true); }; - GridStack.prototype.remove_all = function(detach_node) { - _.each(this.grid.nodes, function(node) { - this.remove_widget(node.el, detach_node); - }, this); + GridStack.prototype.removeAll = function(detachNode) { + _.each(this.grid.nodes, _.bind(function(node) { + this.removeWidget(node.el, detachNode); + }, this)); this.grid.nodes = []; - this._update_container_height(); + this._updateContainerHeight(); }; GridStack.prototype.destroy = function() { - $(window).off("resize", this.on_resize_handler); + $(window).off('resize', this.onResizeHandler); this.disable(); this.container.remove(); - Utils.remove_stylesheet(this._styles_id); - if (this.grid) + Utils.removeStylesheet(this._stylesId); + if (this.grid) { this.grid = null; + } }; GridStack.prototype.resizable = function(el, val) { + var self = this; el = $(el); el.each(function(index, el) { el = $(el); var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { + if (typeof node == 'undefined' || node === null) { return; } - node.no_resize = !(val || false); - if (node.no_resize) { + node.noResize = !(val || false); + if (node.noResize || self._isOneColumnMode()) { el.resizable('disable'); - } - else { + } else { el.resizable('enable'); } }); @@ -785,33 +943,37 @@ }; GridStack.prototype.movable = function(el, val) { + var self = this; el = $(el); el.each(function(index, el) { el = $(el); var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { + if (typeof node == 'undefined' || node === null) { return; } - node.no_move = !(val || false); - if (node.no_move) { + node.noMove = !(val || false); + if (node.noMove || self._isOneColumnMode()) { el.draggable('disable'); - } - else { + el.removeClass('ui-draggable-handle'); + } else { el.draggable('enable'); + el.addClass('ui-draggable-handle'); } }); return this; }; GridStack.prototype.disable = function() { - this.movable(this.container.children('.' + this.opts.item_class), false); - this.resizable(this.container.children('.' + this.opts.item_class), false); + this.movable(this.container.children('.' + this.opts.itemClass), false); + this.resizable(this.container.children('.' + this.opts.itemClass), false); + this.container.trigger('disable'); }; GridStack.prototype.enable = function() { - this.movable(this.container.children('.' + this.opts.item_class), true); - this.resizable(this.container.children('.' + this.opts.item_class), true); + this.movable(this.container.children('.' + this.opts.itemClass), true); + this.resizable(this.container.children('.' + this.opts.itemClass), true); + this.container.trigger('enable'); }; GridStack.prototype.locked = function(el, val) { @@ -819,7 +981,7 @@ el.each(function(index, el) { el = $(el); var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { + if (typeof node == 'undefined' || node === null) { return; } @@ -829,152 +991,312 @@ return this; }; - 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; - } + GridStack.prototype.maxHeight = 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; - }; + if (!isNaN(val)) { + node.maxHeight = (val || false); + el.attr('data-gs-max-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; - } + GridStack.prototype.minHeight = 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; - }; + if (!isNaN(val)) { + node.minHeight = (val || false); + el.attr('data-gs-min-height', val); + } + }); + return this; + }; - GridStack.prototype._update_element = function(el, callback) { + GridStack.prototype.maxWidth = 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.maxWidth = (val || false); + el.attr('data-gs-max-width', val); + } + }); + return this; + }; + + GridStack.prototype.minWidth = 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.minWidth = (val || false); + el.attr('data-gs-min-width', val); + } + }); + return this; + }; + + GridStack.prototype._updateElement = function(el, callback) { el = $(el).first(); var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { + if (typeof node == 'undefined' || node === null) { return; } var self = this; - self.grid.clean_nodes(); - self.grid.begin_update(node); + self.grid.cleanNodes(); + self.grid.beginUpdate(node); callback.call(this, el, node); - self._update_container_height(); - self._trigger_change_event(); + self._updateContainerHeight(); + self._triggerChangeEvent(); - self.grid.end_update(); + self.grid.endUpdate(); }; 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; + this._updateElement(el, function(el, node) { + width = (width !== null && typeof width != 'undefined') ? width : node.width; + height = (height !== null && typeof height != 'undefined') ? height : node.height; - this.grid.move_node(node, node.x, node.y, width, height); + this.grid.moveNode(node, node.x, node.y, width, height); }); }; 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; + this._updateElement(el, function(el, node) { + x = (x !== null && typeof x != 'undefined') ? x : node.x; + y = (y !== null && typeof y != 'undefined') ? y : node.y; - this.grid.move_node(node, x, y, node.width, node.height); + this.grid.moveNode(node, x, y, node.width, node.height); }); }; 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; - height = (height != null && typeof height != 'undefined') ? height : node.height; + this._updateElement(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; + height = (height !== null && typeof height != 'undefined') ? height : node.height; - this.grid.move_node(node, x, y, width, height); + this.grid.moveNode(node, x, y, width, height); }); }; - GridStack.prototype.cell_height = function(val) { - if (typeof val == 'undefined') { - return this.opts.cell_height; + function parseHeight(val) { + var height = val; + var heightUnit = 'px'; + if (height && _.isString(height)) { + var match = height.match(/^([0-9]+)(px|em|rem)?$/); + if (!match) { + throw new Error('Invalid height'); + } + heightUnit = match[2]; + height = parseInt(match[1]); + } + return {height: height, unit: heightUnit}; + } + + GridStack.prototype.verticalMargin = function(val, noUpdate) { + if (typeof val == 'undefined') { + return this.opts.verticalMargin; + } + + var heightData = parseHeight(val); + + if (this.opts.verticalMarginUnit === heightData.unit && this.opts.height === heightData.height) { + return ; + } + this.opts.verticalMarginUnit = heightData.unit; + this.opts.verticalMargin = heightData.height; + + if (!noUpdate) { + this._updateStyles(); } - val = parseInt(val); - if (val == this.opts.cell_height) - return; - this.opts.cell_height = val || this.opts.cell_height; - this._update_styles(); }; - GridStack.prototype.cell_width = function() { - var o = this.container.children('.' + this.opts.item_class).first(); + GridStack.prototype.cellHeight = function(val, noUpdate) { + if (typeof val == 'undefined') { + if (this.opts.cellHeight) { + return this.opts.cellHeight; + } else { + var o = this.container.children('.' + this.opts.itemClass).first(); + return Math.ceil(o.outerHeight() / o.attr('data-gs-height')); + } + + } + var heightData = parseHeight(val); + + if (this.opts.cellHeightUnit === heightData.heightUnit && this.opts.height === heightData.height) { + return ; + } + this.opts.cellHeightUnit = heightData.unit; + this.opts.cellHeight = heightData.height; + + if (!noUpdate) { + this._updateStyles(); + } + + }; + + GridStack.prototype.cellWidth = function() { + var o = this.container.children('.' + this.opts.itemClass).first(); return Math.ceil(o.outerWidth() / o.attr('data-gs-width')); }; - GridStack.prototype.get_cell_from_pixel = function(position) { + GridStack.prototype.getCellFromPixel = function(position) { var containerPos = this.container.position(); var relativeLeft = position.left - containerPos.left; var relativeTop = position.top - containerPos.top; - var column_width = Math.floor(this.container.width() / this.opts.width); - var row_height = this.opts.cell_height + this.opts.vertical_margin; + var columnWidth = Math.floor(this.container.width() / this.opts.width); + var rowHeight = Math.floor(this.container.height() / parseInt(this.container.attr('data-gs-current-height'))); - return {x: Math.floor(relativeLeft / column_width), y: Math.floor(relativeTop / row_height)}; + return {x: Math.floor(relativeLeft / columnWidth), y: Math.floor(relativeTop / rowHeight)}; }; - GridStack.prototype.batch_update = function() { - this.grid.batch_update(); + GridStack.prototype.batchUpdate = function() { + this.grid.batchUpdate(); }; GridStack.prototype.commit = function() { this.grid.commit(); - this._update_container_height(); + this._updateContainerHeight(); }; - GridStack.prototype.is_area_empty = function(x, y, width, height) { - return this.grid.is_area_empty(x, y, width, height); + GridStack.prototype.isAreaEmpty = function(x, y, width, height) { + return this.grid.isAreaEmpty(x, y, width, height); }; - GridStack.prototype.set_static = function(static_value) { - this.opts.static_grid = (static_value === true); - this._set_static_class(); + GridStack.prototype.setStatic = function(staticValue) { + this.opts.staticGrid = (staticValue === true); + this._setStaticClass(); }; - GridStack.prototype._set_static_class = function() { - var static_class_name = 'grid-stack-static'; + GridStack.prototype._setStaticClass = function() { + var staticClassName = 'grid-stack-static'; - if (this.opts.static_grid === true) { - this.container.addClass(static_class_name); + if (this.opts.staticGrid === true) { + this.container.addClass(staticClassName); } else { - this.container.removeClass(static_class_name); + this.container.removeClass(staticClassName); } }; + // jscs:disable requireCamelCaseOrUpperCaseIdentifiers + GridStackEngine.prototype.batch_update = obsolete(GridStackEngine.prototype.batchUpdate); + GridStackEngine.prototype._fix_collisions = obsolete(GridStackEngine.prototype._fixCollisions, + '_fix_collisions', '_fixCollisions'); + GridStackEngine.prototype.is_area_empty = obsolete(GridStackEngine.prototype.isAreaEmpty, + 'is_area_empty', 'isAreaEmpty'); + GridStackEngine.prototype._sort_nodes = obsolete(GridStackEngine.prototype._sortNodes, + '_sort_nodes', '_sortNodes'); + GridStackEngine.prototype._pack_nodes = obsolete(GridStackEngine.prototype._packNodes, + '_pack_nodes', '_packNodes'); + GridStackEngine.prototype._prepare_node = obsolete(GridStackEngine.prototype._prepareNode, + '_prepare_node', '_prepareNode'); + GridStackEngine.prototype.clean_nodes = obsolete(GridStackEngine.prototype.cleanNodes, + 'clean_nodes', 'cleanNodes'); + GridStackEngine.prototype.get_dirty_nodes = obsolete(GridStackEngine.prototype.getDirtyNodes, + 'get_dirty_nodes', 'getDirtyNodes'); + GridStackEngine.prototype.add_node = obsolete(GridStackEngine.prototype.addNode, + 'add_node', 'addNode, '); + GridStackEngine.prototype.remove_node = obsolete(GridStackEngine.prototype.removeNode, + 'remove_node', 'removeNode'); + GridStackEngine.prototype.can_move_node = obsolete(GridStackEngine.prototype.canMoveNode, + 'can_move_node', 'canMoveNode'); + GridStackEngine.prototype.move_node = obsolete(GridStackEngine.prototype.moveNode, + 'move_node', 'moveNode'); + GridStackEngine.prototype.get_grid_height = obsolete(GridStackEngine.prototype.getGridHeight, + 'get_grid_height', 'getGridHeight'); + GridStackEngine.prototype.begin_update = obsolete(GridStackEngine.prototype.beginUpdate, + 'begin_update', 'beginUpdate'); + GridStackEngine.prototype.end_update = obsolete(GridStackEngine.prototype.endUpdate, + 'end_update', 'endUpdate'); + GridStackEngine.prototype.can_be_placed_with_respect_to_height = + obsolete(GridStackEngine.prototype.canBePlacedWithRespectToHeight, + 'can_be_placed_with_respect_to_height', 'canBePlacedWithRespectToHeight'); + GridStack.prototype._trigger_change_event = obsolete(GridStack.prototype._triggerChangeEvent, + '_trigger_change_event', '_triggerChangeEvent'); + GridStack.prototype._init_styles = obsolete(GridStack.prototype._initStyles, + '_init_styles', '_initStyles'); + GridStack.prototype._update_styles = obsolete(GridStack.prototype._updateStyles, + '_update_styles', '_updateStyles'); + GridStack.prototype._update_container_height = obsolete(GridStack.prototype._updateContainerHeight, + '_update_container_height', '_updateContainerHeight'); + GridStack.prototype._is_one_column_mode = obsolete(GridStack.prototype._isOneColumnMode, + '_is_one_column_mode',' _isOneColumnMode'); + GridStack.prototype._prepare_element = obsolete(GridStack.prototype._prepareElement, + '_prepare_element', '_prepareElement'); + GridStack.prototype.set_animation = obsolete(GridStack.prototype.setAnimation, + 'set_animation', 'setAnimation'); + GridStack.prototype.add_widget = obsolete(GridStack.prototype.addWidget, + 'add_widget', 'addWidget'); + GridStack.prototype.make_widget = obsolete(GridStack.prototype.makeWidget, + 'make_widget', 'makeWidget'); + GridStack.prototype.will_it_fit = obsolete(GridStack.prototype.willItFit, + 'will_it_fit', 'willItFit'); + GridStack.prototype.remove_widget = obsolete(GridStack.prototype.removeWidget, + 'remove_widget', 'removeWidget'); + GridStack.prototype.remove_all = obsolete(GridStack.prototype.removeAll, + 'remove_all', 'removeAll'); + GridStack.prototype.min_height = obsolete(GridStack.prototype.minHeight, + 'min_height', 'minHeight'); + GridStack.prototype.min_width = obsolete(GridStack.prototype.minWidth, + 'min_width', 'minWidth'); + GridStack.prototype._update_element = obsolete(GridStack.prototype._updateElement, + '_update_element', '_updateElement'); + GridStack.prototype.cell_height = obsolete(GridStack.prototype.cellHeight, + 'cell_height', 'cellHeight'); + GridStack.prototype.cell_width = obsolete(GridStack.prototype.cellWidth, + 'cell_width', 'cellWidth'); + GridStack.prototype.get_cell_from_pixel = obsolete(GridStack.prototype.getCellFromPixel, + 'get_cell_from_pixel', 'getCellFromPixel'); + GridStack.prototype.batch_update = obsolete(GridStack.prototype.batchUpdate, + 'batch_update', 'batchUpdate'); + GridStack.prototype.is_area_empty = obsolete(GridStack.prototype.isAreaEmpty, + 'is_area_empty', 'isAreaEmpty'); + GridStack.prototype.set_static = obsolete(GridStack.prototype.setStatic, + 'set_static', 'setStatic'); + GridStack.prototype._set_static_class = obsolete(GridStack.prototype._setStaticClass, + '_set_static_class', '_setStaticClass'); + // jscs:enable requireCamelCaseOrUpperCaseIdentifiers + scope.GridStackUI = GridStack; scope.GridStackUI.Utils = Utils; $.fn.gridstack = function(opts) { return this.each(function() { - if (!$(this).data('gridstack')) { - $(this).data('gridstack', new GridStack(this, opts)); + var o = $(this); + if (!o.data('gridstack')) { + o + .data('gridstack', new GridStack(this, opts)); } }); }; diff --git a/dist/gridstack.min.css b/dist/gridstack.min.css index a964730..9a0775e 100644 --- a/dist/gridstack.min.css +++ b/dist/gridstack.min.css @@ -1 +1 @@ -: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:.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:.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 .3s,top .3s,height .3s,width .3s;-moz-transition:left .3s,top .3s,height .3s,width .3s;-ms-transition:left .3s,top .3s,height .3s,width .3s;-o-transition:left .3s,top .3s,height .3s,width .3s;transition:left .3s,top .3s,height .3s,width .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 0,top 0,height 0,width 0;-moz-transition:left 0,top 0,height 0,width 0;-ms-transition:left 0,top 0,height 0,width 0;-o-transition:left 0,top 0,height 0,width 0;transition:left 0,top 0,height 0,width 0}@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}} \ No newline at end of file +:root .grid-stack-item>.ui-resizable-handle{filter:none}.grid-stack{position:relative}.grid-stack .grid-stack-placeholder>.placeholder-content{border:1px dashed #d3d3d3;margin:0;position:absolute;top:0;left:10px;right:10px;bottom:0;width:auto;z-index:0!important;text-align:center}.grid-stack>.grid-stack-item{min-width:8.3333333333%;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:.1px;display:block;-ms-touch-action:none;touch-action:none}.grid-stack>.grid-stack-item.ui-resizable-autohide>.ui-resizable-handle,.grid-stack>.grid-stack-item.ui-resizable-disabled>.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-resizable-resizing>.grid-stack-item-content{box-shadow:1px 4px 6px rgba(0,0,0,.2);opacity:.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-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{display:inline-block;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);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.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='1']{left:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='1']{min-width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='1']{max-width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='2']{width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='2']{left:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='2']{min-width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='2']{max-width:16.6666666667%}.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.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='4']{left:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='4']{min-width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='4']{max-width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='5']{width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='5']{left:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='5']{min-width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='5']{max-width:41.6666666667%}.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.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='7']{left:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='7']{min-width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='7']{max-width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='8']{width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='8']{left:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='8']{min-width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='8']{max-width:66.6666666667%}.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.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='10']{left:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='10']{min-width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='10']{max-width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='11']{width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='11']{left:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='11']{min-width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='11']{max-width:91.6666666667%}.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 .3s,top .3s,height .3s,width .3s;-moz-transition:left .3s,top .3s,height .3s,width .3s;-ms-transition:left .3s,top .3s,height .3s,width .3s;-o-transition:left .3s,top .3s,height .3s,width .3s;transition:left .3s,top .3s,height .3s,width .3s}.grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder,.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging,.grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing{-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}@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}} \ No newline at end of file diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index 56fc33d..7c982de 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,16 @@ -!function(t){"function"==typeof define&&define.amd?define(["jquery","lodash","jquery-ui/core","jquery-ui/widget","jquery-ui/mouse","jquery-ui/draggable","jquery-ui/resizable"],t):t(jQuery,_)}(function(t,e){var i=window,n={is_intercepted:function(t,e){return!(t.x+t.width<=e.x||e.x+e.width<=t.x||t.y+t.height<=e.y||e.y+e.height<=t.y)},sort:function(t,i,n){return n=n||e.chain(t).map(function(t){return t.x+t.width}).max().value(),i=-1!=i?1:-1,e.sortBy(t,function(t){return i*(t.x+t.y*n)})},create_stylesheet:function(t){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.setAttribute("data-gs-id",t),e.styleSheet?e.styleSheet.cssText="":e.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(e),e.sheet},remove_stylesheet:function(e){t("STYLE[data-gs-id="+e+"]").remove()},insert_css_rule:function(t,e,i,n){"function"==typeof t.insertRule?t.insertRule(e+"{"+i+"}",n):"function"==typeof t.addRule&&t.addRule(e,i,n)},toBool:function(t){return"boolean"==typeof t?t:"string"==typeof t?(t=t.toLowerCase(),!(""==t||"no"==t||"false"==t||"0"==t)):Boolean(t)}},s=0,o=function(t,e,i,n,s){this.width=t,this["float"]=i||!1,this.height=n||0,this.nodes=s||[],this.onchange=e||function(){},this._update_counter=0,this._float=this["float"]};o.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},o.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},o.prototype._fix_collisions=function(t){this._sort_nodes(-1);var i=t,s=Boolean(e.find(this.nodes,function(t){return t.locked}));for(this["float"]||s||(i={x:0,y:t.y,width:this.width,height:t.height});;){var o=e.find(this.nodes,function(e){return e!=t&&n.is_intercepted(e,i)},this);if("undefined"==typeof o)return;this.move_node(o,o.x,t.y+t.height,o.width,o.height,!0)}},o.prototype.is_area_empty=function(t,i,s,o){var a={x:t||0,y:i||0,width:s||1,height:o||1},h=e.find(this.nodes,function(t){return n.is_intercepted(t,a)},this);return null==h},o.prototype._sort_nodes=function(t){this.nodes=n.sort(this.nodes,t,this.width)},o.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?e.each(this.nodes,function(t,i){if(!t._updating&&"undefined"!=typeof t._orig_y&&t.y!=t._orig_y)for(var s=t.y;s>=t._orig_y;){var o=e.chain(this.nodes).find(function(e){return t!=e&&n.is_intercepted({x:t.x,y:s,width:t.width,height:t.height},e)}).value();o||(t._dirty=!0,t.y=s),--s}},this):e.each(this.nodes,function(t,i){if(!t.locked)for(;t.y>0;){var s=t.y-1,o=0==i;if(i>0){var a=e.chain(this.nodes).take(i).find(function(e){return n.is_intercepted({x:t.x,y:s,width:t.width,height:t.height},e)}).value();o="undefined"==typeof a}if(!o)break;t._dirty=t.y!=s,t.y=s}},this)},o.prototype._prepare_node=function(t,i){return t=e.defaults(t||{},{width:1,height:1,x:0,y:0}),t.x=parseInt(""+t.x),t.y=parseInt(""+t.y),t.width=parseInt(""+t.width),t.height=parseInt(""+t.height),t.auto_position=t.auto_position||!1,t.no_resize=t.no_resize||!1,t.no_move=t.no_move||!1,t.width>this.width?t.width=this.width:t.width<1&&(t.width=1),t.height<1&&(t.height=1),t.x<0&&(t.x=0),t.x+t.width>this.width&&(i?t.width=this.width-t.x:t.x=this.width-t.width),t.y<0&&(t.y=0),t},o.prototype._notify=function(){if(!this._update_counter){var t=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());t=t.concat(this.get_dirty_nodes()),this.onchange(t)}},o.prototype.clean_nodes=function(){e.each(this.nodes,function(t){t._dirty=!1})},o.prototype.get_dirty_nodes=function(){return e.filter(this.nodes,function(t){return t._dirty})},o.prototype.add_node=function(t){if(t=this._prepare_node(t),"undefined"!=typeof t.max_width&&(t.width=Math.min(t.width,t.max_width)),"undefined"!=typeof t.max_height&&(t.height=Math.min(t.height,t.max_height)),"undefined"!=typeof t.min_width&&(t.width=Math.max(t.width,t.min_width)),"undefined"!=typeof t.min_height&&(t.height=Math.max(t.height,t.min_height)),t._id=++s,t._dirty=!0,t.auto_position){this._sort_nodes();for(var i=0;;++i){var o=i%this.width,a=Math.floor(i/this.width);if(!(o+t.width>this.width||e.find(this.nodes,function(e){return n.is_intercepted({x:o,y:a,width:t.width,height:t.height},e)}))){t.x=o,t.y=a;break}}}return this.nodes.push(t),this._fix_collisions(t),this._pack_nodes(),this._notify(),t},o.prototype.remove_node=function(t){t._id=null,this.nodes=e.without(this.nodes,t),this._pack_nodes(),this._notify(t)},o.prototype.can_move_node=function(i,n,s,a,h){var r=Boolean(e.find(this.nodes,function(t){return t.locked}));if(!this.height&&!r)return!0;var d,_=new o(this.width,null,this["float"],0,e.map(this.nodes,function(e){return e==i?d=t.extend({},e):t.extend({},e)}));_.move_node(d,n,s,a,h);var l=!0;return r&&(l&=!Boolean(e.find(_.nodes,function(t){return t!=d&&Boolean(t.locked)&&Boolean(t._dirty)}))),this.height&&(l&=_.get_grid_height()<=this.height),l},o.prototype.can_be_placed_with_respect_to_height=function(i){if(!this.height)return!0;var n=new o(this.width,null,this["float"],0,e.map(this.nodes,function(e){return t.extend({},e)}));return n.add_node(i),n.get_grid_height()<=this.height},o.prototype.move_node=function(t,e,i,n,s,o){if("number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof n&&(n=t.width),"number"!=typeof s&&(s=t.height),"undefined"!=typeof t.max_width&&(n=Math.min(n,t.max_width)),"undefined"!=typeof t.max_height&&(s=Math.min(s,t.max_height)),"undefined"!=typeof t.min_width&&(n=Math.max(n,t.min_width)),"undefined"!=typeof t.min_height&&(s=Math.max(s,t.min_height)),t.x==e&&t.y==i&&t.width==n&&t.height==s)return t;var a=t.width!=n;return t._dirty=!0,t.x=e,t.y=i,t.width=n,t.height=s,t=this._prepare_node(t,a),this._fix_collisions(t),o||(this._pack_nodes(),this._notify()),t},o.prototype.get_grid_height=function(){return e.reduce(this.nodes,function(t,e){return Math.max(t,e.y+e.height)},0)},o.prototype.begin_update=function(t){e.each(this.nodes,function(t){t._orig_y=t.y}),t._updating=!0},o.prototype.end_update=function(){e.each(this.nodes,function(t){t._orig_y=t.y});var t=e.find(this.nodes,function(t){return t._updating});t&&(t._updating=!1)};var a=function(i,n){var s,a=this;n=n||{},this.container=t(i),n.item_class=n.item_class||"grid-stack-item";var h=this.container.closest("."+n.item_class).size()>0;if(this.opts=e.defaults(n||{},{width:parseInt(this.container.attr("data-gs-width"))||12,height:parseInt(this.container.attr("data-gs-height"))||0,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",handle:".grid-stack-item-content",handle_class:null,cell_height:60,vertical_margin:20,auto:!0,min_width:768,"float":!1,static_grid:!1,_class:"grid-stack-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:n.always_show_resize_handle||!1,resizable:e.defaults(n.resizable||{},{autoHide:!n.always_show_resize_handle,handles:"se"}),draggable:e.defaults(n.draggable||{},{handle:(n.handle_class?"."+n.handle_class:n.handle?n.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"})}),this.opts.is_nested=h,this.container.addClass(this.opts._class),this._set_static_class(),h&&this.container.addClass("grid-stack-nested"),this._init_styles(),this.grid=new o(this.opts.width,function(t){var i=0;e.each(t,function(t){null==t._id?t.el.remove():(t.el.attr("data-gs-x",t.x).attr("data-gs-y",t.y).attr("data-gs-width",t.width).attr("data-gs-height",t.height),i=Math.max(i,t.y+t.height))}),a._update_styles(i+10)},this.opts["float"],this.opts.height),this.opts.auto){var r=[],d=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(e,i){i=t(i),r.push({el:i,i:parseInt(i.attr("data-gs-x"))+parseInt(i.attr("data-gs-y"))*d.opts.width})}),e.chain(r).sortBy(function(t){return t.i}).each(function(t){a._prepare_element(t.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=t('
').hide(),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(a._is_one_column_mode()){if(s)return;s=!0,a.grid._sort_nodes(),e.each(a.grid.nodes,function(t){a.container.append(t.el),a.opts.static_grid||(t.no_move||t.el.draggable("disable"),t.no_resize||t.el.resizable("disable"))})}else{if(!s)return;if(s=!1,a.opts.static_grid)return;e.each(a.grid.nodes,function(t){t.no_move||t.el.draggable("enable"),t.no_resize||t.el.resizable("enable")})}},t(window).resize(this.on_resize_handler),this.on_resize_handler()};return a.prototype._trigger_change_event=function(t){var e=this.grid.get_dirty_nodes(),i=!1,n=[];e&&e.length&&(n.push(e),i=!0),(i||t===!0)&&this.container.trigger("change",n)},a.prototype._init_styles=function(){this._styles_id&&t('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=n.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},a.prototype._update_styles=function(t){if(null!=this._styles){var e="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof t&&(t=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&n.insert_css_rule(this._styles,e,"min-height: "+this.opts.cell_height+"px;",0),t>this._styles._max){for(var i=this._styles._max;t>i;++i)n.insert_css_rule(this._styles,e+'[data-gs-height="'+(i+1)+'"]',"height: "+(this.opts.cell_height*(i+1)+this.opts.vertical_margin*i)+"px;",i),n.insert_css_rule(this._styles,e+'[data-gs-min-height="'+(i+1)+'"]',"min-height: "+(this.opts.cell_height*(i+1)+this.opts.vertical_margin*i)+"px;",i),n.insert_css_rule(this._styles,e+'[data-gs-max-height="'+(i+1)+'"]',"max-height: "+(this.opts.cell_height*(i+1)+this.opts.vertical_margin*i)+"px;",i),n.insert_css_rule(this._styles,e+'[data-gs-y="'+i+'"]',"top: "+(this.opts.cell_height*i+this.opts.vertical_margin*i)+"px;",i);this._styles._max=t}}},a.prototype._update_container_height=function(){this.grid._update_counter||this.container.height(this.grid.get_grid_height()*(this.opts.cell_height+this.opts.vertical_margin)-this.opts.vertical_margin)},a.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},a.prototype._prepare_element=function(i){var s=this;i=t(i),i.addClass(this.opts.item_class);var o=s.grid.add_node({x:i.attr("data-gs-x"),y:i.attr("data-gs-y"),width:i.attr("data-gs-width"),height:i.attr("data-gs-height"),max_width:i.attr("data-gs-max-width"),min_width:i.attr("data-gs-min-width"),max_height:i.attr("data-gs-max-height"),min_height:i.attr("data-gs-min-height"),auto_position:n.toBool(i.attr("data-gs-auto-position")),no_resize:n.toBool(i.attr("data-gs-no-resize")),no_move:n.toBool(i.attr("data-gs-no-move")),locked:n.toBool(i.attr("data-gs-locked")),el:i});if(i.data("_gridstack_node",o),!s.opts.static_grid){var a,h,r=function(e,n){s.container.append(s.placeholder);var r=t(this);s.grid.clean_nodes(),s.grid.begin_update(o),a=Math.ceil(r.outerWidth()/r.attr("data-gs-width")),h=s.opts.cell_height+s.opts.vertical_margin,s.placeholder.attr("data-gs-x",r.attr("data-gs-x")).attr("data-gs-y",r.attr("data-gs-y")).attr("data-gs-width",r.attr("data-gs-width")).attr("data-gs-height",r.attr("data-gs-height")).show(),o.el=s.placeholder,i.resizable("option","minWidth",a*(o.min_width||1)),i.resizable("option","minHeight",s.opts.cell_height*(o.min_height||1))},d=function(e,i){s.placeholder.detach();var n=t(this);o.el=n,s.placeholder.hide(),n.attr("data-gs-x",o.x).attr("data-gs-y",o.y).attr("data-gs-width",o.width).attr("data-gs-height",o.height).removeAttr("style"),s._update_container_height(),s._trigger_change_event(),s.grid.end_update()};i.draggable(e.extend(this.opts.draggable,{start:r,stop:d,drag:function(t,e){var i=Math.round(e.position.left/a),n=Math.floor((e.position.top+h/2)/h);s.grid.can_move_node(o,i,n,o.width,o.height)&&(s.grid.move_node(o,i,n),s._update_container_height())},containment:this.opts.is_nested?this.container.parent():null})).resizable(e.extend(this.opts.resizable,{start:r,stop:d,resize:function(t,e){var i=Math.round(e.position.left/a),n=Math.floor((e.position.top+h/2)/h),r=Math.round(e.size.width/a),d=Math.round(e.size.height/h);s.grid.can_move_node(o,i,n,r,d)&&(s.grid.move_node(o,i,n,r,d),s._update_container_height())}})),(o.no_move||this._is_one_column_mode())&&i.draggable("disable"),(o.no_resize||this._is_one_column_mode())&&i.resizable("disable"),i.attr("data-gs-locked",o.locked?"yes":null)}},a.prototype.set_animation=function(t){t?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},a.prototype.add_widget=function(e,i,n,s,o,a){return e=t(e),"undefined"!=typeof i&&e.attr("data-gs-x",i),"undefined"!=typeof n&&e.attr("data-gs-y",n),"undefined"!=typeof s&&e.attr("data-gs-width",s),"undefined"!=typeof o&&e.attr("data-gs-height",o),"undefined"!=typeof a&&e.attr("data-gs-auto-position",a?"yes":null),this.container.append(e),this._prepare_element(e),this._update_container_height(),this._trigger_change_event(!0),e},a.prototype.will_it_fit=function(t,e,i,n,s){var o={x:t,y:e,width:i,height:n,auto_position:s};return this.grid.can_be_placed_with_respect_to_height(o)},a.prototype.remove_widget=function(e,i){i="undefined"==typeof i?!0:i,e=t(e);var n=e.data("_gridstack_node");this.grid.remove_node(n),e.removeData("_gridstack_node"),this._update_container_height(),i&&e.remove(),this._trigger_change_event(!0)},a.prototype.remove_all=function(t){e.each(this.grid.nodes,function(e){this.remove_widget(e.el,t)},this),this.grid.nodes=[],this._update_container_height()},a.prototype.destroy=function(){t(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),n.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},a.prototype.resizable=function(e,i){return e=t(e),e.each(function(e,n){n=t(n);var s=n.data("_gridstack_node");"undefined"!=typeof s&&null!=s&&(s.no_resize=!i,s.no_resize?n.resizable("disable"):n.resizable("enable"))}),this},a.prototype.movable=function(e,i){return e=t(e),e.each(function(e,n){n=t(n);var s=n.data("_gridstack_node");"undefined"!=typeof s&&null!=s&&(s.no_move=!i,s.no_move?n.draggable("disable"):n.draggable("enable"))}),this},a.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1)},a.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0)},a.prototype.locked=function(e,i){return e=t(e),e.each(function(e,n){n=t(n);var s=n.data("_gridstack_node");"undefined"!=typeof s&&null!=s&&(s.locked=i||!1,n.attr("data-gs-locked",s.locked?"yes":null))}),this},a.prototype.min_height=function(e,i){return e=t(e),e.each(function(e,n){n=t(n);var s=n.data("_gridstack_node");"undefined"!=typeof s&&null!=s&&(isNaN(i)||(s.min_height=i||!1,n.attr("data-gs-min-height",i)))}),this},a.prototype.min_width=function(e,i){return e=t(e),e.each(function(e,n){n=t(n);var s=n.data("_gridstack_node");"undefined"!=typeof s&&null!=s&&(isNaN(i)||(s.min_width=i||!1,n.attr("data-gs-min-width",i)))}),this},a.prototype._update_element=function(e,i){e=t(e).first();var n=e.data("_gridstack_node");if("undefined"!=typeof n&&null!=n){var s=this;s.grid.clean_nodes(),s.grid.begin_update(n),i.call(this,e,n),s._update_container_height(),s._trigger_change_event(),s.grid.end_update()}},a.prototype.resize=function(t,e,i){this._update_element(t,function(t,n){e=null!=e&&"undefined"!=typeof e?e:n.width,i=null!=i&&"undefined"!=typeof i?i:n.height,this.grid.move_node(n,n.x,n.y,e,i)})},a.prototype.move=function(t,e,i){this._update_element(t,function(t,n){e=null!=e&&"undefined"!=typeof e?e:n.x,i=null!=i&&"undefined"!=typeof i?i:n.y,this.grid.move_node(n,e,i,n.width,n.height)})},a.prototype.update=function(t,e,i,n,s){this._update_element(t,function(t,o){e=null!=e&&"undefined"!=typeof e?e:o.x,i=null!=i&&"undefined"!=typeof i?i:o.y,n=null!=n&&"undefined"!=typeof n?n:o.width,s=null!=s&&"undefined"!=typeof s?s:o.height,this.grid.move_node(o,e,i,n,s)})},a.prototype.cell_height=function(t){return"undefined"==typeof t?this.opts.cell_height:(t=parseInt(t),void(t!=this.opts.cell_height&&(this.opts.cell_height=t||this.opts.cell_height,this._update_styles())))},a.prototype.cell_width=function(){var t=this.container.children("."+this.opts.item_class).first();return Math.ceil(t.outerWidth()/t.attr("data-gs-width"))},a.prototype.get_cell_from_pixel=function(t){var e=this.container.position(),i=t.left-e.left,n=t.top-e.top,s=Math.floor(this.container.width()/this.opts.width),o=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(i/s),y:Math.floor(n/o)}},a.prototype.batch_update=function(){this.grid.batch_update()},a.prototype.commit=function(){this.grid.commit(),this._update_container_height()},a.prototype.is_area_empty=function(t,e,i,n){return this.grid.is_area_empty(t,e,i,n)},a.prototype.set_static=function(t){this.opts.static_grid=t===!0,this._set_static_class()},a.prototype._set_static_class=function(){var t="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(t):this.container.removeClass(t)},i.GridStackUI=a,i.GridStackUI.Utils=n,t.fn.gridstack=function(e){return this.each(function(){t(this).data("gridstack")||t(this).data("gridstack",new a(this,e))})},i.GridStackUI}); +/** + * gridstack.js 0.2.5-dev + * http://troolee.github.io/gridstack.js/ + * (c) 2014-2016 Pavel Reznikov + * gridstack.js may be freely distributed under the MIT license. + * @preserve +*/ +!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash","jquery-ui/core","jquery-ui/widget","jquery-ui/mouse","jquery-ui/draggable","jquery-ui/resizable"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(b){}try{_=require("lodash")}catch(b){}a(jQuery,_)}else a(jQuery,_)}(function(a,b){function c(a){var c=a,d="px";if(c&&b.isString(c)){var e=c.match(/^([0-9]+)(px|em|rem)?$/);if(!e)throw new Error("Invalid height");d=e[2],c=parseInt(e[1])}return{height:c,unit:d}}var d=window,e=function(a,b,c){var d=function(){return console.warn("gridstack.js: Function `"+b+"` is deprecated as of v0.2.5 and has been replaced with `"+c+"`. It will be **completely** removed in v1.0."),a.apply(this,arguments)};return d.prototype=a.prototype,d},f=function(a,b){console.warn("gridstack.js: Option `"+a+"` is deprecated as of v0.2.5 and has been replaced with `"+b+"`. It will be **completely** removed in v1.0.")},g={isIntercepted: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(a,c,d){return d=d||b.chain(a).map(function(a){return a.x+a.width}).max().value(),c=-1!=c?1:-1,b.sortBy(a,function(a){return c*(a.x+a.y*d)})},createStylesheet:function(a){var b=document.createElement("style");return b.setAttribute("type","text/css"),b.setAttribute("data-gs-id",a),b.styleSheet?b.styleSheet.cssText="":b.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(b),b.sheet},removeStylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insertCSSRule:function(a,b,c,d){"function"==typeof a.insertRule?a.insertRule(b+"{"+c+"}",d):"function"==typeof a.addRule&&a.addRule(b,c,d)},toBool:function(a){return"boolean"==typeof a?a:"string"==typeof a?(a=a.toLowerCase(),!(""===a||"no"==a||"false"==a||"0"==a)):Boolean(a)},_collisionNodeCheck:function(a){return a!=this.node&&g.isIntercepted(a,this.nn)},_didCollideFloat:function(a){return this.n!=a&&g.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},a)},_didCollide:function(a){return g.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},a)},_isAddNodeIntercepted:function(a){return g.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},a)}}; +// jscs:disable requireCamelCaseOrUpperCaseIdentifiers +g.is_intercepted=e(g.isIntercepted,"is_intercepted","isIntercepted"),g.create_stylesheet=e(g.createStylesheet,"create_stylesheet","createStylesheet"),g.remove_stylesheet=e(g.removeStylesheet,"remove_stylesheet","removeStylesheet"),g.insert_css_rule=e(g.insertCSSRule,"insert_css_rule","insertCSSRule"); +// jscs:enable requireCamelCaseOrUpperCaseIdentifiers +var h=0,i=function(a,b,c,d,e){this.width=a,this["float"]=c||!1,this.height=d||0,this.nodes=e||[],this.onchange=b||function(){},this._updateCounter=0,this._float=this["float"]};i.prototype.batchUpdate=function(){this._updateCounter=1,this["float"]=!0},i.prototype.commit=function(){this._updateCounter=0,0===this._updateCounter&&(this["float"]=this._float,this._packNodes(),this._notify())},i.prototype._fixCollisions=function(a){this._sortNodes(-1);var c=a,d=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||d||(c={x:0,y:a.y,width:this.width,height:a.height});;){var e=b.find(this.nodes,b.bind(g._collisionNodeCheck,{node:a,nn:c}));if("undefined"==typeof e)return;this.moveNode(e,e.x,a.y+a.height,e.width,e.height,!0)}},i.prototype.isAreaEmpty=function(a,c,d,e){var f={x:a||0,y:c||0,width:d||1,height:e||1},h=b.find(this.nodes,b.bind(function(a){return g.isIntercepted(a,f)},this));return null===h},i.prototype._sortNodes=function(a){this.nodes=g.sort(this.nodes,a,this.width)},i.prototype._packNodes=function(){this._sortNodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._origY&&a.y!=a._origY)for(var d=a.y;d>=a._origY;){var e=b.chain(this.nodes).find(b.bind(g._didCollide,{n:a,newY:d})).value();e||(a._dirty=!0,a.y=d),--d}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var d=a.y-1,e=0===c;if(c>0){var f=b.chain(this.nodes).take(c).find(b.bind(g._didCollide,{n:a,newY:d})).value();e="undefined"==typeof f}if(!e)break;a._dirty=a.y!=d,a.y=d}},this))},i.prototype._prepareNode=function(a,c){return a=b.defaults(a||{},{width:1,height:1,x:0,y:0}),a.x=parseInt(""+a.x),a.y=parseInt(""+a.y),a.width=parseInt(""+a.width),a.height=parseInt(""+a.height),a.autoPosition=a.autoPosition||!1,a.noResize=a.noResize||!1,a.noMove=a.noMove||!1,a.width>this.width?a.width=this.width:a.width<1&&(a.width=1),a.height<1&&(a.height=1),a.x<0&&(a.x=0),a.x+a.width>this.width&&(c?a.width=this.width-a.x:a.x=this.width-a.width),a.y<0&&(a.y=0),a},i.prototype._notify=function(){if(!this._updateCounter){var a=Array.prototype.slice.call(arguments,1).concat(this.getDirtyNodes());a=a.concat(this.getDirtyNodes()),this.onchange(a)}},i.prototype.cleanNodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},i.prototype.getDirtyNodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},i.prototype.addNode=function(a){if(a=this._prepareNode(a),"undefined"!=typeof a.maxWidth&&(a.width=Math.min(a.width,a.maxWidth)),"undefined"!=typeof a.maxHeight&&(a.height=Math.min(a.height,a.maxHeight)),"undefined"!=typeof a.minWidth&&(a.width=Math.max(a.width,a.minWidth)),"undefined"!=typeof a.minHeight&&(a.height=Math.max(a.height,a.minHeight)),a._id=++h,a._dirty=!0,a.autoPosition){this._sortNodes();for(var c=0;;++c){var d=c%this.width,e=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,b.bind(g._isAddNodeIntercepted,{x:d,y:e,node:a})))){a.x=d,a.y=e;break}}}return this.nodes.push(a),this._fixCollisions(a),this._packNodes(),this._notify(),a},i.prototype.removeNode=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._packNodes(),this._notify(a)},i.prototype.canMoveNode=function(c,d,e,f,g){var h=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!h)return!0;var j,k=new i(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.moveNode(j,d,e,f,g);var l=!0;return h&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.getGridHeight()<=this.height),l},i.prototype.canBePlacedWithRespectToHeight=function(c){if(!this.height)return!0;var d=new i(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.addNode(c),d.getGridHeight()<=this.height},i.prototype.moveNode=function(a,b,c,d,e,f){if("number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),"undefined"!=typeof a.maxWidth&&(d=Math.min(d,a.maxWidth)),"undefined"!=typeof a.maxHeight&&(e=Math.min(e,a.maxHeight)),"undefined"!=typeof a.minWidth&&(d=Math.max(d,a.minWidth)),"undefined"!=typeof a.minHeight&&(e=Math.max(e,a.minHeight)),a.x==b&&a.y==c&&a.width==d&&a.height==e)return a;var g=a.width!=d;return a._dirty=!0,a.x=b,a.y=c,a.width=d,a.height=e,a=this._prepareNode(a,g),this._fixCollisions(a),f||(this._packNodes(),this._notify()),a},i.prototype.getGridHeight=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},i.prototype.beginUpdate=function(a){b.each(this.nodes,function(a){a._origY=a.y}),a._updating=!0},i.prototype.endUpdate=function(){b.each(this.nodes,function(a){a._origY=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var j=function(c,d){var e,g=this;d=d||{},this.container=a(c),"undefined"!=typeof d.handle_class&&(d.handleClass=d.handle_class,f("handle_class","handleClass")),"undefined"!=typeof d.item_class&&(d.itemClass=d.item_class,f("item_class","itemClass")),"undefined"!=typeof d.placeholder_class&&(d.placeholderClass=d.placeholder_class,f("placeholder_class","placeholderClass")),"undefined"!=typeof d.placeholder_text&&(d.placeholderText=d.placeholder_text,f("placeholder_text","placeholderText")),"undefined"!=typeof d.item_class&&(d.itemClass=d.item_class,f("item_class","itemClass")),"undefined"!=typeof d.cell_height&&(d.cellHeight=d.cell_height,f("cell_height","cellHeight")),"undefined"!=typeof d.vertical_margin&&(d.verticalMargin=d.vertical_margin,f("vertical_margin","verticalMargin")),"undefined"!=typeof d.min_width&&(d.minWidth=d.min_width,f("min_width","minWidth")),"undefined"!=typeof d.static_grid&&(d.staticGrid=d.static_grid,f("static_grid","staticGrid")),"undefined"!=typeof d.is_nested&&(d.isNested=d.is_nested,f("is_nested","isNested")),"undefined"!=typeof d.always_show_resize_handle&&(d.alwaysShowResizeHandle=d.always_show_resize_handle,f("always_show_resize_handle","alwaysShowResizeHandle")),d.itemClass=d.itemClass||"grid-stack-item";var h=this.container.closest("."+d.itemClass).size()>0;if(this.opts=b.defaults(d||{},{width:parseInt(this.container.attr("data-gs-width"))||12,height:parseInt(this.container.attr("data-gs-height"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:!0,minWidth:768,"float":!1,staticGrid:!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,alwaysShowResizeHandle:d.alwaysShowResizeHandle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.alwaysShowResizeHandle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handleClass?"."+d.handleClass:d.handle?d.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"})}),this.opts.isNested=h,this.cellHeight(this.opts.cellHeight,!0),this.verticalMargin(this.opts.verticalMargin,!0),this.container.addClass(this.opts._class),this._setStaticClass(),h&&this.container.addClass("grid-stack-nested"),this._initStyles(),this.grid=new i(this.opts.width,function(a){var c=0;b.each(a,function(a){null===a._id?a.el.remove():(a.el.attr("data-gs-x",a.x).attr("data-gs-y",a.y).attr("data-gs-width",a.width).attr("data-gs-height",a.height),c=Math.max(c,a.y+a.height))}),g._updateStyles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var j=[],k=this;this.container.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(b,c){c=a(c),j.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*k.opts.width})}),b.chain(j).sortBy(function(a){return a.i}).each(function(a){g._prepareElement(a.el)}).value()}this.setAnimation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholderText+"
").hide(),this._updateContainerHeight(),this.onResizeHandler=function(){if(g._isOneColumnMode()){if(e)return;e=!0,g.grid._sortNodes(),b.each(g.grid.nodes,function(a){g.container.append(a.el),g.opts.staticGrid||(a.noMove||a.el.draggable("disable"),a.noResize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,g.opts.staticGrid)return;b.each(g.grid.nodes,function(a){a.noMove||a.el.draggable("enable"),a.noResize||a.el.resizable("enable")})}},a(window).resize(this.onResizeHandler),this.onResizeHandler()}; +// jscs:disable requireCamelCaseOrUpperCaseIdentifiers +// jscs:enable requireCamelCaseOrUpperCaseIdentifiers +return j.prototype._triggerChangeEvent=function(a){var b=this.grid.getDirtyNodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},j.prototype._initStyles=function(){this.opts.cellHeight&&(this._stylesId&&a('[data-gs-id="'+this._stylesId+'"]').remove(),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=g.createStylesheet(this._stylesId),null!=this._styles&&(this._styles._max=0))},j.prototype._updateStyles=function(a){if(null!==this._styles){var b,c="."+this.opts._class+" ."+this.opts.itemClass,d=this;if("undefined"==typeof a&&(a=this._styles._max,this._initStyles(),this._updateContainerHeight()),this.opts.cellHeight&&!(0!==this._styles._max&&a<=this._styles._max)&&(b=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(a,b){return a&&b?"calc("+(d.opts.cellHeight*a+d.opts.cellHeightUnit)+" + "+(d.opts.verticalMargin*b+d.opts.verticalMarginUnit)+")":d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit}:function(a,b){return d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit},0===this._styles._max&&g.insertCSSRule(this._styles,c,"min-height: "+b(1,0)+";",0),a>this._styles._max)){for(var e=this._styles._max;a>e;++e)g.insertCSSRule(this._styles,c+'[data-gs-height="'+(e+1)+'"]',"height: "+b(e+1,e)+";",e),g.insertCSSRule(this._styles,c+'[data-gs-min-height="'+(e+1)+'"]',"min-height: "+b(e+1,e)+";",e),g.insertCSSRule(this._styles,c+'[data-gs-max-height="'+(e+1)+'"]',"max-height: "+b(e+1,e)+";",e),g.insertCSSRule(this._styles,c+'[data-gs-y="'+e+'"]',"top: "+b(e,e)+";",e);this._styles._max=a}}},j.prototype._updateContainerHeight=function(){if(!this.grid._updateCounter){var a=this.grid.getGridHeight();this.container.attr("data-gs-current-height",a),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.container.css("height",a*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.container.css("height","calc("+(a*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(a*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.container.css("height",a*this.opts.cellHeight+this.opts.cellHeightUnit))}},j.prototype._isOneColumnMode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.minWidth},j.prototype._prepareElement=function(c){var d=this;c=a(c),c.addClass(this.opts.itemClass);var e=d.grid.addNode({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),maxWidth:c.attr("data-gs-max-width"),minWidth:c.attr("data-gs-min-width"),maxHeight:c.attr("data-gs-max-height"),minHeight:c.attr("data-gs-min-height"),autoPosition:g.toBool(c.attr("data-gs-auto-position")),noResize:g.toBool(c.attr("data-gs-no-resize")),noMove:g.toBool(c.attr("data-gs-no-move")),locked:g.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",e),!d.opts.staticGrid){var f,h,i=function(a,b){var c,g,i=Math.round(b.position.left/f),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/f),g=Math.round(b.size.height/h)),d.grid.canMoveNode(e,i,j,c,g)&&(d.grid.moveNode(e,i,j,c,g),d._updateContainerHeight())},j=function(b,g){d.container.append(d.placeholder);var i=a(this);d.grid.cleanNodes(),d.grid.beginUpdate(e),f=Math.ceil(i.outerWidth()/i.attr("data-gs-width"));var j=Math.ceil(i.outerHeight()/i.attr("data-gs-height"));h=d.container.height()/parseInt(d.container.attr("data-gs-current-height")),d.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),e.el=d.placeholder,c.resizable("option","minWidth",f*(e.minWidth||1)),c.resizable("option","minHeight",j*(e.minHeight||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var f=a(this);e.el=f,d.placeholder.hide(),f.attr("data-gs-x",e.x).attr("data-gs-y",e.y).attr("data-gs-width",e.width).attr("data-gs-height",e.height).removeAttr("style"),d._updateContainerHeight(),d._triggerChangeEvent(),d.grid.endUpdate();var g=f.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").onResizeHandler()}),f.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.isNested?this.container.parent():null,start:j,stop:k,drag:i})).resizable(b.extend(this.opts.resizable,{start:j,stop:k,resize:i})),(e.noMove||this._isOneColumnMode())&&c.draggable("disable"),(e.noResize||this._isOneColumnMode())&&c.resizable("disable"),c.attr("data-gs-locked",e.locked?"yes":null)}},j.prototype.setAnimation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},j.prototype.addWidget=function(b,c,d,e,f,g){return b=a(b),"undefined"!=typeof c&&b.attr("data-gs-x",c),"undefined"!=typeof d&&b.attr("data-gs-y",d),"undefined"!=typeof e&&b.attr("data-gs-width",e),"undefined"!=typeof f&&b.attr("data-gs-height",f),"undefined"!=typeof g&&b.attr("data-gs-auto-position",g?"yes":null),this.container.append(b),this._prepareElement(b),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.makeWidget=function(b){return b=a(b),this._prepareElement(b),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.willItFit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,autoPosition:e};return this.grid.canBePlacedWithRespectToHeight(f)},j.prototype.removeWidget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.removeNode(d),b.removeData("_gridstack_node"),this._updateContainerHeight(),c&&b.remove(),this._triggerChangeEvent(!0)},j.prototype.removeAll=function(a){b.each(this.grid.nodes,b.bind(function(b){this.removeWidget(b.el,a)},this)),this.grid.nodes=[],this._updateContainerHeight()},j.prototype.destroy=function(){a(window).off("resize",this.onResizeHandler),this.disable(),this.container.remove(),g.removeStylesheet(this._stylesId),this.grid&&(this.grid=null)},j.prototype.resizable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");"undefined"!=typeof f&&null!==f&&(f.noResize=!c,f.noResize||d._isOneColumnMode()?e.resizable("disable"):e.resizable("enable"))}),this},j.prototype.movable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");"undefined"!=typeof f&&null!==f&&(f.noMove=!c,f.noMove||d._isOneColumnMode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},j.prototype.disable=function(){this.movable(this.container.children("."+this.opts.itemClass),!1),this.resizable(this.container.children("."+this.opts.itemClass),!1),this.container.trigger("disable")},j.prototype.enable=function(){this.movable(this.container.children("."+this.opts.itemClass),!0),this.resizable(this.container.children("."+this.opts.itemClass),!0),this.container.trigger("enable")},j.prototype.locked=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(e.locked=c||!1,d.attr("data-gs-locked",e.locked?"yes":null))}),this},j.prototype.maxHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!=e&&(isNaN(c)||(e.maxHeight=c||!1,d.attr("data-gs-max-height",c)))}),this},j.prototype.minHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!=e&&(isNaN(c)||(e.minHeight=c||!1,d.attr("data-gs-min-height",c)))}),this},j.prototype.maxWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!=e&&(isNaN(c)||(e.maxWidth=c||!1,d.attr("data-gs-max-width",c)))}),this},j.prototype.minWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!=e&&(isNaN(c)||(e.minWidth=c||!1,d.attr("data-gs-min-width",c)))}),this},j.prototype._updateElement=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!==d){var e=this;e.grid.cleanNodes(),e.grid.beginUpdate(d),c.call(this,b,d),e._updateContainerHeight(),e._triggerChangeEvent(),e.grid.endUpdate()}},j.prototype.resize=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&"undefined"!=typeof b?b:d.width,c=null!==c&&"undefined"!=typeof c?c:d.height,this.grid.moveNode(d,d.x,d.y,b,c)})},j.prototype.move=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&"undefined"!=typeof b?b:d.x,c=null!==c&&"undefined"!=typeof c?c:d.y,this.grid.moveNode(d,b,c,d.width,d.height)})},j.prototype.update=function(a,b,c,d,e){this._updateElement(a,function(a,f){b=null!==b&&"undefined"!=typeof b?b:f.x,c=null!==c&&"undefined"!=typeof c?c:f.y,d=null!==d&&"undefined"!=typeof d?d:f.width,e=null!==e&&"undefined"!=typeof e?e:f.height,this.grid.moveNode(f,b,c,d,e)})},j.prototype.verticalMargin=function(a,b){if("undefined"==typeof a)return this.opts.verticalMargin;var d=c(a);(this.opts.verticalMarginUnit!==d.unit||this.opts.height!==d.height)&&(this.opts.verticalMarginUnit=d.unit,this.opts.verticalMargin=d.height,b||this._updateStyles())},j.prototype.cellHeight=function(a,b){if("undefined"==typeof a){if(this.opts.cellHeight)return this.opts.cellHeight;var d=this.container.children("."+this.opts.itemClass).first();return Math.ceil(d.outerHeight()/d.attr("data-gs-height"))}var e=c(a);(this.opts.cellHeightUnit!==e.heightUnit||this.opts.height!==e.height)&&(this.opts.cellHeightUnit=e.unit,this.opts.cellHeight=e.height,b||this._updateStyles())},j.prototype.cellWidth=function(){var a=this.container.children("."+this.opts.itemClass).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},j.prototype.getCellFromPixel=function(a){var b=this.container.position(),c=a.left-b.left,d=a.top-b.top,e=Math.floor(this.container.width()/this.opts.width),f=Math.floor(this.container.height()/parseInt(this.container.attr("data-gs-current-height")));return{x:Math.floor(c/e),y:Math.floor(d/f)}},j.prototype.batchUpdate=function(){this.grid.batchUpdate()},j.prototype.commit=function(){this.grid.commit(),this._updateContainerHeight()},j.prototype.isAreaEmpty=function(a,b,c,d){return this.grid.isAreaEmpty(a,b,c,d)},j.prototype.setStatic=function(a){this.opts.staticGrid=a===!0,this._setStaticClass()},j.prototype._setStaticClass=function(){var a="grid-stack-static";this.opts.staticGrid===!0?this.container.addClass(a):this.container.removeClass(a)},i.prototype.batch_update=e(i.prototype.batchUpdate),i.prototype._fix_collisions=e(i.prototype._fixCollisions,"_fix_collisions","_fixCollisions"),i.prototype.is_area_empty=e(i.prototype.isAreaEmpty,"is_area_empty","isAreaEmpty"),i.prototype._sort_nodes=e(i.prototype._sortNodes,"_sort_nodes","_sortNodes"),i.prototype._pack_nodes=e(i.prototype._packNodes,"_pack_nodes","_packNodes"),i.prototype._prepare_node=e(i.prototype._prepareNode,"_prepare_node","_prepareNode"),i.prototype.clean_nodes=e(i.prototype.cleanNodes,"clean_nodes","cleanNodes"),i.prototype.get_dirty_nodes=e(i.prototype.getDirtyNodes,"get_dirty_nodes","getDirtyNodes"),i.prototype.add_node=e(i.prototype.addNode,"add_node","addNode, "),i.prototype.remove_node=e(i.prototype.removeNode,"remove_node","removeNode"),i.prototype.can_move_node=e(i.prototype.canMoveNode,"can_move_node","canMoveNode"),i.prototype.move_node=e(i.prototype.moveNode,"move_node","moveNode"),i.prototype.get_grid_height=e(i.prototype.getGridHeight,"get_grid_height","getGridHeight"),i.prototype.begin_update=e(i.prototype.beginUpdate,"begin_update","beginUpdate"),i.prototype.end_update=e(i.prototype.endUpdate,"end_update","endUpdate"),i.prototype.can_be_placed_with_respect_to_height=e(i.prototype.canBePlacedWithRespectToHeight,"can_be_placed_with_respect_to_height","canBePlacedWithRespectToHeight"),j.prototype._trigger_change_event=e(j.prototype._triggerChangeEvent,"_trigger_change_event","_triggerChangeEvent"),j.prototype._init_styles=e(j.prototype._initStyles,"_init_styles","_initStyles"),j.prototype._update_styles=e(j.prototype._updateStyles,"_update_styles","_updateStyles"),j.prototype._update_container_height=e(j.prototype._updateContainerHeight,"_update_container_height","_updateContainerHeight"),j.prototype._is_one_column_mode=e(j.prototype._isOneColumnMode,"_is_one_column_mode"," _isOneColumnMode"),j.prototype._prepare_element=e(j.prototype._prepareElement,"_prepare_element","_prepareElement"),j.prototype.set_animation=e(j.prototype.setAnimation,"set_animation","setAnimation"),j.prototype.add_widget=e(j.prototype.addWidget,"add_widget","addWidget"),j.prototype.make_widget=e(j.prototype.makeWidget,"make_widget","makeWidget"),j.prototype.will_it_fit=e(j.prototype.willItFit,"will_it_fit","willItFit"),j.prototype.remove_widget=e(j.prototype.removeWidget,"remove_widget","removeWidget"),j.prototype.remove_all=e(j.prototype.removeAll,"remove_all","removeAll"),j.prototype.min_height=e(j.prototype.minHeight,"min_height","minHeight"),j.prototype.min_width=e(j.prototype.minWidth,"min_width","minWidth"),j.prototype._update_element=e(j.prototype._updateElement,"_update_element","_updateElement"),j.prototype.cell_height=e(j.prototype.cellHeight,"cell_height","cellHeight"),j.prototype.cell_width=e(j.prototype.cellWidth,"cell_width","cellWidth"),j.prototype.get_cell_from_pixel=e(j.prototype.getCellFromPixel,"get_cell_from_pixel","getCellFromPixel"),j.prototype.batch_update=e(j.prototype.batchUpdate,"batch_update","batchUpdate"),j.prototype.is_area_empty=e(j.prototype.isAreaEmpty,"is_area_empty","isAreaEmpty"),j.prototype.set_static=e(j.prototype.setStatic,"set_static","setStatic"),j.prototype._set_static_class=e(j.prototype._setStaticClass,"_set_static_class","_setStaticClass"),d.GridStackUI=j,d.GridStackUI.Utils=g,a.fn.gridstack=function(b){return this.each(function(){var c=a(this);c.data("gridstack")||c.data("gridstack",new j(this,b))})},d.GridStackUI}); //# sourceMappingURL=gridstack.min.map \ No newline at end of file diff --git a/dist/gridstack.min.map b/dist/gridstack.min.map index 807e8b1..f2b6988 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"version":3,"file":"dist/gridstack.min.js","sources":["src/gridstack.js"],"names":["factory","define","amd","jQuery","_","$","scope","window","Utils","is_intercepted","a","b","x","width","y","height","sort","nodes","dir","chain","map","node","max","value","sortBy","n","create_stylesheet","id","style","document","createElement","setAttribute","styleSheet","cssText","appendChild","createTextNode","getElementsByTagName","sheet","remove_stylesheet","remove","insert_css_rule","selector","rules","index","insertRule","addRule","toBool","v","toLowerCase","Boolean","id_seq","GridStackEngine","onchange","float_mode","items","this","_update_counter","_float","prototype","batch_update","commit","_pack_nodes","_notify","_fix_collisions","_sort_nodes","nn","has_locked","find","locked","collision_node","move_node","is_area_empty","each","i","_updating","_orig_y","new_y","bn","_dirty","can_be_moved","take","_prepare_node","resizing","defaults","parseInt","auto_position","no_resize","no_move","deleted_nodes","Array","slice","call","arguments","concat","get_dirty_nodes","clean_nodes","filter","add_node","max_width","Math","min","max_height","min_width","min_height","_id","floor","push","remove_node","without","can_move_node","cloned_node","clone","extend","res","get_grid_height","can_be_placed_with_respect_to_height","no_pack","reduce","memo","begin_update","end_update","GridStack","el","opts","one_column_mode","self","container","item_class","is_nested","closest","size","attr","placeholder_class","handle","handle_class","cell_height","vertical_margin","auto","float","static_grid","_class","random","toFixed","animate","always_show_resize_handle","resizable","autoHide","handles","draggable","scroll","appendTo","addClass","_set_static_class","_init_styles","grid","_update_styles","elements","_this","children","_prepare_element","set_animation","placeholder","hide","on_resize_handler","_is_one_column_mode","append","resize","_trigger_change_event","forceTrigger","hasChanges","eventParams","length","trigger","_styles_id","_styles","_max","prefix","_update_container_height","innerWidth","documentElement","clientWidth","body","data","cell_width","on_start_moving","event","ui","o","ceil","outerWidth","show","on_end_moving","detach","removeAttr","start","stop","drag","round","position","left","top","containment","parent","enable","removeClass","add_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","val","movable","isNaN","_update_element","callback","first","move","update","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACgB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,GAG5BA,EAAQG,OAAQC,IAErB,SAASC,EAAGD,GAEX,GAAIE,GAAQC,OAERC,GACAC,eAAgB,SAASC,EAAGC,GACxB,QAASD,EAAEE,EAAIF,EAAEG,OAASF,EAAEC,GAAKD,EAAEC,EAAID,EAAEE,OAASH,EAAEE,GAAKF,EAAEI,EAAIJ,EAAEK,QAAUJ,EAAEG,GAAKH,EAAEG,EAAIH,EAAEI,QAAUL,EAAEI,IAG1GE,KAAM,SAASC,EAAOC,EAAKL,GAGvB,MAFAA,GAAQA,GAAST,EAAEe,MAAMF,GAAOG,IAAI,SAASC,GAAQ,MAAOA,GAAKT,EAAIS,EAAKR,QAAUS,MAAMC,QAC1FL,EAAa,IAAPA,EAAY,EAAI,GACfd,EAAEoB,OAAOP,EAAO,SAASQ,GAAK,MAAOP,IAAOO,EAAEb,EAAIa,EAAEX,EAAID,MAGnEa,kBAAmB,SAASC,GACxB,GAAIC,GAAQC,SAASC,cAAc,QAUnC,OATAF,GAAMG,aAAa,OAAQ,YAC3BH,EAAMG,aAAa,aAAcJ,GAC7BC,EAAMI,WACNJ,EAAMI,WAAWC,QAAU,GAG3BL,EAAMM,YAAYL,SAASM,eAAe,KAE9CN,SAASO,qBAAqB,QAAQ,GAAGF,YAAYN,GAC9CA,EAAMS,OAEjBC,kBAAmB,SAASX,GACxBtB,EAAE,oBAAsBsB,EAAI,KAAKY,UAErCC,gBAAiB,SAASH,EAAOI,EAAUC,EAAOC,GACd,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D,UAAU8F,kBAAoB,WACpC,GAAI8E,GAAoB,mBAEpB/K,MAAKoE,KAAKgB,eAAgB,EAC1BpF,KAAKuE,UAAUyB,SAAS+E,GAExB/K,KAAKuE,UAAU8E,YAAY0B,IAInChO,EAAMiO,YAAc9G,EAEpBnH,EAAMiO,YAAY/N,MAAQA,EAE1BH,EAAEmO,GAAGC,UAAY,SAAS9G,GACtB,MAAOpE,MAAKiB,KAAK,WACRnE,EAAEkD,MAAM+H,KAAK,cACdjL,EAAEkD,MAAM+H,KAAK,YAAa,GAAI7D,GAAUlE,KAAMoE,OAKnDrH,EAAMiO"} \ No newline at end of file +{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","parseHeight","val","height","heightUnit","isString","match","Error","parseInt","unit","scope","window","obsolete","f","oldName","newName","wrapper","console","warn","apply","this","arguments","prototype","obsoleteOpts","Utils","isIntercepted","a","b","x","width","y","sort","nodes","dir","chain","map","node","max","value","sortBy","n","createStylesheet","id","style","document","createElement","setAttribute","styleSheet","cssText","appendChild","createTextNode","getElementsByTagName","sheet","removeStylesheet","remove","insertCSSRule","selector","rules","index","insertRule","addRule","toBool","v","toLowerCase","Boolean","_collisionNodeCheck","nn","_didCollideFloat","bn","newY","_didCollide","_isAddNodeIntercepted","is_intercepted","create_stylesheet","remove_stylesheet","insert_css_rule","idSeq","GridStackEngine","onchange","floatMode","items","_updateCounter","_float","batchUpdate","commit","_packNodes","_notify","_fixCollisions","_sortNodes","hasLocked","find","locked","collisionNode","bind","moveNode","isAreaEmpty","each","i","_updating","_origY","_dirty","canBeMoved","take","_prepareNode","resizing","defaults","autoPosition","noResize","noMove","deletedNodes","Array","slice","call","concat","getDirtyNodes","cleanNodes","filter","addNode","maxWidth","Math","min","maxHeight","minWidth","minHeight","_id","floor","push","removeNode","without","canMoveNode","clonedNode","clone","extend","res","getGridHeight","canBePlacedWithRespectToHeight","noPack","reduce","memo","beginUpdate","endUpdate","GridStack","el","opts","oneColumnMode","self","container","handle_class","handleClass","item_class","itemClass","placeholder_class","placeholderClass","placeholder_text","placeholderText","cell_height","cellHeight","vertical_margin","verticalMargin","min_width","static_grid","staticGrid","is_nested","isNested","always_show_resize_handle","alwaysShowResizeHandle","closest","size","attr","handle","auto","float","_class","random","toFixed","animate","resizable","autoHide","handles","draggable","scroll","appendTo","addClass","_setStaticClass","_initStyles","grid","_updateStyles","elements","_this","children","_prepareElement","setAnimation","placeholder","hide","_updateContainerHeight","onResizeHandler","_isOneColumnMode","append","resize","_triggerChangeEvent","forceTrigger","hasChanges","eventParams","length","trigger","_stylesId","_styles","_max","getHeight","prefix","cellHeightUnit","verticalMarginUnit","nbRows","nbMargins","css","innerWidth","documentElement","clientWidth","body","data","cellWidth","dragOrResize","event","ui","round","position","left","top","type","onStartMoving","o","ceil","outerWidth","strictCellHeight","outerHeight","show","onEndMoving","detach","removeAttr","nestedGrids","containment","parent","start","stop","drag","enable","removeClass","addWidget","makeWidget","willItFit","removeWidget","detachNode","removeData","removeAll","destroy","off","disable","movable","isNaN","_updateElement","callback","first","move","update","noUpdate","heightData","getCellFromPixel","containerPos","relativeLeft","relativeTop","columnWidth","rowHeight","setStatic","staticValue","staticClassName","batch_update","_fix_collisions","is_area_empty","_sort_nodes","_pack_nodes","_prepare_node","clean_nodes","get_dirty_nodes","add_node","remove_node","can_move_node","move_node","get_grid_height","begin_update","end_update","can_be_placed_with_respect_to_height","_trigger_change_event","_init_styles","_update_styles","_update_container_height","_is_one_column_mode","_prepare_element","set_animation","add_widget","make_widget","will_it_fit","remove_widget","remove_all","min_height","_update_element","cell_width","get_cell_from_pixel","set_static","_set_static_class","GridStackUI","fn","gridstack"],"mappings":";;;;;;;CAOA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OACzB,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAA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,gBAAiB,eACrB8C,EAAUvH,UAAU6R,WAAavS,EAASiI,EAAUvH,UAAU0P,UAC1D,aAAc,aAClBnI,EAAUvH,UAAU8R,kBAAoBxS,EAASiI,EAAUvH,UAAUiK,gBACjE,oBAAqB,mBAGzB7K,EAAM2S,YAAcxK,EAEpBnI,EAAM2S,YAAY7R,MAAQA,EAE1BxB,EAAEsT,GAAGC,UAAY,SAASxK,GACtB,MAAO3H,MAAK4E,KAAK,WACb,GAAIsI,GAAItO,EAAEoB,KACLkN,GAAEX,KAAK,cACRW,EACKX,KAAK,YAAa,GAAI9E,GAAUzH,KAAM2H,OAKhDrI,EAAM2S","file":"gridstack.min.js"} \ No newline at end of file diff --git a/package.json b/package.json index af01be7..c2f81de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "0.2.3", + "version": "0.2.5-dev", "description": "gridstack.js is a jQuery plugin for widget layout", "main": "dist/gridstack.js", "repository": { @@ -19,5 +19,13 @@ "bugs": { "url": "https://github.com/troolee/gridstack.js/issues" }, - "homepage": "http://troolee.github.io/gridstack.js/" + "homepage": "http://troolee.github.io/gridstack.js/", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-copy": "^0.8.2", + "grunt-contrib-cssmin": "^0.14.0", + "grunt-contrib-uglify": "^0.10.1", + "grunt-sass": "^1.1.0", + "grunt-doctoc": "^0.1.1" + } } diff --git a/src/gridstack-extra.css b/src/gridstack-extra.css deleted file mode 100644 index 2ea5adb..0000000 --- a/src/gridstack-extra.css +++ /dev/null @@ -1,983 +0,0 @@ -.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%; -} diff --git a/src/gridstack-extra.scss b/src/gridstack-extra.scss index fbf6cc1..66df7d5 100644 --- a/src/gridstack-extra.scss +++ b/src/gridstack-extra.scss @@ -1,4 +1,4 @@ -$gridstack-columns: 12; +$gridstack-columns: 12 !default; @mixin grid-stack-items($gridstack-columns) { .grid-stack.grid-stack-#{$gridstack-columns} { diff --git a/src/gridstack.css b/src/gridstack.css deleted file mode 100644 index 50d468e..0000000 --- a/src/gridstack.css +++ /dev/null @@ -1,318 +0,0 @@ -: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; - } -} diff --git a/src/gridstack.js b/src/gridstack.js index afd7843..73bdd28 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1,27 +1,43 @@ -// 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. - +/** + * gridstack.js 0.2.5-dev + * http://troolee.github.io/gridstack.js/ + * (c) 2014-2016 Pavel Reznikov + * gridstack.js may be freely distributed under the MIT license. + * @preserve +*/ (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); - } - else if (typeof exports !== 'undefined') { - try { jQuery = require('jquery'); } catch(e) {} - try { _ = require('lodash'); } catch(e) {} - factory(jQuery, _); - } - else { + } else if (typeof exports !== 'undefined') { + try { jQuery = require('jquery'); } catch (e) {} + try { _ = require('lodash'); } catch (e) {} + factory(jQuery, _); + } else { factory(jQuery, _); } })(function($, _) { var scope = window; + var obsolete = function(f, oldName, newName) { + var wrapper = function() { + console.warn('gridstack.js: Function `' + oldName + '` is deprecated as of v0.2.5 and has been replaced with `' + + newName + '`. It will be **completely** removed in v1.0.'); + return f.apply(this, arguments); + }; + wrapper.prototype = f.prototype; + + return wrapper; + }; + + var obsoleteOpts = function(oldName, newName) { + console.warn('gridstack.js: Option `' + oldName + '` is deprecated as of v0.2.5 and has been replaced with `' + + newName + '`. It will be **completely** removed in v1.0.'); + }; + var Utils = { - is_intercepted: function(a, b) { + isIntercepted: 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); }, @@ -31,170 +47,192 @@ return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); }); }, - create_stylesheet: function(id) { + createStylesheet: function(id) { var style = document.createElement('style'); style.setAttribute('type', 'text/css'); style.setAttribute('data-gs-id', id); if (style.styleSheet) { style.styleSheet.cssText = ''; - } - else { + } else { style.appendChild(document.createTextNode('')); } document.getElementsByTagName('head')[0].appendChild(style); return style.sheet; }, - remove_stylesheet: function(id) { - $("STYLE[data-gs-id=" + id +"]").remove(); + + removeStylesheet: function(id) { + $('STYLE[data-gs-id=' + id + ']').remove(); }, - insert_css_rule: function(sheet, selector, rules, index) { + + insertCSSRule: 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) { - if (typeof v == 'boolean') + if (typeof v == 'boolean') { return v; + } if (typeof v == 'string') { v = v.toLowerCase(); - return !(v == '' || v == 'no' || v == 'false' || v == '0'); + return !(v === '' || v == 'no' || v == 'false' || v == '0'); } return Boolean(v); + }, + + _collisionNodeCheck: function(n) { + return n != this.node && Utils.isIntercepted(n, this.nn); + }, + + _didCollideFloat: function(bn) { + return this.n != bn && + Utils.isIntercepted({x: this.n.x, y: this.newY, width: this.n.width, height: this.n.height}, bn); + }, + + _didCollide: function(bn) { + return Utils.isIntercepted({x: this.n.x, y: this.newY, width: this.n.width, height: this.n.height}, bn); + }, + + _isAddNodeIntercepted: function(n) { + return Utils.isIntercepted({x: this.x, y: this.y, width: this.node.width, height: this.node.height}, n); } }; - var id_seq = 0; + // jscs:disable requireCamelCaseOrUpperCaseIdentifiers + Utils.is_intercepted = obsolete(Utils.isIntercepted, 'is_intercepted', 'isIntercepted'); - var GridStackEngine = function(width, onchange, float_mode, height, items) { + Utils.create_stylesheet = obsolete(Utils.createStylesheet, 'create_stylesheet', 'createStylesheet'); + + Utils.remove_stylesheet = obsolete(Utils.removeStylesheet, 'remove_stylesheet', 'removeStylesheet'); + + Utils.insert_css_rule = obsolete(Utils.insertCSSRule, 'insert_css_rule', 'insertCSSRule'); + // jscs:enable requireCamelCaseOrUpperCaseIdentifiers + + var idSeq = 0; + + var GridStackEngine = function(width, onchange, floatMode, height, items) { this.width = width; - this['float'] = float_mode || false; + this.float = floatMode || false; this.height = height || 0; this.nodes = items || []; this.onchange = onchange || function() {}; - this._update_counter = 0; - this._float = this['float']; + this._updateCounter = 0; + this._float = this.float; }; - GridStackEngine.prototype.batch_update = function() { - this._update_counter = 1; + GridStackEngine.prototype.batchUpdate = function() { + this._updateCounter = 1; this.float = true; }; GridStackEngine.prototype.commit = function() { - this._update_counter = 0; - if (this._update_counter == 0) { + this._updateCounter = 0; + if (this._updateCounter === 0) { this.float = this._float; - this._pack_nodes(); + this._packNodes(); this._notify(); } }; - GridStackEngine.prototype._fix_collisions = function(node) { - this._sort_nodes(-1); + GridStackEngine.prototype._fixCollisions = function(node) { + var self = this; + this._sortNodes(-1); - var nn = node, has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked })); - if (!this.float && !has_locked) { + var nn = node; + var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; })); + if (!this.float && !hasLocked) { nn = {x: 0, y: node.y, width: this.width, height: node.height}; } - while (true) { - var collision_node = _.find(this.nodes, function(n) { - return n != node && Utils.is_intercepted(n, nn); - }, this); - if (typeof collision_node == 'undefined') { + var collisionNode = _.find(this.nodes, _.bind(Utils._collisionNodeCheck, {node: node, nn: nn})); + if (typeof collisionNode == 'undefined') { return; } - this.move_node(collision_node, collision_node.x, node.y + node.height, - collision_node.width, collision_node.height, true); + this.moveNode(collisionNode, collisionNode.x, node.y + node.height, + collisionNode.width, collisionNode.height, true); } }; - GridStackEngine.prototype.is_area_empty = function(x, y, width, height) { + GridStackEngine.prototype.isAreaEmpty = 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) { - return Utils.is_intercepted(n, nn); - }, this); - return collision_node == null; + var collisionNode = _.find(this.nodes, _.bind(function(n) { + return Utils.isIntercepted(n, nn); + }, this)); + return collisionNode === null; }; - GridStackEngine.prototype._sort_nodes = function(dir) { + GridStackEngine.prototype._sortNodes = function(dir) { this.nodes = Utils.sort(this.nodes, dir, this.width); }; - GridStackEngine.prototype._pack_nodes = function() { - this._sort_nodes(); + GridStackEngine.prototype._packNodes = function() { + this._sortNodes(); if (this.float) { - _.each(this.nodes, function(n, i) { - if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y) + _.each(this.nodes, _.bind(function(n, i) { + if (n._updating || typeof n._origY == 'undefined' || n.y == n._origY) { 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); - }) + var newY = n.y; + while (newY >= n._origY) { + var collisionNode = _.chain(this.nodes) + .find(_.bind(Utils._didCollide, {n: n, newY: newY})) .value(); - if (!collision_node) { + if (!collisionNode) { n._dirty = true; - n.y = new_y; + n.y = newY; } - --new_y; + --newY; } - }, this); - } - else { - _.each(this.nodes, function(n, i) { - if (n.locked) + }, this)); + } else { + _.each(this.nodes, _.bind(function(n, i) { + if (n.locked) { return; + } while (n.y > 0) { - var new_y = n.y - 1; - var can_be_moved = i == 0; + var newY = n.y - 1; + var canBeMoved = i === 0; if (i > 0) { - var collision_node = _.chain(this.nodes) + var collisionNode = _.chain(this.nodes) .take(i) - .find(function(bn) { - return Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn); - }) + .find(_.bind(Utils._didCollide, {n: n, newY: newY})) .value(); - can_be_moved = typeof collision_node == 'undefined'; + canBeMoved = typeof collisionNode == 'undefined'; } - if (!can_be_moved) { + if (!canBeMoved) { break; } - n._dirty = n.y != new_y; - n.y = new_y; + n._dirty = n.y != newY; + n.y = newY; } - }, this); + }, this)); } }; - GridStackEngine.prototype._prepare_node = function(node, resizing) { - node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0 }); + GridStackEngine.prototype._prepareNode = function(node, resizing) { + node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0}); node.x = parseInt('' + node.x); node.y = parseInt('' + node.y); node.width = parseInt('' + node.width); node.height = parseInt('' + node.height); - node.auto_position = node.auto_position || false; - node.no_resize = node.no_resize || false; - node.no_move = node.no_move || false; + node.autoPosition = node.autoPosition || false; + node.noResize = node.noResize || false; + node.noMove = node.noMove || false; if (node.width > this.width) { node.width = this.width; - } - else if (node.width < 1) { + } else if (node.width < 1) { node.width = 1; } @@ -209,8 +247,7 @@ if (node.x + node.width > this.width) { if (resizing) { node.width = this.width - node.x; - } - else { + } else { node.x = this.width - node.width; } } @@ -223,44 +260,43 @@ }; GridStackEngine.prototype._notify = function() { - if (this._update_counter) { + if (this._updateCounter) { return; } - var deleted_nodes = Array.prototype.slice.call(arguments, 1).concat(this.get_dirty_nodes()); - deleted_nodes = deleted_nodes.concat(this.get_dirty_nodes()); - this.onchange(deleted_nodes); + var deletedNodes = Array.prototype.slice.call(arguments, 1).concat(this.getDirtyNodes()); + deletedNodes = deletedNodes.concat(this.getDirtyNodes()); + this.onchange(deletedNodes); }; - GridStackEngine.prototype.clean_nodes = function() { - _.each(this.nodes, function(n) {n._dirty = false }); + GridStackEngine.prototype.cleanNodes = function() { + _.each(this.nodes, function(n) {n._dirty = false; }); }; - GridStackEngine.prototype.get_dirty_nodes = function() { + GridStackEngine.prototype.getDirtyNodes = function() { return _.filter(this.nodes, function(n) { return n._dirty; }); }; - GridStackEngine.prototype.add_node = function(node) { - node = this._prepare_node(node); + GridStackEngine.prototype.addNode = function(node) { + node = this._prepareNode(node); - if (typeof node.max_width != 'undefined') node.width = Math.min(node.width, node.max_width); - if (typeof node.max_height != 'undefined') node.height = Math.min(node.height, node.max_height); - if (typeof node.min_width != 'undefined') node.width = Math.max(node.width, node.min_width); - if (typeof node.min_height != 'undefined') node.height = Math.max(node.height, node.min_height); + if (typeof node.maxWidth != 'undefined') { node.width = Math.min(node.width, node.maxWidth); } + if (typeof node.maxHeight != 'undefined') { node.height = Math.min(node.height, node.maxHeight); } + if (typeof node.minWidth != 'undefined') { node.width = Math.max(node.width, node.minWidth); } + if (typeof node.minHeight != 'undefined') { node.height = Math.max(node.height, node.minHeight); } - node._id = ++id_seq; + node._id = ++idSeq; node._dirty = true; - if (node.auto_position) { - this._sort_nodes(); + if (node.autoPosition) { + this._sortNodes(); for (var i = 0;; ++i) { - var x = i % this.width, y = Math.floor(i / this.width); + var x = i % this.width; + var y = Math.floor(i / this.width); if (x + node.width > this.width) { continue; } - if (!_.find(this.nodes, function(n) { - return Utils.is_intercepted({x: x, y: y, width: node.width, height: node.height}, n); - })) { + if (!_.find(this.nodes, _.bind(Utils._isAddNodeIntercepted, {x: x, y: y, node: node}))) { node.x = x; node.y = y; break; @@ -270,26 +306,27 @@ this.nodes.push(node); - this._fix_collisions(node); - this._pack_nodes(); + this._fixCollisions(node); + this._packNodes(); this._notify(); return node; }; - GridStackEngine.prototype.remove_node = function(node) { + GridStackEngine.prototype.removeNode = function(node) { node._id = null; this.nodes = _.without(this.nodes, node); - this._pack_nodes(); + this._packNodes(); 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.canMoveNode = function(node, x, y, width, height) { + var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; })); - if (!this.height && !has_locked) + if (!this.height && !hasLocked) { return true; + } - var cloned_node; + var clonedNode; var clone = new GridStackEngine( this.width, null, @@ -297,50 +334,53 @@ 0, _.map(this.nodes, function(n) { if (n == node) { - cloned_node = $.extend({}, n); - return cloned_node; + clonedNode = $.extend({}, n); + return clonedNode; } return $.extend({}, n); })); - clone.move_node(cloned_node, x, y, width, height); + clone.moveNode(clonedNode, x, y, width, height); var res = true; - if (has_locked) + if (hasLocked) { res &= !Boolean(_.find(clone.nodes, function(n) { - return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty); + return n != clonedNode && Boolean(n.locked) && Boolean(n._dirty); })); - if (this.height) - res &= clone.get_grid_height() <= this.height; + } + if (this.height) { + res &= clone.getGridHeight() <= this.height; + } return res; }; - GridStackEngine.prototype.can_be_placed_with_respect_to_height = function(node) { - if (!this.height) + GridStackEngine.prototype.canBePlacedWithRespectToHeight = function(node) { + if (!this.height) { return true; + } var clone = new GridStackEngine( this.width, null, this.float, 0, - _.map(this.nodes, function(n) { return $.extend({}, n) })); - clone.add_node(node); - return clone.get_grid_height() <= this.height; + _.map(this.nodes, function(n) { return $.extend({}, n); })); + clone.addNode(node); + return clone.getGridHeight() <= this.height; }; - 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; - if (typeof height != 'number') height = node.height; + GridStackEngine.prototype.moveNode = function(node, x, y, width, height, noPack) { + if (typeof x != 'number') { x = node.x; } + if (typeof y != 'number') { y = node.y; } + if (typeof width != 'number') { width = node.width; } + if (typeof height != 'number') { height = node.height; } - if (typeof node.max_width != 'undefined') width = Math.min(width, node.max_width); - if (typeof node.max_height != 'undefined') height = Math.min(height, node.max_height); - if (typeof node.min_width != 'undefined') width = Math.max(width, node.min_width); - if (typeof node.min_height != 'undefined') height = Math.max(height, node.min_height); + if (typeof node.maxWidth != 'undefined') { width = Math.min(width, node.maxWidth); } + if (typeof node.maxHeight != 'undefined') { height = Math.min(height, node.maxHeight); } + if (typeof node.minWidth != 'undefined') { width = Math.max(width, node.minWidth); } + if (typeof node.minHeight != 'undefined') { height = Math.max(height, node.minHeight); } if (node.x == x && node.y == y && node.width == width && node.height == height) { return node; @@ -354,30 +394,30 @@ node.width = width; node.height = height; - node = this._prepare_node(node, resizing); + node = this._prepareNode(node, resizing); - this._fix_collisions(node); - if (!no_pack) { - this._pack_nodes(); + this._fixCollisions(node); + if (!noPack) { + this._packNodes(); this._notify(); } return node; }; - GridStackEngine.prototype.get_grid_height = function() { + GridStackEngine.prototype.getGridHeight = function() { return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0); }; - GridStackEngine.prototype.begin_update = function(node) { + GridStackEngine.prototype.beginUpdate = function(node) { _.each(this.nodes, function(n) { - n._orig_y = n.y; + n._origY = n.y; }); node._updating = true; }; - GridStackEngine.prototype.end_update = function() { + GridStackEngine.prototype.endUpdate = function() { _.each(this.nodes, function(n) { - n._orig_y = n.y; + n._origY = n.y; }); var n = _.find(this.nodes, function(n) { return n._updating; }); if (n) { @@ -386,75 +426,128 @@ }; var GridStack = function(el, opts) { - var self = this, one_column_mode; + var self = this; + var oneColumnMode; opts = opts || {}; this.container = $(el); - opts.item_class = opts.item_class || 'grid-stack-item'; - var is_nested = this.container.closest('.' + opts.item_class).size() > 0; + // jscs:disable requireCamelCaseOrUpperCaseIdentifiers + if (typeof opts.handle_class !== 'undefined') { + opts.handleClass = opts.handle_class; + obsoleteOpts('handle_class', 'handleClass'); + } + if (typeof opts.item_class !== 'undefined') { + opts.itemClass = opts.item_class; + obsoleteOpts('item_class', 'itemClass'); + } + if (typeof opts.placeholder_class !== 'undefined') { + opts.placeholderClass = opts.placeholder_class; + obsoleteOpts('placeholder_class', 'placeholderClass'); + } + if (typeof opts.placeholder_text !== 'undefined') { + opts.placeholderText = opts.placeholder_text; + obsoleteOpts('placeholder_text', 'placeholderText'); + } + if (typeof opts.item_class !== 'undefined') { + opts.itemClass = opts.item_class; + obsoleteOpts('item_class', 'itemClass'); + } + if (typeof opts.cell_height !== 'undefined') { + opts.cellHeight = opts.cell_height; + obsoleteOpts('cell_height', 'cellHeight'); + } + if (typeof opts.vertical_margin !== 'undefined') { + opts.verticalMargin = opts.vertical_margin; + obsoleteOpts('vertical_margin', 'verticalMargin'); + } + if (typeof opts.min_width !== 'undefined') { + opts.minWidth = opts.min_width; + obsoleteOpts('min_width', 'minWidth'); + } + if (typeof opts.static_grid !== 'undefined') { + opts.staticGrid = opts.static_grid; + obsoleteOpts('static_grid', 'staticGrid'); + } + if (typeof opts.is_nested !== 'undefined') { + opts.isNested = opts.is_nested; + obsoleteOpts('is_nested', 'isNested'); + } + if (typeof opts.always_show_resize_handle !== 'undefined') { + opts.alwaysShowResizeHandle = opts.always_show_resize_handle; + obsoleteOpts('always_show_resize_handle', 'alwaysShowResizeHandle'); + } + // jscs:enable requireCamelCaseOrUpperCaseIdentifiers + + opts.itemClass = opts.itemClass || 'grid-stack-item'; + var isNested = this.container.closest('.' + opts.itemClass).size() > 0; this.opts = _.defaults(opts || {}, { width: parseInt(this.container.attr('data-gs-width')) || 12, height: parseInt(this.container.attr('data-gs-height')) || 0, - item_class: 'grid-stack-item', - placeholder_class: 'grid-stack-placeholder', + itemClass: 'grid-stack-item', + placeholderClass: 'grid-stack-placeholder', + placeholderText: '', handle: '.grid-stack-item-content', - handle_class: null, - cell_height: 60, - vertical_margin: 20, + handleClass: null, + cellHeight: 60, + verticalMargin: 20, auto: true, - min_width: 768, + minWidth: 768, float: false, - static_grid: false, - _class: 'grid-stack-' + (Math.random() * 10000).toFixed(0), + staticGrid: false, + _class: 'grid-stack-instance-' + (Math.random() * 10000).toFixed(0), animate: Boolean(this.container.attr('data-gs-animate')) || false, - always_show_resize_handle: opts.always_show_resize_handle || false, + alwaysShowResizeHandle: opts.alwaysShowResizeHandle || false, resizable: _.defaults(opts.resizable || {}, { - autoHide: !(opts.always_show_resize_handle || false), + autoHide: !(opts.alwaysShowResizeHandle || false), handles: 'se' }), draggable: _.defaults(opts.draggable || {}, { - handle: (opts.handle_class ? '.' + opts.handle_class : (opts.handle ? opts.handle : '')) || '.grid-stack-item-content', + handle: (opts.handleClass ? '.' + opts.handleClass : (opts.handle ? opts.handle : '')) || + '.grid-stack-item-content', scroll: false, appendTo: 'body' }) }); - this.opts.is_nested = is_nested; + this.opts.isNested = isNested; + + this.cellHeight(this.opts.cellHeight, true); + this.verticalMargin(this.opts.verticalMargin, true); this.container.addClass(this.opts._class); - this._set_static_class(); + this._setStaticClass(); - if (is_nested) { + if (isNested) { this.container.addClass('grid-stack-nested'); } - this._init_styles(); + this._initStyles(); this.grid = new GridStackEngine(this.opts.width, function(nodes) { - var max_height = 0; + var maxHeight = 0; _.each(nodes, function(n) { - if (n._id == null) { + if (n._id === null) { n.el.remove(); - } - else { + } else { n.el .attr('data-gs-x', n.x) .attr('data-gs-y', n.y) .attr('data-gs-width', n.width) .attr('data-gs-height', n.height); - max_height = Math.max(max_height, n.y + n.height); + maxHeight = Math.max(maxHeight, n.y + n.height); } }); - self._update_styles(max_height + 10); + self._updateStyles(maxHeight + 10); }, this.opts.float, this.opts.height); if (this.opts.auto) { var elements = []; var _this = this; - this.container.children('.' + this.opts.item_class + ':not(.' + this.opts.placeholder_class + ')').each(function(index, el) { + this.container.children('.' + this.opts.itemClass + ':not(.' + this.opts.placeholderClass + ')') + .each(function(index, el) { el = $(el); elements.push({ el: el, @@ -462,69 +555,68 @@ }); }); _.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) { - self._prepare_element(i.el); + self._prepareElement(i.el); }).value(); } - this.set_animation(this.opts.animate); + this.setAnimation(this.opts.animate); this.placeholder = $( - '
' + - '
').hide(); + '
' + + '
' + this.opts.placeholderText + '
').hide(); - this.container.height( - this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - - this.opts.vertical_margin); + this._updateContainerHeight(); - this.on_resize_handler = function() { - if (self._is_one_column_mode()) { - if (one_column_mode) + this.onResizeHandler = function() { + if (self._isOneColumnMode()) { + if (oneColumnMode) { return; + } - one_column_mode = true; + oneColumnMode = true; - self.grid._sort_nodes(); + self.grid._sortNodes(); _.each(self.grid.nodes, function(node) { self.container.append(node.el); - if (self.opts.static_grid) { + if (self.opts.staticGrid) { return; } - if (!node.no_move) { + if (!node.noMove) { node.el.draggable('disable'); } - if (!node.no_resize) { + if (!node.noResize) { node.el.resizable('disable'); } }); - } - else { - if (!one_column_mode) + } else { + if (!oneColumnMode) { return; + } - one_column_mode = false; + oneColumnMode = false; - if (self.opts.static_grid) { + if (self.opts.staticGrid) { return; } _.each(self.grid.nodes, function(node) { - if (!node.no_move) { + if (!node.noMove) { node.el.draggable('enable'); } - if (!node.no_resize) { + if (!node.noResize) { node.el.resizable('enable'); } }); } }; - $(window).resize(this.on_resize_handler); - this.on_resize_handler(); + $(window).resize(this.onResizeHandler); + this.onResizeHandler(); }; - GridStack.prototype._trigger_change_event = function(forceTrigger) { - var elements = this.grid.get_dirty_nodes(); + GridStack.prototype._triggerChangeEvent = function(forceTrigger) { + var elements = this.grid.getDirtyNodes(); var hasChanges = false; var eventParams = []; @@ -538,110 +630,165 @@ } }; - GridStack.prototype._init_styles = function() { - if (this._styles_id) { - $('[data-gs-id="' + this._styles_id + '"]').remove(); + GridStack.prototype._initStyles = function() { + if (!this.opts.cellHeight) { //that will be handled by CSS + return ; } - this._styles_id = 'gridstack-style-' + (Math.random() * 100000).toFixed(); - this._styles = Utils.create_stylesheet(this._styles_id); - if (this._styles != null) + if (this._stylesId) { + $('[data-gs-id="' + this._stylesId + '"]').remove(); + } + this._stylesId = 'gridstack-style-' + (Math.random() * 100000).toFixed(); + this._styles = Utils.createStylesheet(this._stylesId); + if (this._styles != null) { this._styles._max = 0; + } }; - GridStack.prototype._update_styles = function(max_height) { - if (this._styles == null) { + GridStack.prototype._updateStyles = function(maxHeight) { + if (this._styles === null) { return; } - var prefix = '.' + this.opts._class + ' .' + this.opts.item_class; + var prefix = '.' + this.opts._class + ' .' + this.opts.itemClass; + var self = this; + var getHeight; - if (typeof max_height == 'undefined') { - max_height = this._styles._max; - this._init_styles(); - this._update_container_height(); + if (typeof maxHeight == 'undefined') { + maxHeight = this._styles._max; + this._initStyles(); + this._updateContainerHeight(); + } + if (!this.opts.cellHeight) { //the rest will be handled by CSS + return ; + } + if (this._styles._max !== 0 && maxHeight <= this._styles._max) { + return ; } - if (this._styles._max == 0) { - Utils.insert_css_rule(this._styles, prefix, 'min-height: ' + (this.opts.cell_height) + 'px;', 0); + if (!this.opts.verticalMargin || this.opts.cellHeightUnit === this.opts.verticalMarginUnit) { + getHeight = function(nbRows, nbMargins) { + return (self.opts.cellHeight * nbRows + self.opts.verticalMargin * nbMargins) + self.opts.cellHeightUnit; + }; + } else { + getHeight = function(nbRows, nbMargins) { + if (!nbRows || !nbMargins) { + return (self.opts.cellHeight * nbRows + self.opts.verticalMargin * nbMargins) + self.opts.cellHeightUnit; + } + return 'calc(' + ((self.opts.cellHeight * nbRows) + self.opts.cellHeightUnit) + ' + ' + + ((self.opts.verticalMargin * nbMargins) + self.opts.verticalMarginUnit) + ')'; + }; } - if (max_height > this._styles._max) { - for (var i = this._styles._max; i < max_height; ++i) { - Utils.insert_css_rule(this._styles, + if (this._styles._max === 0) { + Utils.insertCSSRule(this._styles, prefix, 'min-height: ' + getHeight(1, 0) + ';', 0); + } + + if (maxHeight > this._styles._max) { + for (var i = this._styles._max; i < maxHeight; ++i) { + Utils.insertCSSRule(this._styles, prefix + '[data-gs-height="' + (i + 1) + '"]', - 'height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', + 'height: ' + getHeight(i + 1, i) + ';', i ); - Utils.insert_css_rule(this._styles, + Utils.insertCSSRule(this._styles, prefix + '[data-gs-min-height="' + (i + 1) + '"]', - 'min-height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', + 'min-height: ' + getHeight(i + 1, i) + ';', i ); - Utils.insert_css_rule(this._styles, + Utils.insertCSSRule(this._styles, prefix + '[data-gs-max-height="' + (i + 1) + '"]', - 'max-height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', + 'max-height: ' + getHeight(i + 1, i) + ';', i ); - Utils.insert_css_rule(this._styles, + Utils.insertCSSRule(this._styles, prefix + '[data-gs-y="' + i + '"]', - 'top: ' + (this.opts.cell_height * i + this.opts.vertical_margin * i) + 'px;', + 'top: ' + getHeight(i, i) + ';', i ); } - this._styles._max = max_height; + this._styles._max = maxHeight; } }; - GridStack.prototype._update_container_height = function() { - if (this.grid._update_counter) { + GridStack.prototype._updateContainerHeight = function() { + if (this.grid._updateCounter) { return; } - this.container.height( - this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - - this.opts.vertical_margin); + var height = this.grid.getGridHeight(); + this.container.attr('data-gs-current-height', height); + if (!this.opts.cellHeight) { + return ; + } + if (!this.opts.verticalMargin) { + this.container.css('height', (height * (this.opts.cellHeight)) + this.opts.cellHeightUnit); + } else if (this.opts.cellHeightUnit === this.opts.verticalMarginUnit) { + this.container.css('height', (height * (this.opts.cellHeight + this.opts.verticalMargin) - + this.opts.verticalMargin) + this.opts.cellHeightUnit); + } else { + this.container.css('height', 'calc(' + ((height * (this.opts.cellHeight)) + this.opts.cellHeightUnit) + + ' + ' + ((height * (this.opts.verticalMargin - 1)) + this.opts.verticalMarginUnit) + ')'); + } }; - GridStack.prototype._is_one_column_mode = function() { + GridStack.prototype._isOneColumnMode = function() { return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= - this.opts.min_width; + this.opts.minWidth; }; - GridStack.prototype._prepare_element = function(el) { + GridStack.prototype._prepareElement = function(el) { var self = this; el = $(el); - el.addClass(this.opts.item_class); - - var node = self.grid.add_node({ + el.addClass(this.opts.itemClass); + var node = self.grid.addNode({ x: el.attr('data-gs-x'), y: el.attr('data-gs-y'), width: el.attr('data-gs-width'), height: el.attr('data-gs-height'), - max_width: el.attr('data-gs-max-width'), - min_width: el.attr('data-gs-min-width'), - max_height: el.attr('data-gs-max-height'), - min_height: el.attr('data-gs-min-height'), - auto_position: Utils.toBool(el.attr('data-gs-auto-position')), - no_resize: Utils.toBool(el.attr('data-gs-no-resize')), - no_move: Utils.toBool(el.attr('data-gs-no-move')), + maxWidth: el.attr('data-gs-max-width'), + minWidth: el.attr('data-gs-min-width'), + maxHeight: el.attr('data-gs-max-height'), + minHeight: el.attr('data-gs-min-height'), + autoPosition: Utils.toBool(el.attr('data-gs-auto-position')), + noResize: Utils.toBool(el.attr('data-gs-no-resize')), + noMove: Utils.toBool(el.attr('data-gs-no-move')), locked: Utils.toBool(el.attr('data-gs-locked')), el: el }); el.data('_gridstack_node', node); - if (self.opts.static_grid) { + if (self.opts.staticGrid) { return; } - var cell_width, cell_height; + var cellWidth; + var cellHeight; - var on_start_moving = function(event, ui) { + var dragOrResize = function(event, ui) { + var x = Math.round(ui.position.left / cellWidth); + var y = Math.floor((ui.position.top + cellHeight / 2) / cellHeight); + var width; + var height; + if (event.type != 'drag') { + width = Math.round(ui.size.width / cellWidth); + height = Math.round(ui.size.height / cellHeight); + } + + if (!self.grid.canMoveNode(node, x, y, width, height)) { + return; + } + self.grid.moveNode(node, x, y, width, height); + self._updateContainerHeight(); + }; + + var onStartMoving = function(event, ui) { self.container.append(self.placeholder); var o = $(this); - self.grid.clean_nodes(); - self.grid.begin_update(node); - cell_width = Math.ceil(o.outerWidth() / o.attr('data-gs-width')); - cell_height = self.opts.cell_height + self.opts.vertical_margin; + self.grid.cleanNodes(); + self.grid.beginUpdate(node); + cellWidth = Math.ceil(o.outerWidth() / o.attr('data-gs-width')); + var strictCellHeight = Math.ceil(o.outerHeight() / o.attr('data-gs-height')); + cellHeight = self.container.height() / parseInt(self.container.attr('data-gs-current-height')); self.placeholder .attr('data-gs-x', o.attr('data-gs-x')) .attr('data-gs-y', o.attr('data-gs-y')) @@ -650,11 +797,15 @@ .show(); node.el = self.placeholder; - el.resizable('option', 'minWidth', cell_width * (node.min_width || 1)); - el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); + el.resizable('option', 'minWidth', cellWidth * (node.minWidth || 1)); + el.resizable('option', 'minHeight', strictCellHeight * (node.minHeight || 1)); + + if (event.type == 'resizestart') { + o.find('.grid-stack-item').trigger('resizestart'); + } }; - var on_end_moving = function(event, ui) { + var onEndMoving = function(event, ui) { self.placeholder.detach(); var o = $(this); node.el = o; @@ -665,124 +816,126 @@ .attr('data-gs-width', node.width) .attr('data-gs-height', node.height) .removeAttr('style'); - self._update_container_height(); - self._trigger_change_event(); + self._updateContainerHeight(); + self._triggerChangeEvent(); - self.grid.end_update(); + self.grid.endUpdate(); + + var nestedGrids = o.find('.grid-stack'); + if (nestedGrids.length && event.type == 'resizestop') { + nestedGrids.each(function(index, el) { + $(el).data('gridstack').onResizeHandler(); + }); + o.find('.grid-stack-item').trigger('resizestop'); + } }; - el.draggable(_.extend(this.opts.draggable, { - start: on_start_moving, - stop: on_end_moving, - drag: function(event, ui) { - var x = Math.round(ui.position.left / cell_width), - 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; - } - self.grid.move_node(node, x, y); - self._update_container_height(); - }, - containment: this.opts.is_nested ? this.container.parent() : null - })).resizable(_.extend(this.opts.resizable, { - start: on_start_moving, - stop: on_end_moving, - resize: function(event, ui) { - var x = Math.round(ui.position.left / cell_width), - 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)) { - return; - } - self.grid.move_node(node, x, y, width, height); - self._update_container_height(); - } - })); + el + .draggable(_.extend(this.opts.draggable, { + containment: this.opts.isNested ? this.container.parent() : null, + start: onStartMoving, + stop: onEndMoving, + drag: dragOrResize + })) + .resizable(_.extend(this.opts.resizable, { + start: onStartMoving, + stop: onEndMoving, + resize: dragOrResize + })); - if (node.no_move || this._is_one_column_mode()) { + if (node.noMove || this._isOneColumnMode()) { el.draggable('disable'); } - if (node.no_resize || this._is_one_column_mode()) { + if (node.noResize || this._isOneColumnMode()) { el.resizable('disable'); } el.attr('data-gs-locked', node.locked ? 'yes' : null); }; - GridStack.prototype.set_animation = function(enable) { + GridStack.prototype.setAnimation = function(enable) { if (enable) { this.container.addClass('grid-stack-animate'); - } - else { + } else { this.container.removeClass('grid-stack-animate'); } }; - GridStack.prototype.add_widget = function(el, x, y, width, height, auto_position) { + GridStack.prototype.addWidget = function(el, x, y, width, height, autoPosition) { el = $(el); - if (typeof x != 'undefined') el.attr('data-gs-x', x); - if (typeof y != 'undefined') el.attr('data-gs-y', y); - if (typeof width != 'undefined') el.attr('data-gs-width', width); - if (typeof height != 'undefined') el.attr('data-gs-height', height); - if (typeof auto_position != 'undefined') el.attr('data-gs-auto-position', auto_position ? 'yes' : null); + if (typeof x != 'undefined') { el.attr('data-gs-x', x); } + if (typeof y != 'undefined') { el.attr('data-gs-y', y); } + if (typeof width != 'undefined') { el.attr('data-gs-width', width); } + if (typeof height != 'undefined') { el.attr('data-gs-height', height); } + if (typeof autoPosition != 'undefined') { el.attr('data-gs-auto-position', autoPosition ? 'yes' : null); } this.container.append(el); - this._prepare_element(el); - this._update_container_height(); - this._trigger_change_event(true); + this._prepareElement(el); + this._updateContainerHeight(); + this._triggerChangeEvent(true); return el; }; - 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.makeWidget = function(el) { + el = $(el); + this._prepareElement(el); + this._updateContainerHeight(); + this._triggerChangeEvent(true); + + return el; }; - GridStack.prototype.remove_widget = function(el, detach_node) { - detach_node = typeof detach_node === 'undefined' ? true : detach_node; + GridStack.prototype.willItFit = function(x, y, width, height, autoPosition) { + var node = {x: x, y: y, width: width, height: height, autoPosition: autoPosition}; + return this.grid.canBePlacedWithRespectToHeight(node); + }; + + GridStack.prototype.removeWidget = function(el, detachNode) { + detachNode = typeof detachNode === 'undefined' ? true : detachNode; el = $(el); var node = el.data('_gridstack_node'); - this.grid.remove_node(node); + this.grid.removeNode(node); el.removeData('_gridstack_node'); - this._update_container_height(); - if (detach_node) + this._updateContainerHeight(); + if (detachNode) { el.remove(); - this._trigger_change_event(true); + } + this._triggerChangeEvent(true); }; - GridStack.prototype.remove_all = function(detach_node) { - _.each(this.grid.nodes, function(node) { - this.remove_widget(node.el, detach_node); - }, this); + GridStack.prototype.removeAll = function(detachNode) { + _.each(this.grid.nodes, _.bind(function(node) { + this.removeWidget(node.el, detachNode); + }, this)); this.grid.nodes = []; - this._update_container_height(); + this._updateContainerHeight(); }; GridStack.prototype.destroy = function() { - $(window).off("resize", this.on_resize_handler); + $(window).off('resize', this.onResizeHandler); this.disable(); this.container.remove(); - Utils.remove_stylesheet(this._styles_id); - if (this.grid) + Utils.removeStylesheet(this._stylesId); + if (this.grid) { this.grid = null; + } }; GridStack.prototype.resizable = function(el, val) { + var self = this; el = $(el); el.each(function(index, el) { el = $(el); var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { + if (typeof node == 'undefined' || node === null) { return; } - node.no_resize = !(val || false); - if (node.no_resize) { + node.noResize = !(val || false); + if (node.noResize || self._isOneColumnMode()) { el.resizable('disable'); - } - else { + } else { el.resizable('enable'); } }); @@ -790,33 +943,37 @@ }; GridStack.prototype.movable = function(el, val) { + var self = this; el = $(el); el.each(function(index, el) { el = $(el); var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { + if (typeof node == 'undefined' || node === null) { return; } - node.no_move = !(val || false); - if (node.no_move) { + node.noMove = !(val || false); + if (node.noMove || self._isOneColumnMode()) { el.draggable('disable'); - } - else { + el.removeClass('ui-draggable-handle'); + } else { el.draggable('enable'); + el.addClass('ui-draggable-handle'); } }); return this; }; GridStack.prototype.disable = function() { - this.movable(this.container.children('.' + this.opts.item_class), false); - this.resizable(this.container.children('.' + this.opts.item_class), false); + this.movable(this.container.children('.' + this.opts.itemClass), false); + this.resizable(this.container.children('.' + this.opts.itemClass), false); + this.container.trigger('disable'); }; GridStack.prototype.enable = function() { - this.movable(this.container.children('.' + this.opts.item_class), true); - this.resizable(this.container.children('.' + this.opts.item_class), true); + this.movable(this.container.children('.' + this.opts.itemClass), true); + this.resizable(this.container.children('.' + this.opts.itemClass), true); + this.container.trigger('enable'); }; GridStack.prototype.locked = function(el, val) { @@ -824,7 +981,7 @@ el.each(function(index, el) { el = $(el); var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { + if (typeof node == 'undefined' || node === null) { return; } @@ -834,152 +991,312 @@ return this; }; - 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; - } + GridStack.prototype.maxHeight = 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; - }; + if (!isNaN(val)) { + node.maxHeight = (val || false); + el.attr('data-gs-max-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; - } + GridStack.prototype.minHeight = 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; - }; + if (!isNaN(val)) { + node.minHeight = (val || false); + el.attr('data-gs-min-height', val); + } + }); + return this; + }; - GridStack.prototype._update_element = function(el, callback) { + GridStack.prototype.maxWidth = 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.maxWidth = (val || false); + el.attr('data-gs-max-width', val); + } + }); + return this; + }; + + GridStack.prototype.minWidth = 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.minWidth = (val || false); + el.attr('data-gs-min-width', val); + } + }); + return this; + }; + + GridStack.prototype._updateElement = function(el, callback) { el = $(el).first(); var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { + if (typeof node == 'undefined' || node === null) { return; } var self = this; - self.grid.clean_nodes(); - self.grid.begin_update(node); + self.grid.cleanNodes(); + self.grid.beginUpdate(node); callback.call(this, el, node); - self._update_container_height(); - self._trigger_change_event(); + self._updateContainerHeight(); + self._triggerChangeEvent(); - self.grid.end_update(); + self.grid.endUpdate(); }; 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; + this._updateElement(el, function(el, node) { + width = (width !== null && typeof width != 'undefined') ? width : node.width; + height = (height !== null && typeof height != 'undefined') ? height : node.height; - this.grid.move_node(node, node.x, node.y, width, height); + this.grid.moveNode(node, node.x, node.y, width, height); }); }; 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; + this._updateElement(el, function(el, node) { + x = (x !== null && typeof x != 'undefined') ? x : node.x; + y = (y !== null && typeof y != 'undefined') ? y : node.y; - this.grid.move_node(node, x, y, node.width, node.height); + this.grid.moveNode(node, x, y, node.width, node.height); }); }; 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; - height = (height != null && typeof height != 'undefined') ? height : node.height; + this._updateElement(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; + height = (height !== null && typeof height != 'undefined') ? height : node.height; - this.grid.move_node(node, x, y, width, height); + this.grid.moveNode(node, x, y, width, height); }); }; - GridStack.prototype.cell_height = function(val) { - if (typeof val == 'undefined') { - return this.opts.cell_height; + function parseHeight(val) { + var height = val; + var heightUnit = 'px'; + if (height && _.isString(height)) { + var match = height.match(/^([0-9]+)(px|em|rem)?$/); + if (!match) { + throw new Error('Invalid height'); + } + heightUnit = match[2]; + height = parseInt(match[1]); + } + return {height: height, unit: heightUnit}; + } + + GridStack.prototype.verticalMargin = function(val, noUpdate) { + if (typeof val == 'undefined') { + return this.opts.verticalMargin; + } + + var heightData = parseHeight(val); + + if (this.opts.verticalMarginUnit === heightData.unit && this.opts.height === heightData.height) { + return ; + } + this.opts.verticalMarginUnit = heightData.unit; + this.opts.verticalMargin = heightData.height; + + if (!noUpdate) { + this._updateStyles(); } - val = parseInt(val); - if (val == this.opts.cell_height) - return; - this.opts.cell_height = val || this.opts.cell_height; - this._update_styles(); }; - GridStack.prototype.cell_width = function() { - var o = this.container.children('.' + this.opts.item_class).first(); + GridStack.prototype.cellHeight = function(val, noUpdate) { + if (typeof val == 'undefined') { + if (this.opts.cellHeight) { + return this.opts.cellHeight; + } else { + var o = this.container.children('.' + this.opts.itemClass).first(); + return Math.ceil(o.outerHeight() / o.attr('data-gs-height')); + } + + } + var heightData = parseHeight(val); + + if (this.opts.cellHeightUnit === heightData.heightUnit && this.opts.height === heightData.height) { + return ; + } + this.opts.cellHeightUnit = heightData.unit; + this.opts.cellHeight = heightData.height; + + if (!noUpdate) { + this._updateStyles(); + } + + }; + + GridStack.prototype.cellWidth = function() { + var o = this.container.children('.' + this.opts.itemClass).first(); return Math.ceil(o.outerWidth() / o.attr('data-gs-width')); }; - GridStack.prototype.get_cell_from_pixel = function(position) { + GridStack.prototype.getCellFromPixel = function(position) { var containerPos = this.container.position(); var relativeLeft = position.left - containerPos.left; var relativeTop = position.top - containerPos.top; - var column_width = Math.floor(this.container.width() / this.opts.width); - var row_height = this.opts.cell_height + this.opts.vertical_margin; + var columnWidth = Math.floor(this.container.width() / this.opts.width); + var rowHeight = Math.floor(this.container.height() / parseInt(this.container.attr('data-gs-current-height'))); - return {x: Math.floor(relativeLeft / column_width), y: Math.floor(relativeTop / row_height)}; + return {x: Math.floor(relativeLeft / columnWidth), y: Math.floor(relativeTop / rowHeight)}; }; - GridStack.prototype.batch_update = function() { - this.grid.batch_update(); + GridStack.prototype.batchUpdate = function() { + this.grid.batchUpdate(); }; GridStack.prototype.commit = function() { this.grid.commit(); - this._update_container_height(); + this._updateContainerHeight(); }; - GridStack.prototype.is_area_empty = function(x, y, width, height) { - return this.grid.is_area_empty(x, y, width, height); + GridStack.prototype.isAreaEmpty = function(x, y, width, height) { + return this.grid.isAreaEmpty(x, y, width, height); }; - GridStack.prototype.set_static = function(static_value) { - this.opts.static_grid = (static_value === true); - this._set_static_class(); + GridStack.prototype.setStatic = function(staticValue) { + this.opts.staticGrid = (staticValue === true); + this._setStaticClass(); }; - GridStack.prototype._set_static_class = function() { - var static_class_name = 'grid-stack-static'; + GridStack.prototype._setStaticClass = function() { + var staticClassName = 'grid-stack-static'; - if (this.opts.static_grid === true) { - this.container.addClass(static_class_name); + if (this.opts.staticGrid === true) { + this.container.addClass(staticClassName); } else { - this.container.removeClass(static_class_name); + this.container.removeClass(staticClassName); } }; + // jscs:disable requireCamelCaseOrUpperCaseIdentifiers + GridStackEngine.prototype.batch_update = obsolete(GridStackEngine.prototype.batchUpdate); + GridStackEngine.prototype._fix_collisions = obsolete(GridStackEngine.prototype._fixCollisions, + '_fix_collisions', '_fixCollisions'); + GridStackEngine.prototype.is_area_empty = obsolete(GridStackEngine.prototype.isAreaEmpty, + 'is_area_empty', 'isAreaEmpty'); + GridStackEngine.prototype._sort_nodes = obsolete(GridStackEngine.prototype._sortNodes, + '_sort_nodes', '_sortNodes'); + GridStackEngine.prototype._pack_nodes = obsolete(GridStackEngine.prototype._packNodes, + '_pack_nodes', '_packNodes'); + GridStackEngine.prototype._prepare_node = obsolete(GridStackEngine.prototype._prepareNode, + '_prepare_node', '_prepareNode'); + GridStackEngine.prototype.clean_nodes = obsolete(GridStackEngine.prototype.cleanNodes, + 'clean_nodes', 'cleanNodes'); + GridStackEngine.prototype.get_dirty_nodes = obsolete(GridStackEngine.prototype.getDirtyNodes, + 'get_dirty_nodes', 'getDirtyNodes'); + GridStackEngine.prototype.add_node = obsolete(GridStackEngine.prototype.addNode, + 'add_node', 'addNode, '); + GridStackEngine.prototype.remove_node = obsolete(GridStackEngine.prototype.removeNode, + 'remove_node', 'removeNode'); + GridStackEngine.prototype.can_move_node = obsolete(GridStackEngine.prototype.canMoveNode, + 'can_move_node', 'canMoveNode'); + GridStackEngine.prototype.move_node = obsolete(GridStackEngine.prototype.moveNode, + 'move_node', 'moveNode'); + GridStackEngine.prototype.get_grid_height = obsolete(GridStackEngine.prototype.getGridHeight, + 'get_grid_height', 'getGridHeight'); + GridStackEngine.prototype.begin_update = obsolete(GridStackEngine.prototype.beginUpdate, + 'begin_update', 'beginUpdate'); + GridStackEngine.prototype.end_update = obsolete(GridStackEngine.prototype.endUpdate, + 'end_update', 'endUpdate'); + GridStackEngine.prototype.can_be_placed_with_respect_to_height = + obsolete(GridStackEngine.prototype.canBePlacedWithRespectToHeight, + 'can_be_placed_with_respect_to_height', 'canBePlacedWithRespectToHeight'); + GridStack.prototype._trigger_change_event = obsolete(GridStack.prototype._triggerChangeEvent, + '_trigger_change_event', '_triggerChangeEvent'); + GridStack.prototype._init_styles = obsolete(GridStack.prototype._initStyles, + '_init_styles', '_initStyles'); + GridStack.prototype._update_styles = obsolete(GridStack.prototype._updateStyles, + '_update_styles', '_updateStyles'); + GridStack.prototype._update_container_height = obsolete(GridStack.prototype._updateContainerHeight, + '_update_container_height', '_updateContainerHeight'); + GridStack.prototype._is_one_column_mode = obsolete(GridStack.prototype._isOneColumnMode, + '_is_one_column_mode',' _isOneColumnMode'); + GridStack.prototype._prepare_element = obsolete(GridStack.prototype._prepareElement, + '_prepare_element', '_prepareElement'); + GridStack.prototype.set_animation = obsolete(GridStack.prototype.setAnimation, + 'set_animation', 'setAnimation'); + GridStack.prototype.add_widget = obsolete(GridStack.prototype.addWidget, + 'add_widget', 'addWidget'); + GridStack.prototype.make_widget = obsolete(GridStack.prototype.makeWidget, + 'make_widget', 'makeWidget'); + GridStack.prototype.will_it_fit = obsolete(GridStack.prototype.willItFit, + 'will_it_fit', 'willItFit'); + GridStack.prototype.remove_widget = obsolete(GridStack.prototype.removeWidget, + 'remove_widget', 'removeWidget'); + GridStack.prototype.remove_all = obsolete(GridStack.prototype.removeAll, + 'remove_all', 'removeAll'); + GridStack.prototype.min_height = obsolete(GridStack.prototype.minHeight, + 'min_height', 'minHeight'); + GridStack.prototype.min_width = obsolete(GridStack.prototype.minWidth, + 'min_width', 'minWidth'); + GridStack.prototype._update_element = obsolete(GridStack.prototype._updateElement, + '_update_element', '_updateElement'); + GridStack.prototype.cell_height = obsolete(GridStack.prototype.cellHeight, + 'cell_height', 'cellHeight'); + GridStack.prototype.cell_width = obsolete(GridStack.prototype.cellWidth, + 'cell_width', 'cellWidth'); + GridStack.prototype.get_cell_from_pixel = obsolete(GridStack.prototype.getCellFromPixel, + 'get_cell_from_pixel', 'getCellFromPixel'); + GridStack.prototype.batch_update = obsolete(GridStack.prototype.batchUpdate, + 'batch_update', 'batchUpdate'); + GridStack.prototype.is_area_empty = obsolete(GridStack.prototype.isAreaEmpty, + 'is_area_empty', 'isAreaEmpty'); + GridStack.prototype.set_static = obsolete(GridStack.prototype.setStatic, + 'set_static', 'setStatic'); + GridStack.prototype._set_static_class = obsolete(GridStack.prototype._setStaticClass, + '_set_static_class', '_setStaticClass'); + // jscs:enable requireCamelCaseOrUpperCaseIdentifiers + scope.GridStackUI = GridStack; scope.GridStackUI.Utils = Utils; $.fn.gridstack = function(opts) { return this.each(function() { - if (!$(this).data('gridstack')) { - $(this).data('gridstack', new GridStack(this, opts)); + var o = $(this); + if (!o.data('gridstack')) { + o + .data('gridstack', new GridStack(this, opts)); } }); }; diff --git a/src/gridstack.scss b/src/gridstack.scss index 9c8d94b..46fa37a 100644 --- a/src/gridstack.scss +++ b/src/gridstack.scss @@ -1,7 +1,7 @@ -$gridstack-columns: 12; -$horizontal_padding: 20px; -$vertical_padding: 20px; -$animation_speed: .3s; +$gridstack-columns: 12 !default; +$horizontal_padding: 20px !default; +$vertical_padding: 20px !default; +$animation_speed: .3s !default; @mixin vendor($property, $value...){ -webkit-#{$property}:$value; @@ -26,6 +26,7 @@ $animation_speed: .3s; bottom: 0; width: auto; z-index: 0 !important; + text-align: center; } > .grid-stack-item { @@ -53,21 +54,21 @@ $animation_speed: .3s; -ms-touch-action: none; touch-action: none; } - + &.ui-resizable-disabled > .ui-resizable-handle, &.ui-resizable-autohide > .ui-resizable-handle { display: none; } - + &.ui-draggable-dragging, &.ui-resizable-resizing { z-index: 100; - + > .grid-stack-item-content, > .grid-stack-item-content { box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2); opacity: 0.8; } } - + > .ui-resizable-se, > .ui-resizable-sw { text-align: right; @@ -81,16 +82,15 @@ $animation_speed: .3s; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - + &::before { content: "\f065"; } } - + > .ui-resizable-se { display: inline-block; - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); @include vendor(transform, rotate(90deg)); } - + > .ui-resizable-nw { cursor: nw-resize; width: 20px; height: 20px; left: 10px; top: 0; } > .ui-resizable-n { cursor: n-resize; height: 10px; top: 0; left: 25px; right: 25px; } > .ui-resizable-ne { cursor: ne-resize; width: 20px; height: 20px; right: 10px; top: 0; } @@ -99,7 +99,7 @@ $animation_speed: .3s; > .ui-resizable-s { cursor: s-resize; height: 10px; left: 25px; bottom: 0; right: 25px; } > .ui-resizable-sw { cursor: sw-resize; width: 20px; height: 20px; left: 10px; bottom: 0; } > .ui-resizable-w { cursor: w-resize; width: 10px; left: $horizontal_padding / 2; top: 15px; bottom: 15px; } - + @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; } @@ -107,8 +107,8 @@ $animation_speed: .3s; &[data-gs-max-width='#{$i}'] { max-width: (100% / $gridstack-columns) * $i; } } } - - &.grid-stack-animate, + + &.grid-stack-animate, &.grid-stack-animate .grid-stack-item { @include vendor(transition, left $animation_speed, top $animation_speed, height $animation_speed, width $animation_speed); } @@ -124,7 +124,6 @@ $animation_speed: .3s; /* .grid-stack > .grid-stack-item > .ui-resizable-sw { display: inline-block; - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); @include vendor(transform, rotate(180deg)); } */ @@ -136,7 +135,7 @@ $animation_speed: .3s; left: 0 !important; top: auto !important; margin-bottom: $vertical_padding; - + .ui-resizable-handle { display: none; } }