From 231bc8ce65b66784381f2e735430cec0b9314873 Mon Sep 17 00:00:00 2001 From: martynsmall Date: Tue, 9 Jun 2015 22:30:44 +0100 Subject: [PATCH 01/67] Fix resize/move issue in one column mode Calling resizable() and movable() with 'true' no longer makes nodes resizable/movable in one column mode, fixes 158. --- src/gridstack.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index af58c3e..88b47de 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -700,6 +700,7 @@ }; GridStack.prototype.resizable = function (el, val) { + var self = this; el = $(el); el.each(function (index, el) { el = $(el); @@ -709,7 +710,7 @@ } node.no_resize = !(val || false); - if (node.no_resize) { + if (node.no_resize || self._is_one_column_mode()) { el.resizable('disable'); } else { @@ -720,6 +721,7 @@ }; GridStack.prototype.movable = function (el, val) { + var self = this; el = $(el); el.each(function (index, el) { el = $(el); @@ -729,7 +731,7 @@ } node.no_move = !(val || false); - if (node.no_move) { + if (node.no_move || self._is_one_column_mode()) { el.draggable('disable'); } else { From feab5d8e18fd6bd14fbf9ff4c6574f91f9669e98 Mon Sep 17 00:00:00 2001 From: martynsmall Date: Thu, 6 Aug 2015 15:40:27 +0100 Subject: [PATCH 02/67] Updated dist --- dist/gridstack.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/gridstack.js b/dist/gridstack.js index 9b338a7..181fcd5 100644 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -762,6 +762,7 @@ }; GridStack.prototype.resizable = function(el, val) { + var self = this; el = $(el); el.each(function(index, el) { el = $(el); @@ -771,7 +772,7 @@ } node.no_resize = !(val || false); - if (node.no_resize) { + if (node.no_resize || self._is_one_column_mode()) { el.resizable('disable'); } else { @@ -782,6 +783,7 @@ }; GridStack.prototype.movable = function(el, val) { + var self = this; el = $(el); el.each(function(index, el) { el = $(el); @@ -791,7 +793,7 @@ } node.no_move = !(val || false); - if (node.no_move) { + if (node.no_move || self._is_one_column_mode()) { el.draggable('disable'); } else { From 4a80e418117a2939e6b0d949e4c0554d7fb9ee8e Mon Sep 17 00:00:00 2001 From: Derek Moore Date: Thu, 6 Aug 2015 17:55:28 -0500 Subject: [PATCH 03/67] fix ordering of draggable and resizable event callbacks --- src/gridstack.js | 53 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index 9b338a7..1e18af4 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -627,6 +627,22 @@ var cell_width, cell_height; + var drag_or_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, height; + if (event.type != "drag") { + 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(); + }; + var on_start_moving = function(event, ui) { self.container.append(self.placeholder); var o = $(this); @@ -663,34 +679,17 @@ self.grid.end_update(); }; - 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(); - }, + el + .draggable(_.extend(this.opts.draggable, { 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(); - } - })); + })) + .on("dragstart", on_start_moving) + .on("dragstop", on_end_moving) + .on("drag", drag_or_resize) + .resizable(_.extend(this.opts.resizable, {})) + .on("resizestart", on_start_moving) + .on("resizestop", on_end_moving) + .on("resize", drag_or_resize); if (node.no_move || this._is_one_column_mode()) { el.draggable('disable'); From 69d2df188d6e8c06a883d0f866d4913565a3cecf Mon Sep 17 00:00:00 2001 From: Derek Moore Date: Fri, 7 Aug 2015 16:36:59 -0500 Subject: [PATCH 04/67] stop propagation of events so nested grids don't affect parents --- src/gridstack.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gridstack.js b/src/gridstack.js index 1e18af4..8487c35 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -641,6 +641,7 @@ } self.grid.move_node(node, x, y, width, height); self._update_container_height(); + event.stopPropagation(); }; var on_start_moving = function(event, ui) { @@ -660,6 +661,7 @@ el.resizable('option', 'minWidth', cell_width * (node.min_width || 1)); el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); + event.stopPropagation(); }; var on_end_moving = function(event, ui) { @@ -677,6 +679,7 @@ self._trigger_change_event(); self.grid.end_update(); + event.stopPropagation(); }; el From 9442e3cd7e5ffeccb07e8dc98139cd37a55acbd9 Mon Sep 17 00:00:00 2001 From: Derek Moore Date: Wed, 12 Aug 2015 10:20:39 -0500 Subject: [PATCH 05/67] stop event propagation at the grid instead of at grid items --- src/gridstack.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index 8487c35..3d082d2 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -641,7 +641,6 @@ } self.grid.move_node(node, x, y, width, height); self._update_container_height(); - event.stopPropagation(); }; var on_start_moving = function(event, ui) { @@ -661,7 +660,6 @@ el.resizable('option', 'minWidth', cell_width * (node.min_width || 1)); el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); - event.stopPropagation(); }; var on_end_moving = function(event, ui) { @@ -679,7 +677,6 @@ self._trigger_change_event(); self.grid.end_update(); - event.stopPropagation(); }; el @@ -970,10 +967,21 @@ scope.GridStackUI.Utils = Utils; + function event_stop_propagate(event) { + event.stopPropagation(); + } $.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)) + .on('dragstart', event_stop_propagate) + .on('dragstop', event_stop_propagate) + .on('drag', event_stop_propagate) + .on('resizestart', event_stop_propagate) + .on('resizestop', event_stop_propagate) + .on('resize', event_stop_propagate); } }); }; From 884824903537dbeba842a72544d5000824ddb73b Mon Sep 17 00:00:00 2001 From: Derek Moore Date: Wed, 12 Aug 2015 10:37:00 -0500 Subject: [PATCH 06/67] broadcast resizestop events to nested grids --- src/gridstack.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gridstack.js b/src/gridstack.js index 3d082d2..f32cd79 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -677,6 +677,12 @@ self._trigger_change_event(); self.grid.end_update(); + + var nested_grid = o.find('.grid-stack'); + if (nested_grid.length && event.type == 'resizestop') { + nested_grid.data('gridstack').on_resize_handler(); + nested_grid.find('.grid-stack-item').trigger('resizestop'); + } }; el From 1b3a0cbf894166dc3084b8743b6851aadee73896 Mon Sep 17 00:00:00 2001 From: Derek Moore Date: Wed, 12 Aug 2015 10:37:58 -0500 Subject: [PATCH 07/67] format code to match prevalent coding style --- src/gridstack.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index f32cd79..ee8d82b 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -686,16 +686,16 @@ }; el - .draggable(_.extend(this.opts.draggable, { - containment: this.opts.is_nested ? this.container.parent() : null - })) - .on("dragstart", on_start_moving) - .on("dragstop", on_end_moving) - .on("drag", drag_or_resize) - .resizable(_.extend(this.opts.resizable, {})) - .on("resizestart", on_start_moving) - .on("resizestop", on_end_moving) - .on("resize", drag_or_resize); + .draggable(_.extend(this.opts.draggable, { + containment: this.opts.is_nested ? this.container.parent() : null + })) + .on('dragstart', on_start_moving) + .on('dragstop', on_end_moving) + .on('drag', drag_or_resize) + .resizable(_.extend(this.opts.resizable, {})) + .on('resizestart', on_start_moving) + .on('resizestop', on_end_moving) + .on('resize', drag_or_resize); if (node.no_move || this._is_one_column_mode()) { el.draggable('disable'); From 798c5c429facd8c48ae6105496c4de1f2f7434b8 Mon Sep 17 00:00:00 2001 From: Derek Moore Date: Wed, 12 Aug 2015 13:58:49 -0500 Subject: [PATCH 08/67] broadcast resizestop to nested grids "all the way down" --- src/gridstack.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index ee8d82b..b368f68 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -678,10 +678,12 @@ self.grid.end_update(); - var nested_grid = o.find('.grid-stack'); - if (nested_grid.length && event.type == 'resizestop') { - nested_grid.data('gridstack').on_resize_handler(); - nested_grid.find('.grid-stack-item').trigger('resizestop'); + var nested_grids = o.find('.grid-stack'); + if (nested_grids.length && event.type == 'resizestop') { + nested_grids.each(function(index, el) { + $(el).data('gridstack').on_resize_handler(); + }); + o.find('.grid-stack-item').trigger('resizestop'); } }; From 77159bfbe1b81157702515371ce581000708693e Mon Sep 17 00:00:00 2001 From: cvillemure Date: Thu, 8 Oct 2015 14:55:24 -0400 Subject: [PATCH 09/67] Fix for #63 Fix IE9 SE handle for #63 --- src/gridstack.css | 8 +++++--- src/gridstack.scss | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gridstack.css b/src/gridstack.css index 50d468e..319d58a 100644 --- a/src/gridstack.css +++ b/src/gridstack.css @@ -70,7 +70,6 @@ } .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); @@ -296,8 +295,11 @@ /* .grid-stack > .grid-stack-item > .ui-resizable-sw { display: inline-block; - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); - @include vendor(transform, rotate(180deg)); + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); } */ @media (max-width: 768px) { diff --git a/src/gridstack.scss b/src/gridstack.scss index 9c8d94b..9918e78 100644 --- a/src/gridstack.scss +++ b/src/gridstack.scss @@ -87,7 +87,6 @@ $animation_speed: .3s; > .ui-resizable-se { display: inline-block; - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); @include vendor(transform, rotate(90deg)); } @@ -124,7 +123,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)); } */ From bee6ff6e310a0620aad97f128896d3c351e7c4ec Mon Sep 17 00:00:00 2001 From: Kevin Dietrich Date: Mon, 26 Oct 2015 12:31:06 +0100 Subject: [PATCH 10/67] API make_widget functionality --- README.md | 18 ++++++++++++++++++ src/gridstack.js | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/README.md b/README.md index 675da5e..66ad6a9 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Inspired by [gridster.js](http://gridster.net). Built with love. - [onresizestop(event, ui)](#onresizestopevent-ui) - [API](#api) - [add_widget(el, x, y, width, height, auto_position)](#add_widgetel-x-y-width-height-auto_position) + - [make_widget(el)](#make_widgetel) - [batch_update()](#batch_update) - [cell_height()](#cell_height) - [cell_height(val)](#cell_heightval) @@ -238,6 +239,23 @@ var grid = $('.grid-stack').data('gridstack'); grid.add_widget(el, 0, 0, 3, 2, true); ``` +### make_widget(el) + +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.make_widget('gsi-1'); +``` + ### batch_update() Initailizes batch updates. You will see no changes until `commit` method is called. diff --git a/src/gridstack.js b/src/gridstack.js index afd7843..53b0fcb 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -735,6 +735,15 @@ return el; }; + GridStack.prototype.make_widget = function(el) { + el = $(el); + this._prepare_element(el); + this._update_container_height(); + this._trigger_change_event(true); + + return el; + }; + GridStack.prototype.will_it_fit = function(x, y, width, height, auto_position) { 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); From 816071a0779a28f8322ceaf4a50fde6e6c2e5c44 Mon Sep 17 00:00:00 2001 From: Martin Mrose Date: Tue, 3 Nov 2015 00:14:57 +0100 Subject: [PATCH 11/67] Triggering enable and disable events on gridstack container --- src/gridstack.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gridstack.js b/src/gridstack.js index afd7843..5f2e528 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -812,11 +812,13 @@ 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.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.container.trigger('enable'); }; GridStack.prototype.locked = function(el, val) { From 8c5ab67796b7629afad9e374b75a3ff91381ee97 Mon Sep 17 00:00:00 2001 From: Martin Mrose Date: Tue, 3 Nov 2015 00:20:47 +0100 Subject: [PATCH 12/67] Updated readme --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 675da5e..67e2be6 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,21 @@ $('.grid-stack').on('resizestop', function (event, ui) { }); ``` +### disable(event) + +```javascipt +$('.grid-stack').on('disable', function(event) { + var grid = event.target; +}); +``` + +### enable(event) + +```javascipt +$('.grid-stack').on('enable', function(event) { + var grid = event.target; +}); +``` ## API From 912662bbbb063f6421896217538215f30fcb7df1 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Fri, 6 Nov 2015 13:48:11 +1100 Subject: [PATCH 13/67] toggle ui-draggable-handle class with draggable On touch devices, it's not possible to scroll a page by dragging on an item even when draggable is disabled due to the **ui-draggable-handle** class which is added to the **grid-stack-item-content** JQuery-UI Draggable doesn't remove this class when it's disabled, so it prevents touch scrolling the page on the item ```
.ui-draggable-handle { -ms-touch-action: none; touch-action: none; } ``` --- src/gridstack.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gridstack.js b/src/gridstack.js index afd7843..09cee2b 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -801,9 +801,11 @@ node.no_move = !(val || false); if (node.no_move) { el.draggable('disable'); + el.removeClass('ui-draggable-handle'); } else { el.draggable('enable'); + el.addClass('ui-draggable-handle'); } }); return this; From 71e2f3da863a9eabea71e7db89435b6341fa26f6 Mon Sep 17 00:00:00 2001 From: Jerome Louis Date: Wed, 18 Nov 2015 16:47:37 +0100 Subject: [PATCH 14/67] Add Gruntfile for dist generation --- .gitignore | 1 + Gruntfile.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 9 ++++++++- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100755 Gruntfile.js mode change 100644 => 100755 package.json 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/Gruntfile.js b/Gruntfile.js new file mode 100755 index 0000000..ed2a19c --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,51 @@ +module.exports = function (grunt) { + grunt.loadNpmTasks('grunt-sass'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + + 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' + }, + dist: { + files: { + 'dist/gridstack.min.js': ['src/gridstack.js'] + } + } + } + }); + + grunt.registerTask('default', ['sass', 'cssmin', 'copy', 'uglify']); +}; diff --git a/package.json b/package.json old mode 100644 new mode 100755 index af01be7..62f5d43 --- a/package.json +++ b/package.json @@ -19,5 +19,12 @@ "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" + } } From 9bba3fbb18dfe57a59ce9d2fbe087fe37d0038aa Mon Sep 17 00:00:00 2001 From: Jerome Louis Date: Wed, 18 Nov 2015 16:48:27 +0100 Subject: [PATCH 15/67] generated CSS files should only be in dist folder --- src/gridstack-extra.css | 983 ---------------------------------------- src/gridstack.css | 318 ------------- 2 files changed, 1301 deletions(-) delete mode 100644 src/gridstack-extra.css delete mode 100644 src/gridstack.css 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.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; - } -} From 4471b9e385913cf8be6b20464dc565c7a58b8167 Mon Sep 17 00:00:00 2001 From: Jerome Louis Date: Wed, 18 Nov 2015 16:48:43 +0100 Subject: [PATCH 16/67] New dist files generated using gruntfile --- dist/gridstack-extra.css | 636 ++++++++++++++++++++++++++--------- dist/gridstack-extra.min.css | 2 +- dist/gridstack.css | 145 ++++++-- dist/gridstack.js | 5 + dist/gridstack.min.css | 2 +- dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- 7 files changed, 591 insertions(+), 203 deletions(-) mode change 100644 => 100755 dist/gridstack.js 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..650ee8e 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; @@ -16,11 +17,13 @@ width: auto; z-index: 0 !important; } + .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 +36,7 @@ overflow-x: hidden; overflow-y: auto; } + .grid-stack > .grid-stack-item > .ui-resizable-handle { position: absolute; font-size: 0.1px; @@ -40,18 +44,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,10 +73,12 @@ -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); @@ -77,6 +88,7 @@ -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; @@ -311,7 +383,6 @@ .grid-stack-item .ui-resizable-handle { display: none; } - .grid-stack { height: auto !important; } diff --git a/dist/gridstack.js b/dist/gridstack.js old mode 100644 new mode 100755 index 9b7aaa7..afd7843 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -8,6 +8,11 @@ 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 { factory(jQuery, _); } diff --git a/dist/gridstack.min.css b/dist/gridstack.min.css index a964730..4970b72 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}.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;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);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..fee2b7c 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!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}); +!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){var c=window,d={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},e=0,f=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._update_counter=0,this._float=this["float"]};f.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},f.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},f.prototype._fix_collisions=function(a){this._sort_nodes(-1);var c=a,e=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||e||(c={x:0,y:a.y,width:this.width,height:a.height});;){var f=b.find(this.nodes,function(b){return b!=a&&d.is_intercepted(b,c)},this);if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},f.prototype.is_area_empty=function(a,c,e,f){var g={x:a||0,y:c||0,width:e||1,height:f||1},h=b.find(this.nodes,function(a){return d.is_intercepted(a,g)},this);return null==h},f.prototype._sort_nodes=function(a){this.nodes=d.sort(this.nodes,a,this.width)},f.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var e=a.y;e>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f||(a._dirty=!0,a.y=e),--e}},this):b.each(this.nodes,function(a,c){if(!a.locked)for(;a.y>0;){var e=a.y-1,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=e,a.y=e}},this)},f.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},f.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},f.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},f.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},f.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++e,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var f=c%this.width,g=Math.floor(c/this.width);if(!(f+a.width>this.width||b.find(this.nodes,function(b){return d.is_intercepted({x:f,y:g,width:a.width,height:a.height},b)}))){a.x=f,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},f.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},f.prototype.can_move_node=function(c,d,e,g,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,g,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},f.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},f.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},f.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},f.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},f.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var g=function(c,d){var e,g=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,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:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 f(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._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){g._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
').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(g._is_one_column_mode()){if(e)return;e=!0,g.grid._sort_nodes(),b.each(g.grid.nodes,function(a){g.container.append(a.el),g.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,g.opts.static_grid)return;b.each(g.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return g.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},g.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=d.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},g.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&d.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)d.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},g.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)},g.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},g.prototype._prepare_element=function(c){var e=this;c=a(c),c.addClass(this.opts.item_class);var f=e.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:d.toBool(c.attr("data-gs-auto-position")),no_resize:d.toBool(c.attr("data-gs-no-resize")),no_move:d.toBool(c.attr("data-gs-no-move")),locked:d.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!e.opts.static_grid){var g,h,i=function(b,d){e.container.append(e.placeholder);var i=a(this);e.grid.clean_nodes(),e.grid.begin_update(f),g=Math.ceil(i.outerWidth()/i.attr("data-gs-width")),h=e.opts.cell_height+e.opts.vertical_margin,e.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(),f.el=e.placeholder,c.resizable("option","minWidth",g*(f.min_width||1)),c.resizable("option","minHeight",e.opts.cell_height*(f.min_height||1))},j=function(b,c){e.placeholder.detach();var d=a(this);f.el=d,e.placeholder.hide(),d.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()};c.draggable(b.extend(this.opts.draggable,{start:i,stop:j,drag:function(a,b){var c=Math.round(b.position.left/g),d=Math.floor((b.position.top+h/2)/h);e.grid.can_move_node(f,c,d,f.width,f.height)&&(e.grid.move_node(f,c,d),e._update_container_height())},containment:this.opts.is_nested?this.container.parent():null})).resizable(b.extend(this.opts.resizable,{start:i,stop:j,resize:function(a,b){var c=Math.round(b.position.left/g),d=Math.floor((b.position.top+h/2)/h),i=Math.round(b.size.width/g),j=Math.round(b.size.height/h);e.grid.can_move_node(f,c,d,i,j)&&(e.grid.move_node(f,c,d,i,j),e._update_container_height())}})),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},g.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},g.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},g.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},g.prototype.remove_all=function(a){b.each(this.grid.nodes,function(b){this.remove_widget(b.el,a)},this),this.grid.nodes=[],this._update_container_height()},g.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),d.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},g.prototype.resizable=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.no_resize=!c,e.no_resize?d.resizable("disable"):d.resizable("enable"))}),this},g.prototype.movable=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.no_move=!c,e.no_move?d.draggable("disable"):d.draggable("enable"))}),this},g.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1)},g.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0)},g.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},g.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},g.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},g.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},g.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},g.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},g.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},g.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},g.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},g.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},g.prototype.batch_update=function(){this.grid.batch_update()},g.prototype.commit=function(){this.grid.commit(),this._update_container_height()},g.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},g.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},g.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},c.GridStackUI=g,c.GridStackUI.Utils=d,a.fn.gridstack=function(b){return this.each(function(){a(this).data("gridstack")||a(this).data("gridstack",new g(this,b))})},c.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..2c25289 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,kBAArBN,GAAMO,WACbP,EAAMO,WA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E,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","_","$","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,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,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,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D,UAAUE,OAAS,WACzBL,KAAKmG,KAAK9F,SACVL,KAAK0H,4BAGTxD,EAAU/D,UAAUa,cAAgB,SAAS3D,EAAGE,EAAGD,EAAOE,GACtD,MAAOwC,MAAKmG,KAAKnF,cAAc3D,EAAGE,EAAGD,EAAOE,IAGhD0G,EAAU/D,UAAU0K,WAAa,SAASC,GACtC9K,KAAKoE,KAAKgB,YAAe0F,KAAiB,EAC1C9K,KAAKiG,qBAGT/B,EAAU/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","file":"gridstack.min.js"} \ No newline at end of file From bce1eeaf0669e1f34348f461ed0cb50f5232c4f6 Mon Sep 17 00:00:00 2001 From: Andy Robbins Date: Fri, 15 Jan 2016 13:46:23 -0500 Subject: [PATCH 17/67] fix calls for lodash v4.0 --- src/gridstack.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index afd7843..24fa6ef 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -104,9 +104,9 @@ } while (true) { - var collision_node = _.find(this.nodes, function(n) { + var collision_node = _.find(this.nodes, _.bind(function(n) { return n != node && Utils.is_intercepted(n, nn); - }, this); + }, this)); if (typeof collision_node == 'undefined') { return; } @@ -117,9 +117,9 @@ GridStackEngine.prototype.is_area_empty = function(x, y, width, height) { var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1}; - var collision_node = _.find(this.nodes, function(n) { + var collision_node = _.find(this.nodes, _.bind(function(n) { return Utils.is_intercepted(n, nn); - }, this); + }, this)); return collision_node == null; }; @@ -131,7 +131,7 @@ this._sort_nodes(); if (this.float) { - _.each(this.nodes, function(n, i) { + _.each(this.nodes, _.bind(function(n, i) { if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y) return; @@ -150,10 +150,10 @@ } --new_y; } - }, this); + }, this)); } else { - _.each(this.nodes, function(n, i) { + _.each(this.nodes, _.bind(function(n, i) { if (n.locked) return; while (n.y > 0) { @@ -176,7 +176,7 @@ n._dirty = n.y != new_y; n.y = new_y; } - }, this); + }, this)); } }; @@ -753,9 +753,9 @@ }; GridStack.prototype.remove_all = function(detach_node) { - _.each(this.grid.nodes, function(node) { + _.each(this.grid.nodes, _.bind(function(node) { this.remove_widget(node.el, detach_node); - }, this); + }, this)); this.grid.nodes = []; this._update_container_height(); }; From 9c644eef9849e3122b80d150cb49e3d74a4619e7 Mon Sep 17 00:00:00 2001 From: Florian Heinze Date: Mon, 25 Jan 2016 14:08:18 +0100 Subject: [PATCH 18/67] [BUGFIX] offset problems for dragging and scaling with a lot of columns When using a a lot of columns, e.g. more than 40 then the dashed box showing the next placement would behave strangely compared to the box I am currently dragging. This behavior increases while dragging the box to the right side. When scaling a box on the right side, the box would jump one column to the left, which would then move around all the boxes that I have already placed. This behavior seems to be related to a rounding problem. --- dist/gridstack.js | 4 ++-- src/gridstack.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/gridstack.js b/dist/gridstack.js index 9b7aaa7..cc07dc8 100644 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -635,7 +635,7 @@ var o = $(this); self.grid.clean_nodes(); self.grid.begin_update(node); - cell_width = Math.ceil(o.outerWidth() / o.attr('data-gs-width')); + cell_width = o.outerWidth() / o.attr('data-gs-width'); cell_height = self.opts.cell_height + self.opts.vertical_margin; self.placeholder .attr('data-gs-x', o.attr('data-gs-x')) @@ -645,7 +645,7 @@ .show(); node.el = self.placeholder; - el.resizable('option', 'minWidth', cell_width * (node.min_width || 1)); + el.resizable('option', 'minWidth', Math.round(cell_width * (node.min_width || 1))); el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); }; diff --git a/src/gridstack.js b/src/gridstack.js index afd7843..d89585b 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -640,7 +640,7 @@ var o = $(this); self.grid.clean_nodes(); self.grid.begin_update(node); - cell_width = Math.ceil(o.outerWidth() / o.attr('data-gs-width')); + cell_width = o.outerWidth() / o.attr('data-gs-width'); cell_height = self.opts.cell_height + self.opts.vertical_margin; self.placeholder .attr('data-gs-x', o.attr('data-gs-x')) @@ -650,7 +650,7 @@ .show(); node.el = self.placeholder; - el.resizable('option', 'minWidth', cell_width * (node.min_width || 1)); + el.resizable('option', 'minWidth', Math.round(cell_width * (node.min_width || 1))); el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); }; From 61a129e77c4d4e7044f21a49e335b526395bccda Mon Sep 17 00:00:00 2001 From: Derek Moore Date: Thu, 28 Jan 2016 14:17:21 -0600 Subject: [PATCH 19/67] add event_stop_propagate to change event on gridstack objects --- src/gridstack.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gridstack.js b/src/gridstack.js index b368f68..051149a 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -989,7 +989,8 @@ .on('drag', event_stop_propagate) .on('resizestart', event_stop_propagate) .on('resizestop', event_stop_propagate) - .on('resize', event_stop_propagate); + .on('resize', event_stop_propagate) + .on('change', event_stop_propagate); } }); }; From 1fe90ee79b3b1d32461e1bd76d7ee2397cb97244 Mon Sep 17 00:00:00 2001 From: Derek Moore Date: Thu, 28 Jan 2016 15:21:18 -0600 Subject: [PATCH 20/67] trigger resizestart on items for when nested grids are resized --- src/gridstack.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gridstack.js b/src/gridstack.js index 051149a..9c82154 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -660,6 +660,10 @@ el.resizable('option', 'minWidth', cell_width * (node.min_width || 1)); el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); + + if (event.type == 'resizestart') { + o.find('.grid-stack-item').trigger('resizestart'); + } }; var on_end_moving = function(event, ui) { From 64aa4734cc962dad26d828d1b39745333c1da51c Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Mon, 8 Feb 2016 22:43:35 -0800 Subject: [PATCH 21/67] copy --- src/gridstack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gridstack.js b/src/gridstack.js index c61ac83..4e10e0e 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1,6 +1,6 @@ // gridstack.js 0.2.4-dev // http://troolee.github.io/gridstack.js/ -// (c) 2014-2015 Pavel Reznikov +// (c) 2014-2016 Pavel Reznikov // gridstack.js may be freely distributed under the MIT license. (function(factory) { From 81e6351586245d26623aa899133911e4e572e678 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Mon, 8 Feb 2016 22:43:46 -0800 Subject: [PATCH 22/67] update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 67e2be6..0fec027 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ 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) From 195fa60ecbebeaa4bf2bba167b7a565059a9a52b Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Mon, 8 Feb 2016 22:44:41 -0800 Subject: [PATCH 23/67] build dist --- dist/gridstack.css | 8 +++++--- dist/gridstack.js | 31 ++++++++++++++++++++----------- dist/gridstack.min.css | 2 +- dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- 5 files changed, 28 insertions(+), 17 deletions(-) diff --git a/dist/gridstack.css b/dist/gridstack.css index 50d468e..319d58a 100644 --- a/dist/gridstack.css +++ b/dist/gridstack.css @@ -70,7 +70,6 @@ } .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); @@ -296,8 +295,11 @@ /* .grid-stack > .grid-stack-item > .ui-resizable-sw { display: inline-block; - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); - @include vendor(transform, rotate(180deg)); + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); } */ @media (max-width: 768px) { diff --git a/dist/gridstack.js b/dist/gridstack.js index cc07dc8..4e10e0e 100644 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -1,6 +1,6 @@ // gridstack.js 0.2.4-dev // http://troolee.github.io/gridstack.js/ -// (c) 2014-2015 Pavel Reznikov +// (c) 2014-2016 Pavel Reznikov // gridstack.js may be freely distributed under the MIT license. (function(factory) { @@ -8,6 +8,11 @@ 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 { factory(jQuery, _); } @@ -99,9 +104,9 @@ } while (true) { - var collision_node = _.find(this.nodes, function(n) { + var collision_node = _.find(this.nodes, _.bind(function(n) { return n != node && Utils.is_intercepted(n, nn); - }, this); + }, this)); if (typeof collision_node == 'undefined') { return; } @@ -112,9 +117,9 @@ GridStackEngine.prototype.is_area_empty = function(x, y, width, height) { var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1}; - var collision_node = _.find(this.nodes, function(n) { + var collision_node = _.find(this.nodes, _.bind(function(n) { return Utils.is_intercepted(n, nn); - }, this); + }, this)); return collision_node == null; }; @@ -126,7 +131,7 @@ this._sort_nodes(); if (this.float) { - _.each(this.nodes, function(n, i) { + _.each(this.nodes, _.bind(function(n, i) { if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y) return; @@ -145,10 +150,10 @@ } --new_y; } - }, this); + }, this)); } else { - _.each(this.nodes, function(n, i) { + _.each(this.nodes, _.bind(function(n, i) { if (n.locked) return; while (n.y > 0) { @@ -171,7 +176,7 @@ n._dirty = n.y != new_y; n.y = new_y; } - }, this); + }, this)); } }; @@ -748,9 +753,9 @@ }; GridStack.prototype.remove_all = function(detach_node) { - _.each(this.grid.nodes, function(node) { + _.each(this.grid.nodes, _.bind(function(node) { this.remove_widget(node.el, detach_node); - }, this); + }, this)); this.grid.nodes = []; this._update_container_height(); }; @@ -796,9 +801,11 @@ node.no_move = !(val || false); if (node.no_move) { el.draggable('disable'); + el.removeClass('ui-draggable-handle'); } else { el.draggable('enable'); + el.addClass('ui-draggable-handle'); } }); return this; @@ -807,11 +814,13 @@ 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.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.container.trigger('enable'); }; GridStack.prototype.locked = function(el, val) { diff --git a/dist/gridstack.min.css b/dist/gridstack.min.css index a964730..85c9dde 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 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;-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 diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index 56fc33d..070a7c6 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!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}); +!function(t){if("function"==typeof define&&define.amd)define(["jquery","lodash","jquery-ui/core","jquery-ui/widget","jquery-ui/mouse","jquery-ui/draggable","jquery-ui/resizable"],t);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(e){}try{_=require("lodash")}catch(e){}t(jQuery,_)}else 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,e.bind(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,e.bind(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,e.bind(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,e.bind(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=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",Math.round(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,e.bind(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.removeClass("ui-draggable-handle")):(n.draggable("enable"),n.addClass("ui-draggable-handle")))}),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),this.container.trigger("disable")},a.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},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}); //# sourceMappingURL=gridstack.min.map \ No newline at end of file diff --git a/dist/gridstack.min.map b/dist/gridstack.min.map index 807e8b1..fb1c697 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,WA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Ua,cAAgB,SAAS3D,EAAGE,EAAGD,EAAOE,GACtD,MAAOwC,MAAKmG,KAAKnF,cAAc3D,EAAGE,EAAGD,EAAOE,IAGhD0G,EAAU/D,UAAU0K,WAAa,SAASC,GACtC9K,KAAKoE,KAAKgB,YAAe0F,KAAiB,EAC1C9K,KAAKiG,qBAGT/B,EAAU/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,"file":"dist/gridstack.min.js","sources":["src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","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","bind","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","outerWidth","show","round","on_end_moving","detach","removeAttr","start","stop","drag","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,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,MA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PATCH 24/67] fix #276 --- dist/gridstack.js | 2 +- dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- src/gridstack.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/gridstack.js b/dist/gridstack.js index 4e10e0e..c5ff565 100644 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -408,7 +408,7 @@ min_width: 768, float: false, static_grid: false, - _class: 'grid-stack-' + (Math.random() * 10000).toFixed(0), + _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, resizable: _.defaults(opts.resizable || {}, { diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index 070a7c6..432eeed 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!function(t){if("function"==typeof define&&define.amd)define(["jquery","lodash","jquery-ui/core","jquery-ui/widget","jquery-ui/mouse","jquery-ui/draggable","jquery-ui/resizable"],t);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(e){}try{_=require("lodash")}catch(e){}t(jQuery,_)}else 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,e.bind(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,e.bind(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,e.bind(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,e.bind(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=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",Math.round(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,e.bind(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.removeClass("ui-draggable-handle")):(n.draggable("enable"),n.addClass("ui-draggable-handle")))}),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),this.container.trigger("disable")},a.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},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}); +!function(t){if("function"==typeof define&&define.amd)define(["jquery","lodash","jquery-ui/core","jquery-ui/widget","jquery-ui/mouse","jquery-ui/draggable","jquery-ui/resizable"],t);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(e){}try{_=require("lodash")}catch(e){}t(jQuery,_)}else 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,e.bind(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,e.bind(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,e.bind(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,e.bind(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-instance-"+(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=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",Math.round(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,e.bind(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.removeClass("ui-draggable-handle")):(n.draggable("enable"),n.addClass("ui-draggable-handle")))}),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),this.container.trigger("disable")},a.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},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}); //# sourceMappingURL=gridstack.min.map \ No newline at end of file diff --git a/dist/gridstack.min.map b/dist/gridstack.min.map index fb1c697..1c526ae 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","exports","jQuery","require","e","_","$","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","bind","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","outerWidth","show","round","on_end_moving","detach","removeAttr","start","stop","drag","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,C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KqE,KAAKgB,eAAgB,EAC1BrF,KAAKwE,UAAUyB,SAAS+E,GAExBhL,KAAKwE,UAAU6E,YAAY2B,IAInCjO,EAAMkO,YAAc9G,EAEpBpH,EAAMkO,YAAYhO,MAAQA,EAE1BH,EAAEoO,GAAGC,UAAY,SAAS9G,GACtB,MAAOrE,MAAKkB,KAAK,WACRpE,EAAEkD,MAAMgI,KAAK,cACdlL,EAAEkD,MAAMgI,KAAK,YAAa,GAAI7D,GAAUnE,KAAMqE,OAKnDtH,EAAMkO"} \ No newline at end of file +{"version":3,"file":"dist/gridstack.min.js","sources":["src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","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","bind","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","outerWidth","show","round","on_end_moving","detach","removeAttr","start","stop","drag","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,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,aA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KqE,KAAKa,eAEnD,QAAQ7H,EAAGwF,KAAKM,MAAMuH,EAAeE,GAAerN,EAAGsF,KAAKM,MAAMwH,EAAcE,KAGpF1G,EAAUhE,UAAUC,aAAe,WAC/BJ,KAAKoG,KAAKhG,gBAGd+D,EAAUhE,UAAUE,OAAS,WACzBL,KAAKoG,KAAK/F,SACVL,KAAK2H,4BAGTxD,EAAUhE,UAAUc,cAAgB,SAAS5D,EAAGE,EAAGD,EAAOE,GACtD,MAAOwC,MAAKoG,KAAKnF,cAAc5D,EAAGE,EAAGD,EAAOE,IAGhD2G,EAAUhE,UAAU2K,WAAa,SAASC,GACtC/K,KAAKqE,KAAKgB,YAAe0F,KAAiB,EAC1C/K,KAAKkG,qBAGT/B,EAAUhE,UAAU+F,kBAAoB,WACpC,GAAI8E,GAAoB,mBAEpBhL,MAAKqE,KAAKgB,eAAgB,EAC1BrF,KAAKwE,UAAUyB,SAAS+E,GAExBhL,KAAKwE,UAAU6E,YAAY2B,IAInCjO,EAAMkO,YAAc9G,EAEpBpH,EAAMkO,YAAYhO,MAAQA,EAE1BH,EAAEoO,GAAGC,UAAY,SAAS9G,GACtB,MAAOrE,MAAKkB,KAAK,WACRpE,EAAEkD,MAAMgI,KAAK,cACdlL,EAAEkD,MAAMgI,KAAK,YAAa,GAAI7D,GAAUnE,KAAMqE,OAKnDtH,EAAMkO"} \ No newline at end of file diff --git a/src/gridstack.js b/src/gridstack.js index 4e10e0e..c5ff565 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -408,7 +408,7 @@ min_width: 768, float: false, static_grid: false, - _class: 'grid-stack-' + (Math.random() * 10000).toFixed(0), + _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, resizable: _.defaults(opts.resizable || {}, { From 652979a3f891ced1ed3d8eaa79c93fc380f2299c Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Tue, 9 Feb 2016 23:46:33 -0800 Subject: [PATCH 25/67] slack --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0fec027..44e794a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ touch devices. Inspired by [gridster.js](http://gridster.net). Built with love. +Join gridstack.js on Slack: http://gridstackjs.troolee.com + +[![Slack Status](https://gridstackjs.troolee.com/badge.svg)](http://gridstackjs.troolee.com) + **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* From 15a121e7d63d58c8cc3f8da8b8c852c5c82a5b35 Mon Sep 17 00:00:00 2001 From: Ross Harrison Date: Wed, 10 Feb 2016 11:13:19 -0500 Subject: [PATCH 26/67] allow default sass values to be preset --- src/gridstack.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gridstack.scss b/src/gridstack.scss index 9918e78..4a52c55 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; From c679b26d02e8bda413a4a6f37f584f8a0b93e0ff Mon Sep 17 00:00:00 2001 From: Ross Harrison Date: Wed, 10 Feb 2016 11:13:47 -0500 Subject: [PATCH 27/67] allow default sass value to be preset --- src/gridstack-extra.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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} { From f1e97234842b123723091b3052e63524a671e035 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 17:33:35 -0800 Subject: [PATCH 28/67] readme --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 44e794a..6bfb8a3 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ Join gridstack.js on Slack: http://gridstackjs.troolee.com - [Demo](#demo) - [Usage](#usage) - [Requirements](#requirements) - - [Rails integration](#rails-integration) - [Basic usage](#basic-usage) - [Options](#options) - [Grid attributes](#grid-attributes) @@ -59,6 +58,8 @@ Join gridstack.js on Slack: http://gridstackjs.troolee.com - [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) @@ -98,10 +99,6 @@ Usage Note: You can still use [underscore.js](http://underscorejs.org) (>= 1.7.0) instead of lodash.js -## 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) - ## Basic usage ```html @@ -531,6 +528,16 @@ template: 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 From 9bb409fdeef4b543feced5acde6246fd7b2e3607 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 18:32:04 -0800 Subject: [PATCH 29/67] gruntfile indents --- Gruntfile.js | 92 ++++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index ed2a19c..acc487b 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,51 +1,51 @@ 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-sass'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.initConfig({ - sass: { - options: { - outputStyle: 'expanded' - }, - dist: { - files: { - 'dist/gridstack.css': 'src/gridstack.scss', - 'dist/gridstack-extra.css': 'src/gridstack-extra.scss' + 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' + }, + dist: { + files: { + 'dist/gridstack.min.js': ['src/gridstack.js'] + } + } } - } - }, + }); - 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' - }, - dist: { - files: { - 'dist/gridstack.min.js': ['src/gridstack.js'] - } - } - } - }); - - grunt.registerTask('default', ['sass', 'cssmin', 'copy', 'uglify']); + grunt.registerTask('default', ['sass', 'cssmin', 'copy', 'uglify']); }; From 8410c3babf3cf3825ced528a3e08384bc4dd1cbd Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 18:45:47 -0800 Subject: [PATCH 30/67] add doctoc to grunt --- Gruntfile.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index acc487b..f9cc452 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,6 +3,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-doctoc'); grunt.initConfig({ sass: { @@ -44,8 +45,17 @@ module.exports = function (grunt) { 'dist/gridstack.min.js': ['src/gridstack.js'] } } + }, + + doctoc: { + options: { + removeAd: false + }, + readme: { + target: "./README.md" + } } }); - grunt.registerTask('default', ['sass', 'cssmin', 'copy', 'uglify']); + grunt.registerTask('default', ['sass', 'cssmin', 'copy', 'uglify', 'doctoc']); }; From 7a7683027264e9651fba89c41e8b65a665754412 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 18:45:59 -0800 Subject: [PATCH 31/67] small fixes --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6bfb8a3..c8c2adc 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ touch devices. Inspired by [gridster.js](http://gridster.net). Built with love. -Join gridstack.js on Slack: http://gridstackjs.troolee.com +Join gridstack.js on Slack: https://gridstackjs.troolee.com -[![Slack Status](https://gridstackjs.troolee.com/badge.svg)](http://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) From 83148372131db8a879463d96d03b2f819ca99aef Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 18:53:00 -0800 Subject: [PATCH 32/67] build js --- dist/gridstack.js | 83 +++++++++++++++++++++++++++--------------- dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- 3 files changed, 55 insertions(+), 32 deletions(-) diff --git a/dist/gridstack.js b/dist/gridstack.js index c5ff565..ce7c59c 100755 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -635,6 +635,22 @@ var cell_width, cell_height; + var drag_or_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, height; + if (event.type != "drag") { + 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(); + }; + var on_start_moving = function(event, ui) { self.container.append(self.placeholder); var o = $(this); @@ -652,6 +668,10 @@ el.resizable('option', 'minWidth', Math.round(cell_width * (node.min_width || 1))); el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); + + if (event.type == 'resizestart') { + o.find('.grid-stack-item').trigger('resizestart'); + } }; var on_end_moving = function(event, ui) { @@ -669,36 +689,27 @@ self._trigger_change_event(); self.grid.end_update(); + + var nested_grids = o.find('.grid-stack'); + if (nested_grids.length && event.type == 'resizestop') { + nested_grids.each(function(index, el) { + $(el).data('gridstack').on_resize_handler(); + }); + 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.is_nested ? this.container.parent() : null + })) + .on('dragstart', on_start_moving) + .on('dragstop', on_end_moving) + .on('drag', drag_or_resize) + .resizable(_.extend(this.opts.resizable, {})) + .on('resizestart', on_start_moving) + .on('resizestop', on_end_moving) + .on('resize', drag_or_resize); if (node.no_move || this._is_one_column_mode()) { el.draggable('disable'); @@ -980,10 +991,22 @@ scope.GridStackUI.Utils = Utils; + function event_stop_propagate(event) { + event.stopPropagation(); + } $.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)) + .on('dragstart', event_stop_propagate) + .on('dragstop', event_stop_propagate) + .on('drag', event_stop_propagate) + .on('resizestart', event_stop_propagate) + .on('resizestop', event_stop_propagate) + .on('resize', event_stop_propagate) + .on('change', event_stop_propagate); } }); }; diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index e88566c..7bff553 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!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){var c=window,d={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},e=0,f=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._update_counter=0,this._float=this["float"]};f.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},f.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},f.prototype._fix_collisions=function(a){this._sort_nodes(-1);var c=a,e=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||e||(c={x:0,y:a.y,width:this.width,height:a.height});;){var f=b.find(this.nodes,b.bind(function(b){return b!=a&&d.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},f.prototype.is_area_empty=function(a,c,e,f){var g={x:a||0,y:c||0,width:e||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return d.is_intercepted(a,g)},this));return null==h},f.prototype._sort_nodes=function(a){this.nodes=d.sort(this.nodes,a,this.width)},f.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var e=a.y;e>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f||(a._dirty=!0,a.y=e),--e}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var e=a.y-1,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=e,a.y=e}},this))},f.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},f.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},f.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},f.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},f.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++e,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var f=c%this.width,g=Math.floor(c/this.width);if(!(f+a.width>this.width||b.find(this.nodes,function(b){return d.is_intercepted({x:f,y:g,width:a.width,height:a.height},b)}))){a.x=f,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},f.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},f.prototype.can_move_node=function(c,d,e,g,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,g,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},f.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},f.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},f.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},f.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},f.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var g=function(c,d){var e,g=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 f(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._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){g._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
').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(g._is_one_column_mode()){if(e)return;e=!0,g.grid._sort_nodes(),b.each(g.grid.nodes,function(a){g.container.append(a.el),g.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,g.opts.static_grid)return;b.each(g.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return g.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},g.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=d.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},g.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&d.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)d.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},g.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)},g.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},g.prototype._prepare_element=function(c){var e=this;c=a(c),c.addClass(this.opts.item_class);var f=e.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:d.toBool(c.attr("data-gs-auto-position")),no_resize:d.toBool(c.attr("data-gs-no-resize")),no_move:d.toBool(c.attr("data-gs-no-move")),locked:d.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!e.opts.static_grid){var g,h,i=function(b,d){e.container.append(e.placeholder);var i=a(this);e.grid.clean_nodes(),e.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=e.opts.cell_height+e.opts.vertical_margin,e.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(),f.el=e.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",e.opts.cell_height*(f.min_height||1))},j=function(b,c){e.placeholder.detach();var d=a(this);f.el=d,e.placeholder.hide(),d.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()};c.draggable(b.extend(this.opts.draggable,{start:i,stop:j,drag:function(a,b){var c=Math.round(b.position.left/g),d=Math.floor((b.position.top+h/2)/h);e.grid.can_move_node(f,c,d,f.width,f.height)&&(e.grid.move_node(f,c,d),e._update_container_height())},containment:this.opts.is_nested?this.container.parent():null})).resizable(b.extend(this.opts.resizable,{start:i,stop:j,resize:function(a,b){var c=Math.round(b.position.left/g),d=Math.floor((b.position.top+h/2)/h),i=Math.round(b.size.width/g),j=Math.round(b.size.height/h);e.grid.can_move_node(f,c,d,i,j)&&(e.grid.move_node(f,c,d,i,j),e._update_container_height())}})),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},g.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},g.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},g.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},g.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},g.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),d.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},g.prototype.resizable=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.no_resize=!c,e.no_resize?d.resizable("disable"):d.resizable("enable"))}),this},g.prototype.movable=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.no_move=!c,e.no_move?(d.draggable("disable"),d.removeClass("ui-draggable-handle")):(d.draggable("enable"),d.addClass("ui-draggable-handle")))}),this},g.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},g.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},g.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},g.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},g.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},g.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},g.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},g.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},g.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},g.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},g.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},g.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},g.prototype.batch_update=function(){this.grid.batch_update()},g.prototype.commit=function(){this.grid.commit(),this._update_container_height()},g.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},g.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},g.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},c.GridStackUI=g,c.GridStackUI.Utils=d,a.fn.gridstack=function(b){return this.each(function(){a(this).data("gridstack")||a(this).data("gridstack",new g(this,b))})},c.GridStackUI}); +!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){a.stopPropagation()}var d=window,e={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},f=0,g=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._update_counter=0,this._float=this["float"]};g.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},g.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},g.prototype._fix_collisions=function(a){this._sort_nodes(-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 f=b.find(this.nodes,b.bind(function(b){return b!=a&&e.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},g.prototype.is_area_empty=function(a,c,d,f){var g={x:a||0,y:c||0,width:d||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return e.is_intercepted(a,g)},this));return null==h},g.prototype._sort_nodes=function(a){this.nodes=e.sort(this.nodes,a,this.width)},g.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var d=a.y;d>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f||(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,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=d,a.y=d}},this))},g.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},g.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},g.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},g.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},g.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++f,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var d=c%this.width,g=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,function(b){return e.is_intercepted({x:d,y:g,width:a.width,height:a.height},b)}))){a.x=d,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},g.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},g.prototype.can_move_node=function(c,d,e,f,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,f,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},g.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},g.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},g.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},g.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},g.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var h=function(c,d){var e,f=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 g(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))}),f._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){f._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
').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(f._is_one_column_mode()){if(e)return;e=!0,f.grid._sort_nodes(),b.each(f.grid.nodes,function(a){f.container.append(a.el),f.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,f.opts.static_grid)return;b.each(f.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return h.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},h.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=e.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},h.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&e.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)e.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},h.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)},h.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},h.prototype._prepare_element=function(c){var d=this;c=a(c),c.addClass(this.opts.item_class);var f=d.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:e.toBool(c.attr("data-gs-auto-position")),no_resize:e.toBool(c.attr("data-gs-no-resize")),no_move:e.toBool(c.attr("data-gs-no-move")),locked:e.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!d.opts.static_grid){var g,h,i=function(a,b){var c,e,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),e=Math.round(b.size.height/h)),d.grid.can_move_node(f,i,j,c,e)&&(d.grid.move_node(f,i,j,c,e),d._update_container_height())},j=function(b,e){d.container.append(d.placeholder);var i=a(this);d.grid.clean_nodes(),d.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=d.opts.cell_height+d.opts.vertical_margin,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(),f.el=d.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",d.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var e=a(this);f.el=e,d.placeholder.hide(),e.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),d._update_container_height(),d._trigger_change_event(),d.grid.end_update();var g=e.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),e.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null})).on("dragstart",j).on("dragstop",k).on("drag",i).resizable(b.extend(this.opts.resizable,{})).on("resizestart",j).on("resizestop",k).on("resize",i),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},h.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},h.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},h.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},h.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},h.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),e.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},h.prototype.resizable=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.no_resize=!c,e.no_resize?d.resizable("disable"):d.resizable("enable"))}),this},h.prototype.movable=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.no_move=!c,e.no_move?(d.draggable("disable"),d.removeClass("ui-draggable-handle")):(d.draggable("enable"),d.addClass("ui-draggable-handle")))}),this},h.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},h.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},h.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},h.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},h.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},h.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},h.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},h.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},h.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},h.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},h.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},h.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},h.prototype.batch_update=function(){this.grid.batch_update()},h.prototype.commit=function(){this.grid.commit(),this._update_container_height()},h.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},h.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},h.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},d.GridStackUI=h,d.GridStackUI.Utils=e,a.fn.gridstack=function(b){return this.each(function(){var d=a(this);d.data("gridstack")||d.data("gridstack",new h(this,b)).on("dragstart",c).on("dragstop",c).on("drag",c).on("resizestart",c).on("resizestop",c).on("resize",c).on("change",c)})},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 ecbfbc6..43c0c5b 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","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","bind","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","outerWidth","show","round","on_end_moving","detach","removeAttr","start","stop","drag","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,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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,QAAQ7H,EAAGwF,KAAKM,MAAMuH,EAAeE,GAAerN,EAAGsF,KAAKM,MAAMwH,EAAcE,KAGpF1G,EAAUhE,UAAUC,aAAe,WAC/BJ,KAAKoG,KAAKhG,gBAGd+D,EAAUhE,UAAUE,OAAS,WACzBL,KAAKoG,KAAK/F,SACVL,KAAK2H,4BAGTxD,EAAUhE,UAAUc,cAAgB,SAAS5D,EAAGE,EAAGD,EAAOE,GACtD,MAAOwC,MAAKoG,KAAKnF,cAAc5D,EAAGE,EAAGD,EAAOE,IAGhD2G,EAAUhE,UAAU2K,WAAa,SAASC,GACtC/K,KAAKqE,KAAKgB,YAAe0F,KAAiB,EAC1C/K,KAAKkG,qBAGT/B,EAAUhE,UAAU+F,kBAAoB,WACpC,GAAI8E,GAAoB,mBAEpBhL,MAAKqE,KAAKgB,eAAgB,EAC1BrF,KAAKwE,UAAUyB,SAAS+E,GAExBhL,KAAKwE,UAAU6E,YAAY2B,IAInCjO,EAAMkO,YAAc9G,EAEpBpH,EAAMkO,YAAYhO,MAAQA,EAE1BH,EAAEoO,GAAGC,UAAY,SAAS9G,GACtB,MAAOrE,MAAKkB,KAAK,WACRpE,EAAEkD,MAAMgI,KAAK,cACdlL,EAAEkD,MAAMgI,KAAK,YAAa,GAAI7D,GAAUnE,KAAMqE,OAKnDtH,EAAMkO","file":"gridstack.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","event_stop_propagate","event","stopPropagation","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","bind","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","drag_or_resize","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","on","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,IAErB,SAASC,EAAGD,GA+8BX,QAASE,GAAqBC,GAC1BA,EAAMC,kBA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yB,SAAS+E,GAExBhL,KAAKwE,UAAU6E,YAAY2B,IAInCjO,EAAMkO,YAAc9G,EAEpBpH,EAAMkO,YAAYhO,MAAQA,EAK1BN,EAAEuO,GAAGC,UAAY,SAAS9G,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAIwH,GAAI/L,EAAEqD,KACL0I,GAAEV,KAAK,cACRU,EACKV,KAAK,YAAa,GAAI7D,GAAUnE,KAAMqE,IACtC8E,GAAG,YAAavM,GAChBuM,GAAG,WAAYvM,GACfuM,GAAG,OAAQvM,GACXuM,GAAG,cAAevM,GAClBuM,GAAG,aAAcvM,GACjBuM,GAAG,SAAUvM,GACbuM,GAAG,SAAUvM,MAKvBG,EAAMkO","file":"gridstack.min.js"} \ No newline at end of file From 44ed26d813862e91a81ac4b46854290dfae4c5fc Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 18:54:56 -0800 Subject: [PATCH 33/67] build dist --- dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index 7bff553..8e17af1 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!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){a.stopPropagation()}var d=window,e={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},f=0,g=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._update_counter=0,this._float=this["float"]};g.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},g.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},g.prototype._fix_collisions=function(a){this._sort_nodes(-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 f=b.find(this.nodes,b.bind(function(b){return b!=a&&e.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},g.prototype.is_area_empty=function(a,c,d,f){var g={x:a||0,y:c||0,width:d||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return e.is_intercepted(a,g)},this));return null==h},g.prototype._sort_nodes=function(a){this.nodes=e.sort(this.nodes,a,this.width)},g.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var d=a.y;d>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f||(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,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=d,a.y=d}},this))},g.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},g.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},g.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},g.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},g.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++f,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var d=c%this.width,g=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,function(b){return e.is_intercepted({x:d,y:g,width:a.width,height:a.height},b)}))){a.x=d,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},g.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},g.prototype.can_move_node=function(c,d,e,f,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,f,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},g.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},g.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},g.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},g.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},g.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var h=function(c,d){var e,f=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 g(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))}),f._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){f._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
').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(f._is_one_column_mode()){if(e)return;e=!0,f.grid._sort_nodes(),b.each(f.grid.nodes,function(a){f.container.append(a.el),f.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,f.opts.static_grid)return;b.each(f.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return h.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},h.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=e.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},h.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&e.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)e.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},h.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)},h.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},h.prototype._prepare_element=function(c){var d=this;c=a(c),c.addClass(this.opts.item_class);var f=d.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:e.toBool(c.attr("data-gs-auto-position")),no_resize:e.toBool(c.attr("data-gs-no-resize")),no_move:e.toBool(c.attr("data-gs-no-move")),locked:e.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!d.opts.static_grid){var g,h,i=function(a,b){var c,e,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),e=Math.round(b.size.height/h)),d.grid.can_move_node(f,i,j,c,e)&&(d.grid.move_node(f,i,j,c,e),d._update_container_height())},j=function(b,e){d.container.append(d.placeholder);var i=a(this);d.grid.clean_nodes(),d.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=d.opts.cell_height+d.opts.vertical_margin,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(),f.el=d.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",d.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var e=a(this);f.el=e,d.placeholder.hide(),e.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),d._update_container_height(),d._trigger_change_event(),d.grid.end_update();var g=e.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),e.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null})).on("dragstart",j).on("dragstop",k).on("drag",i).resizable(b.extend(this.opts.resizable,{})).on("resizestart",j).on("resizestop",k).on("resize",i),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},h.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},h.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},h.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},h.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},h.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),e.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},h.prototype.resizable=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.no_resize=!c,e.no_resize?d.resizable("disable"):d.resizable("enable"))}),this},h.prototype.movable=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.no_move=!c,e.no_move?(d.draggable("disable"),d.removeClass("ui-draggable-handle")):(d.draggable("enable"),d.addClass("ui-draggable-handle")))}),this},h.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},h.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},h.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},h.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},h.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},h.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},h.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},h.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},h.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},h.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},h.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},h.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},h.prototype.batch_update=function(){this.grid.batch_update()},h.prototype.commit=function(){this.grid.commit(),this._update_container_height()},h.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},h.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},h.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},d.GridStackUI=h,d.GridStackUI.Utils=e,a.fn.gridstack=function(b){return this.each(function(){var d=a(this);d.data("gridstack")||d.data("gridstack",new h(this,b)).on("dragstart",c).on("dragstop",c).on("drag",c).on("resizestart",c).on("resizestop",c).on("resize",c).on("change",c)})},d.GridStackUI}); +!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){a.stopPropagation()}var d=window,e={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},f=0,g=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._update_counter=0,this._float=this["float"]};g.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},g.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},g.prototype._fix_collisions=function(a){this._sort_nodes(-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 f=b.find(this.nodes,b.bind(function(b){return b!=a&&e.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},g.prototype.is_area_empty=function(a,c,d,f){var g={x:a||0,y:c||0,width:d||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return e.is_intercepted(a,g)},this));return null==h},g.prototype._sort_nodes=function(a){this.nodes=e.sort(this.nodes,a,this.width)},g.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var d=a.y;d>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f||(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,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=d,a.y=d}},this))},g.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},g.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},g.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},g.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},g.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++f,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var d=c%this.width,g=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,function(b){return e.is_intercepted({x:d,y:g,width:a.width,height:a.height},b)}))){a.x=d,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},g.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},g.prototype.can_move_node=function(c,d,e,f,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,f,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},g.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},g.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},g.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},g.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},g.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var h=function(c,d){var e,f=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 g(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))}),f._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){f._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
').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(f._is_one_column_mode()){if(e)return;e=!0,f.grid._sort_nodes(),b.each(f.grid.nodes,function(a){f.container.append(a.el),f.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,f.opts.static_grid)return;b.each(f.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return h.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},h.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=e.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},h.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&e.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)e.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},h.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)},h.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},h.prototype._prepare_element=function(c){var d=this;c=a(c),c.addClass(this.opts.item_class);var f=d.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:e.toBool(c.attr("data-gs-auto-position")),no_resize:e.toBool(c.attr("data-gs-no-resize")),no_move:e.toBool(c.attr("data-gs-no-move")),locked:e.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!d.opts.static_grid){var g,h,i=function(a,b){var c,e,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),e=Math.round(b.size.height/h)),d.grid.can_move_node(f,i,j,c,e)&&(d.grid.move_node(f,i,j,c,e),d._update_container_height())},j=function(b,e){d.container.append(d.placeholder);var i=a(this);d.grid.clean_nodes(),d.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=d.opts.cell_height+d.opts.vertical_margin,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(),f.el=d.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",d.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var e=a(this);f.el=e,d.placeholder.hide(),e.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),d._update_container_height(),d._trigger_change_event(),d.grid.end_update();var g=e.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),e.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null})).on("dragstart",j).on("dragstop",k).on("drag",i).resizable(b.extend(this.opts.resizable,{})).on("resizestart",j).on("resizestop",k).on("resize",i),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},h.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},h.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},h.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},h.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},h.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),e.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},h.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},h.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},h.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},h.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},h.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},h.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},h.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},h.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},h.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},h.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},h.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},h.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},h.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},h.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},h.prototype.batch_update=function(){this.grid.batch_update()},h.prototype.commit=function(){this.grid.commit(),this._update_container_height()},h.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},h.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},h.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},d.GridStackUI=h,d.GridStackUI.Utils=e,a.fn.gridstack=function(b){return this.each(function(){var d=a(this);d.data("gridstack")||d.data("gridstack",new h(this,b)).on("dragstart",c).on("dragstop",c).on("drag",c).on("resizestart",c).on("resizestop",c).on("resize",c).on("change",c)})},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 43c0c5b..9c293b7 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","event_stop_propagate","event","stopPropagation","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","bind","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","drag_or_resize","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","on","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,IAErB,SAASC,EAAGD,GA+8BX,QAASE,GAAqBC,GAC1BA,EAAMC,kBA98BV,GAAIC,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,GAASZ,EAAEkB,MAAMF,GAAOG,IAAI,SAASC,GAAQ,MAAOA,GAAKT,EAAIS,EAAKR,QAAUS,MAAMC,QAC1FL,EAA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GAAG,SAAUvM,GACbuM,GAAG,SAAUvM,MAKvBG,EAAMkO","file":"gridstack.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","event_stop_propagate","event","stopPropagation","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","bind","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","drag_or_resize","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","on","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,IAErB,SAASC,EAAGD,GAi9BX,QAASE,GAAqBC,GAC1BA,EAAMC,kBAh9BV,GAAIC,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,GAASZ,EAAEkB,MAAMF,GAAOG,IAAI,SAASC,GAAQ,MAAOA,GAAKT,EAAIS,EAAKR,QAAUS,MAAMC,QAC1FL,EAAa,IAAPA,EAAY,EAAI,GACfjB,EAAEuB,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,S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AAQ7H,EAAGwF,KAAKM,MAAMuH,EAAeE,GAAerN,EAAGsF,KAAKM,MAAMwH,EAAcE,KAGpF1G,EAAUhE,UAAUC,aAAe,WAC/BJ,KAAKoG,KAAKhG,gBAGd+D,EAAUhE,UAAUE,OAAS,WACzBL,KAAKoG,KAAK/F,SACVL,KAAK2H,4BAGTxD,EAAUhE,UAAUc,cAAgB,SAAS5D,EAAGE,EAAGD,EAAOE,GACtD,MAAOwC,MAAKoG,KAAKnF,cAAc5D,EAAGE,EAAGD,EAAOE,IAGhD2G,EAAUhE,UAAU2K,WAAa,SAASC,GACtC/K,KAAKqE,KAAKgB,YAAe0F,KAAiB,EAC1C/K,KAAKkG,qBAGT/B,EAAUhE,UAAU+F,kBAAoB,WACpC,GAAI8E,GAAoB,mBAEpBhL,MAAKqE,KAAKgB,eAAgB,EAC1BrF,KAAKwE,UAAUyB,SAAS+E,GAExBhL,KAAKwE,UAAU6E,YAAY2B,IAInCjO,EAAMkO,YAAc9G,EAEpBpH,EAAMkO,YAAYhO,MAAQA,EAK1BN,EAAEuO,GAAGC,UAAY,SAAS9G,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAIwH,GAAI/L,EAAEqD,KACL0I,GAAEV,KAAK,cACRU,EACKV,KAAK,YAAa,GAAI7D,GAAUnE,KAAMqE,IACtC8E,GAAG,YAAavM,GAChBuM,GAAG,WAAYvM,GACfuM,GAAG,OAAQvM,GACXuM,GAAG,cAAevM,GAClBuM,GAAG,aAAcvM,GACjBuM,GAAG,SAAUvM,GACbuM,GAAG,SAAUvM,MAKvBG,EAAMkO","file":"gridstack.min.js"} \ No newline at end of file From aff5ce520456de7165a0fda851d42ac0287436e0 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 19:07:55 -0800 Subject: [PATCH 34/67] update README --- README.md | 65 +++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index c8c2adc..7f98f0d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ gridstack.js ============ -gridstack.js is a jQuery plugin for widget layout. This is drag-and-drop multi-column grid. It allows you to build +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. @@ -92,7 +92,7 @@ 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 @@ -103,13 +103,13 @@ Note: You can still use [underscore.js](http://underscorejs.org) (>= 1.7.0) inst ```html
-
-
@@ -128,18 +128,18 @@ $(function () { ## Options -- `always_show_resize_handle` - if `true` the resizing handles are shown even if the user is not hovering over the widget - (default: `false`) +- `always_show_resize_handle` - if `true` the resizing handles are shown even if the user is not hovering over the widget + (default: `false`) - `animate` - turns animation on (default: `false`) - `auto` - if `false` 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'}`) +- `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`) - `height` - maximum rows amount. Default is `0` which means no maximum rows - `float` - enable floating widgets (default: `false`) See [example](http://troolee.github.io/gridstack.js/demo/float.html) - `item_class` - widget class (default: `'grid-stack-item'`) -- `min_width` - minimal width. If window width is less, grid will be shown in one-column mode (default: `768`) +- `min_width` - minimal width. If window width is less, grid will be shown in one-column mode. You need also update your css file (`@media (max-width: 768px) {...}`) with corresponding value (default: `768`) - `placeholder_class` - class for placeholder (default: `'grid-stack-placeholder'`) - `resizable` - allows to override jQuery UI resizable options. (default: `{autoHide: true, handles: 'se'}`) - `static_grid` - makes grid static (default `false`). If true widgets are not movable/resizable. You don't even need jQueryUI draggable/resizable. A CSS class `grid-stack-static` is also added to the container. @@ -148,7 +148,7 @@ $(function () { ## 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. @@ -158,13 +158,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) @@ -258,7 +258,7 @@ grid.add_widget(el, 0, 0, 3, 2, true); ### batch_update() -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() @@ -283,7 +283,7 @@ Finishes batch updates. Updates DOM nodes. You must call it after `batch_update` ### destroy() -Destroys a grid instance. +Destroys a grid instance. ### disable() @@ -322,7 +322,7 @@ 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) @@ -381,13 +381,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) 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) @@ -412,7 +412,7 @@ else { alert('Not enough free space to place the widget'); } ``` - + ## Utils @@ -522,7 +522,7 @@ template: ' ....', '
', // <-- NO SPACE **AFTER**
'
' // <-- NO SPACE **BEFORE**
- ].join('') // <-- JOIN WITH **EMPTY** STRING + ].join('') // <-- JOIN WITH **EMPTY** STRING ``` Otherwise `addDisposeCallback` won't work. @@ -540,8 +540,8 @@ For rails users, integration of gridstack.js and its dependencies can be done th ## 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: @@ -590,7 +590,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: @@ -607,7 +607,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 @@ -627,7 +627,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 @@ -649,7 +649,7 @@ var grid = $('.grid-stack').data('gridstack'); grid.remove_all(); _.each(serialization, function (node) { - grid.add_widget($('
'), + grid.add_widget($('
'), node.x, node.y, node.width, node.height); }); ``` @@ -715,14 +715,14 @@ 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) @@ -776,7 +776,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 @@ -812,4 +812,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. - From d11eaba9b8b83a7ce469593978f5ca40798d7a71 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 19:14:44 -0800 Subject: [PATCH 35/67] placeholder_text option --- README.md | 2 ++ dist/gridstack.css | 1 + dist/gridstack.js | 3 ++- dist/gridstack.min.css | 2 +- dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- src/gridstack.js | 3 ++- src/gridstack.scss | 23 ++++++++++++----------- 8 files changed, 22 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 7f98f0d..a3ef2ce 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,7 @@ $(function () { - `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. You need also update your css file (`@media (max-width: 768px) {...}`) with corresponding value (default: `768`) - `placeholder_class` - class for placeholder (default: `'grid-stack-placeholder'`) +- `placeholder_text` - 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`) @@ -735,6 +736,7 @@ Changes - 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) #### v0.2.3 (2015-06-23) diff --git a/dist/gridstack.css b/dist/gridstack.css index 26dabcf..70ec399 100644 --- a/dist/gridstack.css +++ b/dist/gridstack.css @@ -16,6 +16,7 @@ bottom: 0; width: auto; z-index: 0 !important; + text-align: center; } .grid-stack > .grid-stack-item { diff --git a/dist/gridstack.js b/dist/gridstack.js index 7a7c4ec..430db2d 100755 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -400,6 +400,7 @@ height: parseInt(this.container.attr('data-gs-height')) || 0, item_class: 'grid-stack-item', placeholder_class: 'grid-stack-placeholder', + placeholder_text: '', handle: '.grid-stack-item-content', handle_class: null, cell_height: 60, @@ -470,7 +471,7 @@ this.placeholder = $( '
' + - '
').hide(); + '
' + this.opts.placeholder_text + '
').hide(); this.container.height( this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - diff --git a/dist/gridstack.min.css b/dist/gridstack.min.css index 9083dd1..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 #d3d3d3;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.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 +: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 8e17af1..2170403 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!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){a.stopPropagation()}var d=window,e={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},f=0,g=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._update_counter=0,this._float=this["float"]};g.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},g.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},g.prototype._fix_collisions=function(a){this._sort_nodes(-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 f=b.find(this.nodes,b.bind(function(b){return b!=a&&e.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},g.prototype.is_area_empty=function(a,c,d,f){var g={x:a||0,y:c||0,width:d||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return e.is_intercepted(a,g)},this));return null==h},g.prototype._sort_nodes=function(a){this.nodes=e.sort(this.nodes,a,this.width)},g.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var d=a.y;d>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f||(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,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=d,a.y=d}},this))},g.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},g.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},g.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},g.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},g.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++f,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var d=c%this.width,g=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,function(b){return e.is_intercepted({x:d,y:g,width:a.width,height:a.height},b)}))){a.x=d,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},g.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},g.prototype.can_move_node=function(c,d,e,f,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,f,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},g.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},g.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},g.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},g.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},g.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var h=function(c,d){var e,f=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 g(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))}),f._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){f._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
').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(f._is_one_column_mode()){if(e)return;e=!0,f.grid._sort_nodes(),b.each(f.grid.nodes,function(a){f.container.append(a.el),f.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,f.opts.static_grid)return;b.each(f.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return h.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},h.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=e.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},h.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&e.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)e.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},h.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)},h.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},h.prototype._prepare_element=function(c){var d=this;c=a(c),c.addClass(this.opts.item_class);var f=d.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:e.toBool(c.attr("data-gs-auto-position")),no_resize:e.toBool(c.attr("data-gs-no-resize")),no_move:e.toBool(c.attr("data-gs-no-move")),locked:e.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!d.opts.static_grid){var g,h,i=function(a,b){var c,e,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),e=Math.round(b.size.height/h)),d.grid.can_move_node(f,i,j,c,e)&&(d.grid.move_node(f,i,j,c,e),d._update_container_height())},j=function(b,e){d.container.append(d.placeholder);var i=a(this);d.grid.clean_nodes(),d.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=d.opts.cell_height+d.opts.vertical_margin,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(),f.el=d.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",d.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var e=a(this);f.el=e,d.placeholder.hide(),e.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),d._update_container_height(),d._trigger_change_event(),d.grid.end_update();var g=e.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),e.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null})).on("dragstart",j).on("dragstop",k).on("drag",i).resizable(b.extend(this.opts.resizable,{})).on("resizestart",j).on("resizestop",k).on("resize",i),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},h.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},h.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},h.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},h.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},h.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),e.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},h.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},h.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},h.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},h.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},h.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},h.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},h.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},h.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},h.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},h.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},h.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},h.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},h.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},h.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},h.prototype.batch_update=function(){this.grid.batch_update()},h.prototype.commit=function(){this.grid.commit(),this._update_container_height()},h.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},h.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},h.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},d.GridStackUI=h,d.GridStackUI.Utils=e,a.fn.gridstack=function(b){return this.each(function(){var d=a(this);d.data("gridstack")||d.data("gridstack",new h(this,b)).on("dragstart",c).on("dragstop",c).on("drag",c).on("resizestart",c).on("resizestop",c).on("resize",c).on("change",c)})},d.GridStackUI}); +!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){a.stopPropagation()}var d=window,e={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},f=0,g=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._update_counter=0,this._float=this["float"]};g.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},g.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},g.prototype._fix_collisions=function(a){this._sort_nodes(-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 f=b.find(this.nodes,b.bind(function(b){return b!=a&&e.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},g.prototype.is_area_empty=function(a,c,d,f){var g={x:a||0,y:c||0,width:d||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return e.is_intercepted(a,g)},this));return null==h},g.prototype._sort_nodes=function(a){this.nodes=e.sort(this.nodes,a,this.width)},g.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var d=a.y;d>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f||(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,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=d,a.y=d}},this))},g.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},g.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},g.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},g.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},g.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++f,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var d=c%this.width,g=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,function(b){return e.is_intercepted({x:d,y:g,width:a.width,height:a.height},b)}))){a.x=d,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},g.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},g.prototype.can_move_node=function(c,d,e,f,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,f,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},g.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},g.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},g.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},g.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},g.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var h=function(c,d){var e,f=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 g(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))}),f._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){f._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").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(f._is_one_column_mode()){if(e)return;e=!0,f.grid._sort_nodes(),b.each(f.grid.nodes,function(a){f.container.append(a.el),f.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,f.opts.static_grid)return;b.each(f.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return h.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},h.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=e.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},h.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&e.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)e.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},h.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)},h.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},h.prototype._prepare_element=function(c){var d=this;c=a(c),c.addClass(this.opts.item_class);var f=d.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:e.toBool(c.attr("data-gs-auto-position")),no_resize:e.toBool(c.attr("data-gs-no-resize")),no_move:e.toBool(c.attr("data-gs-no-move")),locked:e.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!d.opts.static_grid){var g,h,i=function(a,b){var c,e,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),e=Math.round(b.size.height/h)),d.grid.can_move_node(f,i,j,c,e)&&(d.grid.move_node(f,i,j,c,e),d._update_container_height())},j=function(b,e){d.container.append(d.placeholder);var i=a(this);d.grid.clean_nodes(),d.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=d.opts.cell_height+d.opts.vertical_margin,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(),f.el=d.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",d.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var e=a(this);f.el=e,d.placeholder.hide(),e.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),d._update_container_height(),d._trigger_change_event(),d.grid.end_update();var g=e.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),e.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null})).on("dragstart",j).on("dragstop",k).on("drag",i).resizable(b.extend(this.opts.resizable,{})).on("resizestart",j).on("resizestop",k).on("resize",i),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},h.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},h.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},h.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},h.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},h.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),e.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},h.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},h.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},h.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},h.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},h.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},h.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},h.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},h.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},h.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},h.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},h.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},h.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},h.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},h.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},h.prototype.batch_update=function(){this.grid.batch_update()},h.prototype.commit=function(){this.grid.commit(),this._update_container_height()},h.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},h.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},h.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},d.GridStackUI=h,d.GridStackUI.Utils=e,a.fn.gridstack=function(b){return this.each(function(){var d=a(this);d.data("gridstack")||d.data("gridstack",new h(this,b)).on("dragstart",c).on("dragstop",c).on("drag",c).on("resizestart",c).on("resizestop",c).on("resize",c).on("change",c)})},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 9c293b7..c2996bc 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","event_stop_propagate","event","stopPropagation","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","bind","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","drag_or_resize","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","on","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAA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AGhD2G,EAAUhE,UAAU2K,WAAa,SAASC,GACtC/K,KAAKqE,KAAKgB,YAAe0F,KAAiB,EAC1C/K,KAAKkG,qBAGT/B,EAAUhE,UAAU+F,kBAAoB,WACpC,GAAI8E,GAAoB,mBAEpBhL,MAAKqE,KAAKgB,eAAgB,EAC1BrF,KAAKwE,UAAUyB,SAAS+E,GAExBhL,KAAKwE,UAAU6E,YAAY2B,IAInCjO,EAAMkO,YAAc9G,EAEpBpH,EAAMkO,YAAYhO,MAAQA,EAK1BN,EAAEuO,GAAGC,UAAY,SAAS9G,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAIwH,GAAI/L,EAAEqD,KACL0I,GAAEV,KAAK,cACRU,EACKV,KAAK,YAAa,GAAI7D,GAAUnE,KAAMqE,IACtC8E,GAAG,YAAavM,GAChBuM,GAAG,WAAYvM,GACfuM,GAAG,OAAQvM,GACXuM,GAAG,cAAevM,GAClBuM,GAAG,aAAcvM,GACjBuM,GAAG,SAAUvM,GACbuM,GAAG,SAAUvM,MAKvBG,EAAMkO","file":"gridstack.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","event_stop_propagate","event","stopPropagation","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","bind","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","placeholder_text","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","drag_or_resize","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","on","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,IAErB,SAASC,EAAGD,GAk9BX,QAASE,GAAqBC,GAC1BA,EAAMC,kBAj9BV,GAAIC,GAAQC,OAERC,GACAC,eAAgB,SAASC,EAAGC,GACxB,QAASD,EAAEE,EAAIF,EAAEG,OAASF,EAAEC,GAAKD,EAAEC,EAAID,EAAEE,OAASH,EAAEE,GAAKF,EAAEI,EAAIJ,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AAU8E,YAAY2B,IAInClO,EAAMmO,YAAc/G,EAEpBpH,EAAMmO,YAAYjO,MAAQA,EAK1BN,EAAEwO,GAAGC,UAAY,SAAS/G,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAIyH,GAAIhM,EAAEqD,KACL2I,GAAEV,KAAK,cACRU,EACKV,KAAK,YAAa,GAAI9D,GAAUnE,KAAMqE,IACtC+E,GAAG,YAAaxM,GAChBwM,GAAG,WAAYxM,GACfwM,GAAG,OAAQxM,GACXwM,GAAG,cAAexM,GAClBwM,GAAG,aAAcxM,GACjBwM,GAAG,SAAUxM,GACbwM,GAAG,SAAUxM,MAKvBG,EAAMmO","file":"gridstack.min.js"} \ No newline at end of file diff --git a/src/gridstack.js b/src/gridstack.js index 7a7c4ec..430db2d 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -400,6 +400,7 @@ height: parseInt(this.container.attr('data-gs-height')) || 0, item_class: 'grid-stack-item', placeholder_class: 'grid-stack-placeholder', + placeholder_text: '', handle: '.grid-stack-item-content', handle_class: null, cell_height: 60, @@ -470,7 +471,7 @@ this.placeholder = $( '
' + - '
').hide(); + '
' + this.opts.placeholder_text + '
').hide(); this.container.height( this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - diff --git a/src/gridstack.scss b/src/gridstack.scss index 4a52c55..46fa37a 100644 --- a/src/gridstack.scss +++ b/src/gridstack.scss @@ -26,6 +26,7 @@ $animation_speed: .3s !default; bottom: 0; width: auto; z-index: 0 !important; + text-align: center; } > .grid-stack-item { @@ -53,21 +54,21 @@ $animation_speed: .3s !default; -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,15 +82,15 @@ $animation_speed: .3s !default; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - + &::before { content: "\f065"; } } - + > .ui-resizable-se { display: inline-block; @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; } @@ -98,7 +99,7 @@ $animation_speed: .3s !default; > .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; } @@ -106,8 +107,8 @@ $animation_speed: .3s !default; &[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); } @@ -134,7 +135,7 @@ $animation_speed: .3s !default; left: 0 !important; top: auto !important; margin-bottom: $vertical_padding; - + .ui-resizable-handle { display: none; } } From c90730516e65e30e0f45e13d759e0493398b16b3 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 19:21:52 -0800 Subject: [PATCH 36/67] update copyright --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3ef2ce..887aaa9 100644 --- a/README.md +++ b/README.md @@ -795,7 +795,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 From d42b8c79e4cc17674d1a1e9f73b37dfbc7b5337b Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 19:38:52 -0800 Subject: [PATCH 37/67] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 8ebb3f74b45074c851043537a4e2213c3031b60c Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 10 Feb 2016 23:16:33 -0800 Subject: [PATCH 38/67] build js --- dist/gridstack.js | 9 +++++++++ dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dist/gridstack.js b/dist/gridstack.js index 430db2d..b187f06 100755 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -747,6 +747,15 @@ return el; }; + GridStack.prototype.make_widget = function(el) { + el = $(el); + this._prepare_element(el); + this._update_container_height(); + this._trigger_change_event(true); + + return el; + }; + GridStack.prototype.will_it_fit = function(x, y, width, height, auto_position) { 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); diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index 2170403..1f63dc1 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!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){a.stopPropagation()}var d=window,e={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},f=0,g=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._update_counter=0,this._float=this["float"]};g.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},g.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},g.prototype._fix_collisions=function(a){this._sort_nodes(-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 f=b.find(this.nodes,b.bind(function(b){return b!=a&&e.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},g.prototype.is_area_empty=function(a,c,d,f){var g={x:a||0,y:c||0,width:d||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return e.is_intercepted(a,g)},this));return null==h},g.prototype._sort_nodes=function(a){this.nodes=e.sort(this.nodes,a,this.width)},g.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var d=a.y;d>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f||(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,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=d,a.y=d}},this))},g.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},g.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},g.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},g.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},g.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++f,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var d=c%this.width,g=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,function(b){return e.is_intercepted({x:d,y:g,width:a.width,height:a.height},b)}))){a.x=d,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},g.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},g.prototype.can_move_node=function(c,d,e,f,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,f,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},g.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},g.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},g.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},g.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},g.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var h=function(c,d){var e,f=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 g(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))}),f._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){f._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").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(f._is_one_column_mode()){if(e)return;e=!0,f.grid._sort_nodes(),b.each(f.grid.nodes,function(a){f.container.append(a.el),f.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,f.opts.static_grid)return;b.each(f.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return h.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},h.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=e.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},h.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&e.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)e.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},h.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)},h.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},h.prototype._prepare_element=function(c){var d=this;c=a(c),c.addClass(this.opts.item_class);var f=d.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:e.toBool(c.attr("data-gs-auto-position")),no_resize:e.toBool(c.attr("data-gs-no-resize")),no_move:e.toBool(c.attr("data-gs-no-move")),locked:e.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!d.opts.static_grid){var g,h,i=function(a,b){var c,e,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),e=Math.round(b.size.height/h)),d.grid.can_move_node(f,i,j,c,e)&&(d.grid.move_node(f,i,j,c,e),d._update_container_height())},j=function(b,e){d.container.append(d.placeholder);var i=a(this);d.grid.clean_nodes(),d.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=d.opts.cell_height+d.opts.vertical_margin,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(),f.el=d.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",d.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var e=a(this);f.el=e,d.placeholder.hide(),e.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),d._update_container_height(),d._trigger_change_event(),d.grid.end_update();var g=e.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),e.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null})).on("dragstart",j).on("dragstop",k).on("drag",i).resizable(b.extend(this.opts.resizable,{})).on("resizestart",j).on("resizestop",k).on("resize",i),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},h.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},h.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},h.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},h.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},h.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),e.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},h.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},h.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},h.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},h.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},h.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},h.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},h.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},h.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},h.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},h.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},h.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},h.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},h.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},h.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},h.prototype.batch_update=function(){this.grid.batch_update()},h.prototype.commit=function(){this.grid.commit(),this._update_container_height()},h.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},h.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},h.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},d.GridStackUI=h,d.GridStackUI.Utils=e,a.fn.gridstack=function(b){return this.each(function(){var d=a(this);d.data("gridstack")||d.data("gridstack",new h(this,b)).on("dragstart",c).on("dragstop",c).on("drag",c).on("resizestart",c).on("resizestop",c).on("resize",c).on("change",c)})},d.GridStackUI}); +!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){a.stopPropagation()}var d=window,e={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},f=0,g=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._update_counter=0,this._float=this["float"]};g.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},g.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},g.prototype._fix_collisions=function(a){this._sort_nodes(-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 f=b.find(this.nodes,b.bind(function(b){return b!=a&&e.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},g.prototype.is_area_empty=function(a,c,d,f){var g={x:a||0,y:c||0,width:d||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return e.is_intercepted(a,g)},this));return null==h},g.prototype._sort_nodes=function(a){this.nodes=e.sort(this.nodes,a,this.width)},g.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var d=a.y;d>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f||(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,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=d,a.y=d}},this))},g.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},g.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},g.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},g.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},g.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++f,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var d=c%this.width,g=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,function(b){return e.is_intercepted({x:d,y:g,width:a.width,height:a.height},b)}))){a.x=d,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},g.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},g.prototype.can_move_node=function(c,d,e,f,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,f,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},g.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},g.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},g.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},g.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},g.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var h=function(c,d){var e,f=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 g(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))}),f._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){f._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").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(f._is_one_column_mode()){if(e)return;e=!0,f.grid._sort_nodes(),b.each(f.grid.nodes,function(a){f.container.append(a.el),f.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,f.opts.static_grid)return;b.each(f.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return h.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},h.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=e.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},h.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&e.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)e.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},h.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)},h.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},h.prototype._prepare_element=function(c){var d=this;c=a(c),c.addClass(this.opts.item_class);var f=d.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:e.toBool(c.attr("data-gs-auto-position")),no_resize:e.toBool(c.attr("data-gs-no-resize")),no_move:e.toBool(c.attr("data-gs-no-move")),locked:e.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!d.opts.static_grid){var g,h,i=function(a,b){var c,e,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),e=Math.round(b.size.height/h)),d.grid.can_move_node(f,i,j,c,e)&&(d.grid.move_node(f,i,j,c,e),d._update_container_height())},j=function(b,e){d.container.append(d.placeholder);var i=a(this);d.grid.clean_nodes(),d.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=d.opts.cell_height+d.opts.vertical_margin,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(),f.el=d.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",d.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var e=a(this);f.el=e,d.placeholder.hide(),e.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),d._update_container_height(),d._trigger_change_event(),d.grid.end_update();var g=e.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),e.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null})).on("dragstart",j).on("dragstop",k).on("drag",i).resizable(b.extend(this.opts.resizable,{})).on("resizestart",j).on("resizestop",k).on("resize",i),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},h.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},h.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.make_widget=function(b){return b=a(b),this._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},h.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},h.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},h.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),e.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},h.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},h.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},h.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},h.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},h.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},h.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},h.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},h.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},h.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},h.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},h.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},h.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},h.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},h.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},h.prototype.batch_update=function(){this.grid.batch_update()},h.prototype.commit=function(){this.grid.commit(),this._update_container_height()},h.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},h.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},h.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},d.GridStackUI=h,d.GridStackUI.Utils=e,a.fn.gridstack=function(b){return this.each(function(){var d=a(this);d.data("gridstack")||d.data("gridstack",new h(this,b)).on("dragstart",c).on("dragstop",c).on("drag",c).on("resizestart",c).on("resizestop",c).on("resize",c).on("change",c)})},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 c2996bc..e3270cb 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","event_stop_propagate","event","stopPropagation","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","bind","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","placeholder_text","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","drag_or_resize","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","on","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","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OA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AGD,EAAOE,IAGhD2G,EAAUhE,UAAU4K,WAAa,SAASC,GACtChL,KAAKqE,KAAKiB,YAAe0F,KAAiB,EAC1ChL,KAAKmG,qBAGThC,EAAUhE,UAAUgG,kBAAoB,WACpC,GAAI8E,GAAoB,mBAEpBjL,MAAKqE,KAAKiB,eAAgB,EAC1BtF,KAAKwE,UAAU0B,SAAS+E,GAExBjL,KAAKwE,UAAU8E,YAAY2B,IAInClO,EAAMmO,YAAc/G,EAEpBpH,EAAMmO,YAAYjO,MAAQA,EAK1BN,EAAEwO,GAAGC,UAAY,SAAS/G,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAIyH,GAAIhM,EAAEqD,KACL2I,GAAEV,KAAK,cACRU,EACKV,KAAK,YAAa,GAAI9D,GAAUnE,KAAMqE,IACtC+E,GAAG,YAAaxM,GAChBwM,GAAG,WAAYxM,GACfwM,GAAG,OAAQxM,GACXwM,GAAG,cAAexM,GAClBwM,GAAG,aAAcxM,GACjBwM,GAAG,SAAUxM,GACbwM,GAAG,SAAUxM,MAKvBG,EAAMmO","file":"gridstack.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","event_stop_propagate","event","stopPropagation","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","bind","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","placeholder_text","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","drag_or_resize","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","on","enable","removeClass","add_widget","make_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","val","movable","isNaN","_update_element","callback","first","move","update","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,IAErB,SAASC,EAAGD,GA29BX,QAASE,GAAqBC,GAC1BA,EAAMC,kBA19BV,GAAIC,GAAQC,OAERC,GACAC,eAAgB,SAASC,EAAGC,GACxB,QAASD,EAAEE,EAAIF,EAAEG,OAASF,EAAEC,GAAKD,EAAEC,EAAID,EAAEE,OAASH,EAAEE,GAAKF,E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B,EAC1CjL,KAAKmG,qBAGThC,EAAUhE,UAAUgG,kBAAoB,WACpC,GAAI+E,GAAoB,mBAEpBlL,MAAKqE,KAAKiB,eAAgB,EAC1BtF,KAAKwE,UAAU0B,SAASgF,GAExBlL,KAAKwE,UAAU8E,YAAY4B,IAInCnO,EAAMoO,YAAchH,EAEpBpH,EAAMoO,YAAYlO,MAAQA,EAK1BN,EAAEyO,GAAGC,UAAY,SAAShH,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAIyH,GAAIhM,EAAEqD,KACL2I,GAAEV,KAAK,cACRU,EACKV,KAAK,YAAa,GAAI9D,GAAUnE,KAAMqE,IACtC+E,GAAG,YAAaxM,GAChBwM,GAAG,WAAYxM,GACfwM,GAAG,OAAQxM,GACXwM,GAAG,cAAexM,GAClBwM,GAAG,aAAcxM,GACjBwM,GAAG,SAAUxM,GACbwM,GAAG,SAAUxM,MAKvBG,EAAMoO","file":"gridstack.min.js"} \ No newline at end of file From acc2acbec1a2839656bd1a04a30ab8b219dc1df5 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Fri, 12 Feb 2016 16:07:49 -0800 Subject: [PATCH 39/67] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cb3ec4d..9044c65 100644 --- a/README.md +++ b/README.md @@ -755,6 +755,7 @@ Changes - add `min_width`/`min_height` methods (Thanks to @cvillemure) - add `destroy` method (Thanks to @zspitzer) - add `placeholder_text` option (Thanks to @slauyama) +- lodash v 4.x support (Thanks to Andy Robbins) #### v0.2.3 (2015-06-23) From 8b1f180135a12dd61766155af0c3d8956c6ef0f8 Mon Sep 17 00:00:00 2001 From: Dylan Weiss Date: Sat, 13 Feb 2016 17:26:02 -0500 Subject: [PATCH 40/67] Include resizable, draggable opts in all listeners for resizable, draggable, respectively. Fixes issue particularly when passing handle to draggable - was listening to everything on el rather than this.opts.draggable.handle. --- src/gridstack.js | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index b187f06..3f90981 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -702,15 +702,16 @@ el .draggable(_.extend(this.opts.draggable, { - containment: this.opts.is_nested ? this.container.parent() : null + containment: this.opts.is_nested ? this.container.parent() : null, + start: on_start_moving, + stop: on_end_moving, + drag: drag_or_resize })) - .on('dragstart', on_start_moving) - .on('dragstop', on_end_moving) - .on('drag', drag_or_resize) - .resizable(_.extend(this.opts.resizable, {})) - .on('resizestart', on_start_moving) - .on('resizestop', on_end_moving) - .on('resize', drag_or_resize); + .resizable(_.extend(this.opts.resizable, { + resizestart: on_start_moving, + resizestop: on_end_moving, + resize: drag_or_resize + })); if (node.no_move || this._is_one_column_mode()) { el.draggable('disable'); @@ -1003,22 +1004,12 @@ scope.GridStackUI.Utils = Utils; - function event_stop_propagate(event) { - event.stopPropagation(); - } $.fn.gridstack = function(opts) { return this.each(function() { var o = $(this); if (!o.data('gridstack')) { o - .data('gridstack', new GridStack(this, opts)) - .on('dragstart', event_stop_propagate) - .on('dragstop', event_stop_propagate) - .on('drag', event_stop_propagate) - .on('resizestart', event_stop_propagate) - .on('resizestop', event_stop_propagate) - .on('resize', event_stop_propagate) - .on('change', event_stop_propagate); + .data('gridstack', new GridStack(this, opts)); } }); }; From ca594a6ba2078e0bf2dfec978ee3255c0a61c76a Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Sat, 13 Feb 2016 14:42:09 -0800 Subject: [PATCH 41/67] build js --- dist/gridstack.js | 29 ++++++++++------------------- dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/dist/gridstack.js b/dist/gridstack.js index b187f06..3f90981 100755 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -702,15 +702,16 @@ el .draggable(_.extend(this.opts.draggable, { - containment: this.opts.is_nested ? this.container.parent() : null + containment: this.opts.is_nested ? this.container.parent() : null, + start: on_start_moving, + stop: on_end_moving, + drag: drag_or_resize })) - .on('dragstart', on_start_moving) - .on('dragstop', on_end_moving) - .on('drag', drag_or_resize) - .resizable(_.extend(this.opts.resizable, {})) - .on('resizestart', on_start_moving) - .on('resizestop', on_end_moving) - .on('resize', drag_or_resize); + .resizable(_.extend(this.opts.resizable, { + resizestart: on_start_moving, + resizestop: on_end_moving, + resize: drag_or_resize + })); if (node.no_move || this._is_one_column_mode()) { el.draggable('disable'); @@ -1003,22 +1004,12 @@ scope.GridStackUI.Utils = Utils; - function event_stop_propagate(event) { - event.stopPropagation(); - } $.fn.gridstack = function(opts) { return this.each(function() { var o = $(this); if (!o.data('gridstack')) { o - .data('gridstack', new GridStack(this, opts)) - .on('dragstart', event_stop_propagate) - .on('dragstop', event_stop_propagate) - .on('drag', event_stop_propagate) - .on('resizestart', event_stop_propagate) - .on('resizestop', event_stop_propagate) - .on('resize', event_stop_propagate) - .on('change', event_stop_propagate); + .data('gridstack', new GridStack(this, opts)); } }); }; diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index 1f63dc1..51ffb12 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!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){a.stopPropagation()}var d=window,e={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},f=0,g=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._update_counter=0,this._float=this["float"]};g.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},g.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},g.prototype._fix_collisions=function(a){this._sort_nodes(-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 f=b.find(this.nodes,b.bind(function(b){return b!=a&&e.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},g.prototype.is_area_empty=function(a,c,d,f){var g={x:a||0,y:c||0,width:d||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return e.is_intercepted(a,g)},this));return null==h},g.prototype._sort_nodes=function(a){this.nodes=e.sort(this.nodes,a,this.width)},g.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var d=a.y;d>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f||(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,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=d,a.y=d}},this))},g.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},g.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},g.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},g.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},g.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++f,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var d=c%this.width,g=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,function(b){return e.is_intercepted({x:d,y:g,width:a.width,height:a.height},b)}))){a.x=d,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},g.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},g.prototype.can_move_node=function(c,d,e,f,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,f,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},g.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},g.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},g.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},g.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},g.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var h=function(c,d){var e,f=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 g(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))}),f._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){f._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").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(f._is_one_column_mode()){if(e)return;e=!0,f.grid._sort_nodes(),b.each(f.grid.nodes,function(a){f.container.append(a.el),f.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,f.opts.static_grid)return;b.each(f.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return h.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},h.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=e.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},h.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&e.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)e.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),e.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},h.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)},h.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},h.prototype._prepare_element=function(c){var d=this;c=a(c),c.addClass(this.opts.item_class);var f=d.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:e.toBool(c.attr("data-gs-auto-position")),no_resize:e.toBool(c.attr("data-gs-no-resize")),no_move:e.toBool(c.attr("data-gs-no-move")),locked:e.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!d.opts.static_grid){var g,h,i=function(a,b){var c,e,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),e=Math.round(b.size.height/h)),d.grid.can_move_node(f,i,j,c,e)&&(d.grid.move_node(f,i,j,c,e),d._update_container_height())},j=function(b,e){d.container.append(d.placeholder);var i=a(this);d.grid.clean_nodes(),d.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=d.opts.cell_height+d.opts.vertical_margin,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(),f.el=d.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",d.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var e=a(this);f.el=e,d.placeholder.hide(),e.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),d._update_container_height(),d._trigger_change_event(),d.grid.end_update();var g=e.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),e.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null})).on("dragstart",j).on("dragstop",k).on("drag",i).resizable(b.extend(this.opts.resizable,{})).on("resizestart",j).on("resizestop",k).on("resize",i),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},h.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},h.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.make_widget=function(b){return b=a(b),this._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},h.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},h.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},h.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),e.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},h.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},h.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},h.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},h.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},h.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},h.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},h.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},h.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},h.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},h.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},h.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},h.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},h.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},h.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},h.prototype.batch_update=function(){this.grid.batch_update()},h.prototype.commit=function(){this.grid.commit(),this._update_container_height()},h.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},h.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},h.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},d.GridStackUI=h,d.GridStackUI.Utils=e,a.fn.gridstack=function(b){return this.each(function(){var d=a(this);d.data("gridstack")||d.data("gridstack",new h(this,b)).on("dragstart",c).on("dragstop",c).on("drag",c).on("resizestart",c).on("resizestop",c).on("resize",c).on("change",c)})},d.GridStackUI}); +!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){var c=window,d={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},e=0,f=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._update_counter=0,this._float=this["float"]};f.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},f.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},f.prototype._fix_collisions=function(a){this._sort_nodes(-1);var c=a,e=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||e||(c={x:0,y:a.y,width:this.width,height:a.height});;){var f=b.find(this.nodes,b.bind(function(b){return b!=a&&d.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},f.prototype.is_area_empty=function(a,c,e,f){var g={x:a||0,y:c||0,width:e||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return d.is_intercepted(a,g)},this));return null==h},f.prototype._sort_nodes=function(a){this.nodes=d.sort(this.nodes,a,this.width)},f.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var e=a.y;e>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f||(a._dirty=!0,a.y=e),--e}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var e=a.y-1,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=e,a.y=e}},this))},f.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},f.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},f.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},f.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},f.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++e,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var f=c%this.width,g=Math.floor(c/this.width);if(!(f+a.width>this.width||b.find(this.nodes,function(b){return d.is_intercepted({x:f,y:g,width:a.width,height:a.height},b)}))){a.x=f,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},f.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},f.prototype.can_move_node=function(c,d,e,g,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,g,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},f.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},f.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},f.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},f.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},f.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var g=function(c,d){var e,g=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 f(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._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){g._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").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(g._is_one_column_mode()){if(e)return;e=!0,g.grid._sort_nodes(),b.each(g.grid.nodes,function(a){g.container.append(a.el),g.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,g.opts.static_grid)return;b.each(g.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return g.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},g.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=d.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},g.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&d.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)d.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},g.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)},g.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},g.prototype._prepare_element=function(c){var e=this;c=a(c),c.addClass(this.opts.item_class);var f=e.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:d.toBool(c.attr("data-gs-auto-position")),no_resize:d.toBool(c.attr("data-gs-no-resize")),no_move:d.toBool(c.attr("data-gs-no-move")),locked:d.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!e.opts.static_grid){var g,h,i=function(a,b){var c,d,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),d=Math.round(b.size.height/h)),e.grid.can_move_node(f,i,j,c,d)&&(e.grid.move_node(f,i,j,c,d),e._update_container_height())},j=function(b,d){e.container.append(e.placeholder);var i=a(this);e.grid.clean_nodes(),e.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=e.opts.cell_height+e.opts.vertical_margin,e.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(),f.el=e.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",e.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){e.placeholder.detach();var d=a(this);f.el=d,e.placeholder.hide(),d.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),e._update_container_height(),e._trigger_change_event(),e.grid.end_update();var g=d.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),d.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null,start:j,stop:k,drag:i})).resizable(b.extend(this.opts.resizable,{resizestart:j,resizestop:k,resize:i})),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},g.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},g.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.make_widget=function(b){return b=a(b),this._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},g.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},g.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},g.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),d.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},g.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},g.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},g.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},g.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},g.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},g.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},g.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},g.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},g.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},g.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},g.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},g.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},g.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},g.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},g.prototype.batch_update=function(){this.grid.batch_update()},g.prototype.commit=function(){this.grid.commit(),this._update_container_height()},g.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},g.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},g.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},c.GridStackUI=g,c.GridStackUI.Utils=d,a.fn.gridstack=function(b){return this.each(function(){var c=a(this);c.data("gridstack")||c.data("gridstack",new g(this,b))})},c.GridStackUI}); //# sourceMappingURL=gridstack.min.map \ No newline at end of file diff --git a/dist/gridstack.min.map b/dist/gridstack.min.map index e3270cb..ba24864 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","event_stop_propagate","event","stopPropagation","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","bind","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","placeholder_text","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","drag_or_resize","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","on","enable","removeClass","add_widget","make_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","val","movable","isNaN","_update_element","callback","first","move","update","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,IAErB,SAASC,EAAGD,GA29BX,QAASE,GAAqBC,GAC1BA,EAAMC,kBA19BV,GAAIC,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,GAASZ,EAAEkB,MAAMF,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,UAAU8E,YAAY4B,IAInCnO,EAAMoO,YAAchH,EAEpBpH,EAAMoO,YAAYlO,MAAQA,EAK1BN,EAAEyO,GAAGC,UAAY,SAAShH,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAIyH,GAAIhM,EAAEqD,KACL2I,GAAEV,KAAK,cACRU,EACKV,KAAK,YAAa,GAAI9D,GAAUnE,KAAMqE,IACtC+E,GAAG,YAAaxM,GAChBwM,GAAG,WAAYxM,GACfwM,GAAG,OAAQxM,GACXwM,GAAG,cAAexM,GAClBwM,GAAG,aAAcxM,GACjBwM,GAAG,SAAUxM,GACbwM,GAAG,SAAUxM,MAKvBG,EAAMoO","file":"gridstack.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","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","bind","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","placeholder_text","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","drag_or_resize","event","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","start","stop","drag","resizestart","resizestop","enable","removeClass","add_widget","make_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","val","movable","isNaN","_update_element","callback","first","move","update","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,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,S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AAK,YAAa,GAAI9D,GAAUnE,KAAMqE,OAKhDtH,EAAMyO","file":"gridstack.min.js"} \ No newline at end of file From cfb0dfc3456a8aea7e440271558b7de35d140c83 Mon Sep 17 00:00:00 2001 From: Dylan Weiss Date: Sat, 13 Feb 2016 20:48:49 -0500 Subject: [PATCH 42/67] Fixed names of options. --- src/gridstack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index 3f90981..09bfba4 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -708,8 +708,8 @@ drag: drag_or_resize })) .resizable(_.extend(this.opts.resizable, { - resizestart: on_start_moving, - resizestop: on_end_moving, + start: on_start_moving, + stop: on_end_moving, resize: drag_or_resize })); From 5ce3c17039b805db4c582a223c18d8ef4e31c9de Mon Sep 17 00:00:00 2001 From: Kevin Dietrich Date: Sun, 14 Feb 2016 10:46:49 +0100 Subject: [PATCH 43/67] build js --- dist/gridstack.js | 4 ++-- dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/gridstack.js b/dist/gridstack.js index 3f90981..09bfba4 100755 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -708,8 +708,8 @@ drag: drag_or_resize })) .resizable(_.extend(this.opts.resizable, { - resizestart: on_start_moving, - resizestop: on_end_moving, + start: on_start_moving, + stop: on_end_moving, resize: drag_or_resize })); diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index 51ffb12..eaea849 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!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){var c=window,d={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},e=0,f=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._update_counter=0,this._float=this["float"]};f.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},f.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},f.prototype._fix_collisions=function(a){this._sort_nodes(-1);var c=a,e=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||e||(c={x:0,y:a.y,width:this.width,height:a.height});;){var f=b.find(this.nodes,b.bind(function(b){return b!=a&&d.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},f.prototype.is_area_empty=function(a,c,e,f){var g={x:a||0,y:c||0,width:e||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return d.is_intercepted(a,g)},this));return null==h},f.prototype._sort_nodes=function(a){this.nodes=d.sort(this.nodes,a,this.width)},f.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var e=a.y;e>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f||(a._dirty=!0,a.y=e),--e}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var e=a.y-1,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=e,a.y=e}},this))},f.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},f.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},f.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},f.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},f.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++e,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var f=c%this.width,g=Math.floor(c/this.width);if(!(f+a.width>this.width||b.find(this.nodes,function(b){return d.is_intercepted({x:f,y:g,width:a.width,height:a.height},b)}))){a.x=f,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},f.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},f.prototype.can_move_node=function(c,d,e,g,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,g,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},f.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},f.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},f.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},f.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},f.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var g=function(c,d){var e,g=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 f(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._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){g._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").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(g._is_one_column_mode()){if(e)return;e=!0,g.grid._sort_nodes(),b.each(g.grid.nodes,function(a){g.container.append(a.el),g.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,g.opts.static_grid)return;b.each(g.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return g.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},g.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=d.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},g.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&d.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)d.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},g.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)},g.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},g.prototype._prepare_element=function(c){var e=this;c=a(c),c.addClass(this.opts.item_class);var f=e.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:d.toBool(c.attr("data-gs-auto-position")),no_resize:d.toBool(c.attr("data-gs-no-resize")),no_move:d.toBool(c.attr("data-gs-no-move")),locked:d.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!e.opts.static_grid){var g,h,i=function(a,b){var c,d,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),d=Math.round(b.size.height/h)),e.grid.can_move_node(f,i,j,c,d)&&(e.grid.move_node(f,i,j,c,d),e._update_container_height())},j=function(b,d){e.container.append(e.placeholder);var i=a(this);e.grid.clean_nodes(),e.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=e.opts.cell_height+e.opts.vertical_margin,e.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(),f.el=e.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",e.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){e.placeholder.detach();var d=a(this);f.el=d,e.placeholder.hide(),d.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),e._update_container_height(),e._trigger_change_event(),e.grid.end_update();var g=d.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),d.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null,start:j,stop:k,drag:i})).resizable(b.extend(this.opts.resizable,{resizestart:j,resizestop:k,resize:i})),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},g.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},g.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.make_widget=function(b){return b=a(b),this._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},g.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},g.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},g.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),d.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},g.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},g.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},g.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},g.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},g.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},g.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},g.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},g.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},g.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},g.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},g.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},g.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},g.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},g.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},g.prototype.batch_update=function(){this.grid.batch_update()},g.prototype.commit=function(){this.grid.commit(),this._update_container_height()},g.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},g.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},g.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},c.GridStackUI=g,c.GridStackUI.Utils=d,a.fn.gridstack=function(b){return this.each(function(){var c=a(this);c.data("gridstack")||c.data("gridstack",new g(this,b))})},c.GridStackUI}); +!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){var c=window,d={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},e=0,f=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._update_counter=0,this._float=this["float"]};f.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},f.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},f.prototype._fix_collisions=function(a){this._sort_nodes(-1);var c=a,e=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||e||(c={x:0,y:a.y,width:this.width,height:a.height});;){var f=b.find(this.nodes,b.bind(function(b){return b!=a&&d.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},f.prototype.is_area_empty=function(a,c,e,f){var g={x:a||0,y:c||0,width:e||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return d.is_intercepted(a,g)},this));return null==h},f.prototype._sort_nodes=function(a){this.nodes=d.sort(this.nodes,a,this.width)},f.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var e=a.y;e>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f||(a._dirty=!0,a.y=e),--e}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var e=a.y-1,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=e,a.y=e}},this))},f.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},f.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},f.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},f.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},f.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++e,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var f=c%this.width,g=Math.floor(c/this.width);if(!(f+a.width>this.width||b.find(this.nodes,function(b){return d.is_intercepted({x:f,y:g,width:a.width,height:a.height},b)}))){a.x=f,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},f.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},f.prototype.can_move_node=function(c,d,e,g,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,g,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},f.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},f.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},f.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},f.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},f.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var g=function(c,d){var e,g=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 f(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._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){g._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").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(g._is_one_column_mode()){if(e)return;e=!0,g.grid._sort_nodes(),b.each(g.grid.nodes,function(a){g.container.append(a.el),g.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,g.opts.static_grid)return;b.each(g.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return g.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},g.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=d.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},g.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&d.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)d.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},g.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)},g.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},g.prototype._prepare_element=function(c){var e=this;c=a(c),c.addClass(this.opts.item_class);var f=e.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:d.toBool(c.attr("data-gs-auto-position")),no_resize:d.toBool(c.attr("data-gs-no-resize")),no_move:d.toBool(c.attr("data-gs-no-move")),locked:d.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!e.opts.static_grid){var g,h,i=function(a,b){var c,d,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),d=Math.round(b.size.height/h)),e.grid.can_move_node(f,i,j,c,d)&&(e.grid.move_node(f,i,j,c,d),e._update_container_height())},j=function(b,d){e.container.append(e.placeholder);var i=a(this);e.grid.clean_nodes(),e.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=e.opts.cell_height+e.opts.vertical_margin,e.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(),f.el=e.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",e.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){e.placeholder.detach();var d=a(this);f.el=d,e.placeholder.hide(),d.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),e._update_container_height(),e._trigger_change_event(),e.grid.end_update();var g=d.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),d.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null,start:j,stop:k,drag:i})).resizable(b.extend(this.opts.resizable,{start:j,stop:k,resize:i})),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},g.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},g.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.make_widget=function(b){return b=a(b),this._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},g.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},g.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},g.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),d.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},g.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},g.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},g.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},g.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},g.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},g.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},g.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},g.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},g.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},g.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},g.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},g.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},g.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},g.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},g.prototype.batch_update=function(){this.grid.batch_update()},g.prototype.commit=function(){this.grid.commit(),this._update_container_height()},g.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},g.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},g.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},c.GridStackUI=g,c.GridStackUI.Utils=d,a.fn.gridstack=function(b){return this.each(function(){var c=a(this);c.data("gridstack")||c.data("gridstack",new g(this,b))})},c.GridStackUI}); //# sourceMappingURL=gridstack.min.map \ No newline at end of file diff --git a/dist/gridstack.min.map b/dist/gridstack.min.map index ba24864..43959d0 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","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","bind","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","placeholder_text","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","drag_or_resize","event","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","start","stop","drag","resizestart","resizestop","enable","removeClass","add_widget","make_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","val","movable","isNaN","_update_element","callback","first","move","update","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,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,E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B,EAC1BtF,KAAKwE,UAAU0B,SAASqF,GAExBvL,KAAKwE,UAAUmF,YAAY4B,IAInCxO,EAAMyO,YAAcrH,EAEpBpH,EAAMyO,YAAYvO,MAAQA,EAE1BH,EAAE2O,GAAGC,UAAY,SAASrH,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAI0H,GAAI9L,EAAEkD,KACL4I,GAAEX,KAAK,cACRW,EACKX,KAAK,YAAa,GAAI9D,GAAUnE,KAAMqE,OAKhDtH,EAAMyO","file":"gridstack.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","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","bind","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","placeholder_text","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","drag_or_resize","event","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","start","stop","drag","enable","removeClass","add_widget","make_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","val","movable","isNaN","_update_element","callback","first","move","update","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,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,QAU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036571 Mon Sep 17 00:00:00 2001 From: Kevin Dietrich Date: Sun, 14 Feb 2016 10:47:20 +0100 Subject: [PATCH 44/67] Added grunt-doctoc --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 62f5d43..b9f8703 100755 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "grunt-contrib-copy": "^0.8.2", "grunt-contrib-cssmin": "^0.14.0", "grunt-contrib-uglify": "^0.10.1", - "grunt-sass": "^1.1.0" + "grunt-sass": "^1.1.0", + "grunt-doctoc": "^0.1.1" } } From 01e213a8e5e8ff0faaa67076452cf99d8b45eb3e Mon Sep 17 00:00:00 2001 From: Kevin Dietrich Date: Sun, 14 Feb 2016 11:31:38 +0100 Subject: [PATCH 45/67] Changed version to dev --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 4428d53..feb06c3 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "0.2.3", + "version": "0.2.4-dev", "homepage": "https://github.com/troolee/gridstack.js", "authors": [ "Pavel Reznikov " diff --git a/package.json b/package.json index b9f8703..55be5c9 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "0.2.3", + "version": "0.2.4-dev", "description": "gridstack.js is a jQuery plugin for widget layout", "main": "dist/gridstack.js", "repository": { From ef9328fdab9d6a69d26ae4a4119eeb5660b4ee32 Mon Sep 17 00:00:00 2001 From: Jerome Louis Date: Thu, 19 Nov 2015 17:41:46 +0100 Subject: [PATCH 46/67] Add handling of em/rem/px units for cell_height and vertical_margin, as well as no height option/full CSS heights --- README.md | 22 ++++-- src/gridstack.js | 187 +++++++++++++++++++++++++++++++++-------------- 2 files changed, 146 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 9044c65..8192f75 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Note: You can still use [underscore.js](http://underscorejs.org) (>= 1.7.0) inst ## Basic usage -```html +```
@@ -525,7 +531,7 @@ $(function () { and HTML: -```html +```
``` @@ -590,7 +596,7 @@ and so on. Here is a SASS code snipped which can make life easier (Thanks to @ascendantofrain, [#81](https://github.com/troolee/gridstack.js/issues/81)): -```sass +``` .grid-stack-item { $gridstack-columns: 12; @@ -614,7 +620,7 @@ There are few extra CSS batteries in `gridstack-extra.css` (`gridstack-extra.min You can use other than 12 grid width: -```html +```
...
``` ```javascript @@ -700,7 +706,7 @@ CSS stylesheet dynamically. As a workaround you can do the following: - Create `gridstack-ie8.css` for your configuration (sample for grid with cell height of 60px can be found [here](https://gist.github.com/troolee/6edfea5857f4cd73e6f1)). - Include this CSS: -```html +``` diff --git a/src/gridstack.js b/src/gridstack.js index 09bfba4..71e56b5 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -424,6 +424,9 @@ }); this.opts.is_nested = is_nested; + this.cell_height(this.opts.cell_height, true); + this.vertical_margin(this.opts.vertical_margin, true); + this.container.addClass(this.opts._class); this._set_static_class(); @@ -473,9 +476,7 @@ '
' + '
' + this.opts.placeholder_text + '
').hide(); - this.container.height( - this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - - this.opts.vertical_margin); + this._update_container_height(); this.on_resize_handler = function() { if (self._is_one_column_mode()) { @@ -540,6 +541,9 @@ }; GridStack.prototype._init_styles = function() { + if (!this.opts.cell_height) { //that will be handled by CSS + return ; + } if (this._styles_id) { $('[data-gs-id="' + this._styles_id + '"]').remove(); } @@ -554,7 +558,10 @@ return; } - var prefix = '.' + this.opts._class + ' .' + this.opts.item_class; + var prefix = '.' + this.opts._class + ' .' + this.opts.item_class, + self = this, + get_height + ; if (typeof max_height == 'undefined') { max_height = this._styles._max; @@ -562,30 +569,50 @@ this._update_container_height(); } + if (!this.opts.cell_height) { //the rest will be handled by CSS + return ; + } + if (this._styles._max !== 0 && max_height <= this._styles._max) { + return ; + } + + if (!this.opts.vertical_margin || this.opts.cell_height_unit === this.opts.vertical_margin_unit) { + get_height = function (nbRows, nbMargins) { + return (self.opts.cell_height * nbRows + self.opts.vertical_margin * nbMargins) + self.opts.cell_height_unit; + } + } else { + get_height = function (nbRows, nbMargins) { + if (!nbRows || !nbMargins) { + return (self.opts.cell_height * nbRows + self.opts.vertical_margin * nbMargins) + self.opts.cell_height_unit; + } + return 'calc(' + ((self.opts.cell_height * nbRows) + self.opts.cell_height_unit) + ' + ' + ((self.opts.vertical_margin * nbMargins) + self.opts.vertical_margin_unit) + ')'; + } + } + if (this._styles._max == 0) { - Utils.insert_css_rule(this._styles, prefix, 'min-height: ' + (this.opts.cell_height) + 'px;', 0); + Utils.insert_css_rule(this._styles, prefix, 'min-height: ' + get_height(1, 0) + ';', 0); } if (max_height > this._styles._max) { for (var i = this._styles._max; i < max_height; ++i) { Utils.insert_css_rule(this._styles, prefix + '[data-gs-height="' + (i + 1) + '"]', - 'height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', + 'height: ' + get_height(i + 1, i) + ';', i ); Utils.insert_css_rule(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: ' + get_height(i + 1, i) + ';', i ); Utils.insert_css_rule(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: ' + get_height(i + 1, i) + ';', i ); Utils.insert_css_rule(this._styles, prefix + '[data-gs-y="' + i + '"]', - 'top: ' + (this.opts.cell_height * i + this.opts.vertical_margin * i) + 'px;', + 'top: ' + get_height(i, i) + ';', i ); } @@ -597,9 +624,18 @@ if (this.grid._update_counter) { return; } - this.container.height( - this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - - this.opts.vertical_margin); + var height = this.grid.get_grid_height(); + this.container.attr('data-gs-current-height', height); + if (!this.opts.cell_height) { + return ; + } + if (!this.opts.vertical_margin) { + this.container.css('height', (height * (this.opts.cell_height)) + this.opts.cell_height_unit); + } else if (this.opts.cell_height_unit === this.opts.vertical_margin_unit) { + this.container.css('height', (height * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin) + this.opts.cell_height_unit); + } else { + this.container.css('height', 'calc(' + ((height * (this.opts.cell_height)) + this.opts.cell_height_unit) + ' + ' + ((height * (this.opts.vertical_margin - 1)) + this.opts.vertical_margin_unit) + ')'); + } }; GridStack.prototype._is_one_column_mode = function() { @@ -657,8 +693,9 @@ var o = $(this); self.grid.clean_nodes(); self.grid.begin_update(node); - cell_width = o.outerWidth() / o.attr('data-gs-width'); - cell_height = self.opts.cell_height + self.opts.vertical_margin; + cell_width = Math.ceil(o.outerWidth() / o.attr('data-gs-width')); + var strict_cell_height = Math.ceil(o.outerHeight() / o.attr('data-gs-height')); + cell_height = 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')) @@ -667,8 +704,8 @@ .show(); node.el = self.placeholder; - el.resizable('option', 'minWidth', Math.round(cell_width * (node.min_width || 1))); - el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); + el.resizable('option', 'minWidth', cell_width * (node.min_width || 1)); + el.resizable('option', 'minHeight', strict_cell_height * (node.min_height || 1)); if (event.type == 'resizestart') { o.find('.grid-stack-item').trigger('resizestart'); @@ -862,39 +899,39 @@ 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.min_height = function (el, val) { + el = $(el); + el.each(function (index, el) { + el = $(el); + var node = el.data('_gridstack_node'); + if (typeof node == 'undefined' || node == null) { + return; + } - if(!isNaN(val)){ - node.min_height = (val || false); - el.attr('data-gs-min-height', val); - } - }); - return this; - }; + if(!isNaN(val)){ + node.min_height = (val || false); + el.attr('data-gs-min-height', val); + } + }); + return this; + }; - GridStack.prototype.min_width = function (el, val) { - el = $(el); - el.each(function (index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { - return; - } + GridStack.prototype.min_width = function (el, val) { + el = $(el); + el.each(function (index, el) { + el = $(el); + var node = el.data('_gridstack_node'); + if (typeof node == 'undefined' || node == null) { + return; + } - if(!isNaN(val)){ - node.min_width = (val || false); - el.attr('data-gs-min-width', val); - } - }); - return this; - }; + if(!isNaN(val)){ + node.min_width = (val || false); + el.attr('data-gs-min-width', val); + } + }); + return this; + }; GridStack.prototype._update_element = function(el, callback) { el = $(el).first(); @@ -945,15 +982,55 @@ }); }; - GridStack.prototype.cell_height = function(val) { - if (typeof val == 'undefined') { - return this.opts.cell_height; + function parseHeight(val) { + var height = val; + var height_unit = 'px'; + if (height && _.isString(height)) { + var match = height.match(/^([0-9]+)(px|em|rem)?$/); + if (!match) { + throw new Error('Invalid height'); + } + height_unit = match[2]; + height = parseInt(match[1]); } - val = parseInt(val); - if (val == this.opts.cell_height) - return; - this.opts.cell_height = val || this.opts.cell_height; - this._update_styles(); + return {height: height, unit: height_unit}; + } + + GridStack.prototype.vertical_margin = function (val, noUpdate) { + if (typeof val == 'undefined') { + return this.opts.vertical_margin; + } + + var heightData = parseHeight(val); + + if (this.opts.vertical_margin_unit === heightData.unit && this.opts.height === heightData.height) { + return ; + } + this.opts.vertical_margin_unit = heightData.unit; + this.opts.vertical_margin = heightData.height; + + !noUpdate && this._update_styles(); + }; + + GridStack.prototype.cell_height = function (val, noUpdate) { + if (typeof val == 'undefined') { + if (this.opts.cell_height) { + return this.opts.cell_height; + } else { + var o = this.container.children('.' + this.opts.item_class).first(); + return Math.ceil(o.outerHeight() / o.attr('data-gs-height')); + } + } + + var heightData = parseHeight(val); + + if (this.opts.cell_height_unit === heightData.height_unit && this.opts.height === heightData.height) { + return ; + } + this.opts.cell_height_unit = heightData.unit; + this.opts.cell_height = heightData.height; + + !noUpdate && this._update_styles(); }; GridStack.prototype.cell_width = function() { @@ -967,7 +1044,7 @@ 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 row_height = 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)}; }; From f34e93baac7a1bed6409d4ca9996179dd93e8c82 Mon Sep 17 00:00:00 2001 From: Jerome Louis Date: Mon, 15 Feb 2016 11:32:39 +0100 Subject: [PATCH 47/67] increased readability --- Gruntfile.js | 0 dist/gridstack.js | 0 package.json | 0 src/gridstack.js | 8 ++++++-- 4 files changed, 6 insertions(+), 2 deletions(-) mode change 100755 => 100644 Gruntfile.js mode change 100755 => 100644 dist/gridstack.js mode change 100755 => 100644 package.json diff --git a/Gruntfile.js b/Gruntfile.js old mode 100755 new mode 100644 diff --git a/dist/gridstack.js b/dist/gridstack.js old mode 100755 new mode 100644 diff --git a/package.json b/package.json old mode 100755 new mode 100644 diff --git a/src/gridstack.js b/src/gridstack.js index 71e56b5..e045226 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1009,7 +1009,9 @@ this.opts.vertical_margin_unit = heightData.unit; this.opts.vertical_margin = heightData.height; - !noUpdate && this._update_styles(); + if (!noUpdate) { + this._update_styles(); + } }; GridStack.prototype.cell_height = function (val, noUpdate) { @@ -1030,7 +1032,9 @@ this.opts.cell_height_unit = heightData.unit; this.opts.cell_height = heightData.height; - !noUpdate && this._update_styles(); + if (!noUpdate) { + this._update_styles(); + } }; GridStack.prototype.cell_width = function() { From 1edda7f24c0e7ffbde982a4924cb42eb3505e36a Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Mon, 15 Feb 2016 09:31:43 -0800 Subject: [PATCH 48/67] v0.2.4 --- README.md | 4 ++-- bower.json | 2 +- dist/gridstack.js | 2 +- package.json | 2 +- src/gridstack.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9044c65..6213852 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com - [IE8 support](#ie8-support) - [Nested grids](#nested-grids) - [Changes](#changes) - - [v0.2.4 (development version)](#v024-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) @@ -748,7 +748,7 @@ See example: [Nested grid demo](http://troolee.github.io/gridstack.js/demo/neste Changes ======= -#### v0.2.4 (development version) +#### v0.2.4 (2016-02-15) - fix closure compiler/linter warnings - add `static_grid` option. diff --git a/bower.json b/bower.json index feb06c3..7e01f0d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "0.2.4-dev", + "version": "0.2.4", "homepage": "https://github.com/troolee/gridstack.js", "authors": [ "Pavel Reznikov " diff --git a/dist/gridstack.js b/dist/gridstack.js index 09bfba4..adf852f 100755 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -1,4 +1,4 @@ -// gridstack.js 0.2.4-dev +// gridstack.js 0.2.4 // http://troolee.github.io/gridstack.js/ // (c) 2014-2016 Pavel Reznikov // gridstack.js may be freely distributed under the MIT license. diff --git a/package.json b/package.json index 55be5c9..74c7154 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "0.2.4-dev", + "version": "0.2.4", "description": "gridstack.js is a jQuery plugin for widget layout", "main": "dist/gridstack.js", "repository": { diff --git a/src/gridstack.js b/src/gridstack.js index 09bfba4..adf852f 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1,4 +1,4 @@ -// gridstack.js 0.2.4-dev +// gridstack.js 0.2.4 // http://troolee.github.io/gridstack.js/ // (c) 2014-2016 Pavel Reznikov // gridstack.js may be freely distributed under the MIT license. From f4e8b9e03eaeaee4fddbf00832d319cd4756e90e Mon Sep 17 00:00:00 2001 From: Kevin Dietrich Date: Mon, 15 Feb 2016 20:31:19 +0100 Subject: [PATCH 49/67] Development of 0.2.5 started --- bower.json | 2 +- dist/gridstack.js | 2 +- package.json | 2 +- src/gridstack.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 7e01f0d..704477a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "0.2.4", + "version": "0.2.5-dev", "homepage": "https://github.com/troolee/gridstack.js", "authors": [ "Pavel Reznikov " diff --git a/dist/gridstack.js b/dist/gridstack.js index adf852f..37d55f9 100755 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -1,4 +1,4 @@ -// gridstack.js 0.2.4 +// 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. diff --git a/package.json b/package.json index 74c7154..c2f81de 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "0.2.4", + "version": "0.2.5-dev", "description": "gridstack.js is a jQuery plugin for widget layout", "main": "dist/gridstack.js", "repository": { diff --git a/src/gridstack.js b/src/gridstack.js index adf852f..37d55f9 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1,4 +1,4 @@ -// gridstack.js 0.2.4 +// 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. From 1e75be19ed3cc71d16a60466a74712a628f0e8f3 Mon Sep 17 00:00:00 2001 From: Kevin Dietrich Date: Mon, 15 Feb 2016 20:37:07 +0100 Subject: [PATCH 50/67] Preserve license comments in dist --- Gruntfile.js | 3 ++- dist/gridstack.js | 12 +++++++----- dist/gridstack.min.js | 7 +++++++ dist/gridstack.min.map | 2 +- src/gridstack.js | 12 +++++++----- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index f9cc452..1ae9dd9 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -38,7 +38,8 @@ module.exports = function (grunt) { uglify: { options: { sourceMap: true, - sourceMapName: 'dist/gridstack.min.map' + sourceMapName: 'dist/gridstack.min.map', + preserveComments: 'some' }, dist: { files: { diff --git a/dist/gridstack.js b/dist/gridstack.js index 37d55f9..15e2a2a 100755 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -1,8 +1,10 @@ -// 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. - +/** + * 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', diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index eaea849..52d486f 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,9 @@ +/** + * 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){var c=window,d={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},e=0,f=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._update_counter=0,this._float=this["float"]};f.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},f.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},f.prototype._fix_collisions=function(a){this._sort_nodes(-1);var c=a,e=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||e||(c={x:0,y:a.y,width:this.width,height:a.height});;){var f=b.find(this.nodes,b.bind(function(b){return b!=a&&d.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},f.prototype.is_area_empty=function(a,c,e,f){var g={x:a||0,y:c||0,width:e||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return d.is_intercepted(a,g)},this));return null==h},f.prototype._sort_nodes=function(a){this.nodes=d.sort(this.nodes,a,this.width)},f.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var e=a.y;e>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f||(a._dirty=!0,a.y=e),--e}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var e=a.y-1,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=e,a.y=e}},this))},f.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},f.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},f.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},f.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},f.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++e,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var f=c%this.width,g=Math.floor(c/this.width);if(!(f+a.width>this.width||b.find(this.nodes,function(b){return d.is_intercepted({x:f,y:g,width:a.width,height:a.height},b)}))){a.x=f,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},f.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},f.prototype.can_move_node=function(c,d,e,g,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,g,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},f.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},f.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},f.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},f.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},f.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var g=function(c,d){var e,g=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 f(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._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){g._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").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(g._is_one_column_mode()){if(e)return;e=!0,g.grid._sort_nodes(),b.each(g.grid.nodes,function(a){g.container.append(a.el),g.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,g.opts.static_grid)return;b.each(g.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return g.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},g.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=d.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},g.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&d.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)d.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},g.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)},g.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},g.prototype._prepare_element=function(c){var e=this;c=a(c),c.addClass(this.opts.item_class);var f=e.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:d.toBool(c.attr("data-gs-auto-position")),no_resize:d.toBool(c.attr("data-gs-no-resize")),no_move:d.toBool(c.attr("data-gs-no-move")),locked:d.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!e.opts.static_grid){var g,h,i=function(a,b){var c,d,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),d=Math.round(b.size.height/h)),e.grid.can_move_node(f,i,j,c,d)&&(e.grid.move_node(f,i,j,c,d),e._update_container_height())},j=function(b,d){e.container.append(e.placeholder);var i=a(this);e.grid.clean_nodes(),e.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=e.opts.cell_height+e.opts.vertical_margin,e.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(),f.el=e.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",e.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){e.placeholder.detach();var d=a(this);f.el=d,e.placeholder.hide(),d.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),e._update_container_height(),e._trigger_change_event(),e.grid.end_update();var g=d.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),d.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null,start:j,stop:k,drag:i})).resizable(b.extend(this.opts.resizable,{start:j,stop:k,resize:i})),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},g.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},g.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.make_widget=function(b){return b=a(b),this._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},g.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},g.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},g.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),d.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},g.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},g.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},g.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},g.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},g.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},g.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},g.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},g.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},g.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},g.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},g.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},g.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},g.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},g.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},g.prototype.batch_update=function(){this.grid.batch_update()},g.prototype.commit=function(){this.grid.commit(),this._update_container_height()},g.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},g.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},g.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},c.GridStackUI=g,c.GridStackUI.Utils=d,a.fn.gridstack=function(b){return this.each(function(){var c=a(this);c.data("gridstack")||c.data("gridstack",new g(this,b))})},c.GridStackUI}); //# sourceMappingURL=gridstack.min.map \ No newline at end of file diff --git a/dist/gridstack.min.map b/dist/gridstack.min.map index 43959d0..5e0b05c 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","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","bind","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","placeholder_text","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","drag_or_resize","event","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","start","stop","drag","enable","removeClass","add_widget","make_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","val","movable","isNaN","_update_element","callback","first","move","update","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,IAErB,SAASC,EAAGD,GAEX,GAAIE,GAAQC,OAERC,GACAC,eAAgB,SAASC,EAAGC,GACxB,QAASD,EAAEE,EAAIF,EAAEG,OAASF,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G,qBAGThC,EAAUhE,UAAUgG,kBAAoB,WACpC,GAAIkF,GAAoB,mBAEpBrL,MAAKqE,KAAKiB,eAAgB,EAC1BtF,KAAKwE,UAAU0B,SAASmF,GAExBrL,KAAKwE,UAAUiF,YAAY4B,IAInCtO,EAAMuO,YAAcnH,EAEpBpH,EAAMuO,YAAYrO,MAAQA,EAE1BH,EAAEyO,GAAGC,UAAY,SAASnH,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAI0H,GAAI9L,EAAEkD,KACL4I,GAAEX,KAAK,cACRW,EACKX,KAAK,YAAa,GAAI9D,GAAUnE,KAAMqE,OAKhDtH,EAAMuO","file":"gridstack.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","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","bind","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","placeholder_text","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","drag_or_resize","event","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","start","stop","drag","enable","removeClass","add_widget","make_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","val","movable","isNaN","_update_element","callback","first","move","update","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":";;;;;;;CAOA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,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,MAA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AI9D,GAAUnE,KAAMqE,OAKhDtH,EAAMuO","file":"gridstack.min.js"} \ No newline at end of file diff --git a/src/gridstack.js b/src/gridstack.js index 37d55f9..15e2a2a 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1,8 +1,10 @@ -// 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. - +/** + * 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', From 0be3e4d1dfe66075744befe391820fd1b2077e5e Mon Sep 17 00:00:00 2001 From: Kevin Dietrich Date: Mon, 15 Feb 2016 22:51:36 +0100 Subject: [PATCH 51/67] Modified changes in README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6213852..13c4a64 100644 --- a/README.md +++ b/README.md @@ -755,6 +755,8 @@ Changes - 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) From 707ab11f54f702cdce0e4a54d63007ce4620f15e Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Mon, 15 Feb 2016 23:12:06 -0800 Subject: [PATCH 52/67] add install notes --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 13c4a64..b22d819 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com - [Demo](#demo) - [Usage](#usage) - [Requirements](#requirements) + - [Install](#install) - [Basic usage](#basic-usage) - [Options](#options) - [Grid attributes](#grid-attributes) @@ -100,6 +101,29 @@ Usage Note: You can still use [underscore.js](http://underscorejs.org) (>= 1.7.0) instead of lodash.js +## Install + +* 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 From cc284c735ff615a81e345327dd7e5be9c91f6398 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Tue, 16 Feb 2016 15:38:29 -0800 Subject: [PATCH 53/67] update docs --- README.md | 5 ++ dist/gridstack.js | 191 +++++++++++++++++++++++++++++------------ dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- 4 files changed, 143 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index beda2e4..db86b20 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com - [IE8 support](#ie8-support) - [Nested grids](#nested-grids) - [Changes](#changes) + - [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) @@ -778,6 +779,10 @@ See example: [Nested grid demo](http://troolee.github.io/gridstack.js/demo/neste Changes ======= +#### v0.2.5-dev (Development version) + +- `cell_height` and `vertical_margin` can now be string (e.g. '3em', '20px') + #### v0.2.4 (2016-02-15) - fix closure compiler/linter warnings diff --git a/dist/gridstack.js b/dist/gridstack.js index 15e2a2a..36689a4 100644 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -426,6 +426,9 @@ }); this.opts.is_nested = is_nested; + this.cell_height(this.opts.cell_height, true); + this.vertical_margin(this.opts.vertical_margin, true); + this.container.addClass(this.opts._class); this._set_static_class(); @@ -475,9 +478,7 @@ '
' + '
' + this.opts.placeholder_text + '
').hide(); - this.container.height( - this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - - this.opts.vertical_margin); + this._update_container_height(); this.on_resize_handler = function() { if (self._is_one_column_mode()) { @@ -542,6 +543,9 @@ }; GridStack.prototype._init_styles = function() { + if (!this.opts.cell_height) { //that will be handled by CSS + return ; + } if (this._styles_id) { $('[data-gs-id="' + this._styles_id + '"]').remove(); } @@ -556,7 +560,10 @@ return; } - var prefix = '.' + this.opts._class + ' .' + this.opts.item_class; + var prefix = '.' + this.opts._class + ' .' + this.opts.item_class, + self = this, + get_height + ; if (typeof max_height == 'undefined') { max_height = this._styles._max; @@ -564,30 +571,50 @@ this._update_container_height(); } + if (!this.opts.cell_height) { //the rest will be handled by CSS + return ; + } + if (this._styles._max !== 0 && max_height <= this._styles._max) { + return ; + } + + if (!this.opts.vertical_margin || this.opts.cell_height_unit === this.opts.vertical_margin_unit) { + get_height = function (nbRows, nbMargins) { + return (self.opts.cell_height * nbRows + self.opts.vertical_margin * nbMargins) + self.opts.cell_height_unit; + } + } else { + get_height = function (nbRows, nbMargins) { + if (!nbRows || !nbMargins) { + return (self.opts.cell_height * nbRows + self.opts.vertical_margin * nbMargins) + self.opts.cell_height_unit; + } + return 'calc(' + ((self.opts.cell_height * nbRows) + self.opts.cell_height_unit) + ' + ' + ((self.opts.vertical_margin * nbMargins) + self.opts.vertical_margin_unit) + ')'; + } + } + if (this._styles._max == 0) { - Utils.insert_css_rule(this._styles, prefix, 'min-height: ' + (this.opts.cell_height) + 'px;', 0); + Utils.insert_css_rule(this._styles, prefix, 'min-height: ' + get_height(1, 0) + ';', 0); } if (max_height > this._styles._max) { for (var i = this._styles._max; i < max_height; ++i) { Utils.insert_css_rule(this._styles, prefix + '[data-gs-height="' + (i + 1) + '"]', - 'height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', + 'height: ' + get_height(i + 1, i) + ';', i ); Utils.insert_css_rule(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: ' + get_height(i + 1, i) + ';', i ); Utils.insert_css_rule(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: ' + get_height(i + 1, i) + ';', i ); Utils.insert_css_rule(this._styles, prefix + '[data-gs-y="' + i + '"]', - 'top: ' + (this.opts.cell_height * i + this.opts.vertical_margin * i) + 'px;', + 'top: ' + get_height(i, i) + ';', i ); } @@ -599,9 +626,18 @@ if (this.grid._update_counter) { return; } - this.container.height( - this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - - this.opts.vertical_margin); + var height = this.grid.get_grid_height(); + this.container.attr('data-gs-current-height', height); + if (!this.opts.cell_height) { + return ; + } + if (!this.opts.vertical_margin) { + this.container.css('height', (height * (this.opts.cell_height)) + this.opts.cell_height_unit); + } else if (this.opts.cell_height_unit === this.opts.vertical_margin_unit) { + this.container.css('height', (height * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin) + this.opts.cell_height_unit); + } else { + this.container.css('height', 'calc(' + ((height * (this.opts.cell_height)) + this.opts.cell_height_unit) + ' + ' + ((height * (this.opts.vertical_margin - 1)) + this.opts.vertical_margin_unit) + ')'); + } }; GridStack.prototype._is_one_column_mode = function() { @@ -659,8 +695,9 @@ var o = $(this); self.grid.clean_nodes(); self.grid.begin_update(node); - cell_width = o.outerWidth() / o.attr('data-gs-width'); - cell_height = self.opts.cell_height + self.opts.vertical_margin; + cell_width = Math.ceil(o.outerWidth() / o.attr('data-gs-width')); + var strict_cell_height = Math.ceil(o.outerHeight() / o.attr('data-gs-height')); + cell_height = 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')) @@ -669,8 +706,8 @@ .show(); node.el = self.placeholder; - el.resizable('option', 'minWidth', Math.round(cell_width * (node.min_width || 1))); - el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); + el.resizable('option', 'minWidth', cell_width * (node.min_width || 1)); + el.resizable('option', 'minHeight', strict_cell_height * (node.min_height || 1)); if (event.type == 'resizestart') { o.find('.grid-stack-item').trigger('resizestart'); @@ -864,39 +901,39 @@ 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.min_height = function (el, val) { + el = $(el); + el.each(function (index, el) { + el = $(el); + var node = el.data('_gridstack_node'); + if (typeof node == 'undefined' || node == null) { + return; + } - if(!isNaN(val)){ - node.min_height = (val || false); - el.attr('data-gs-min-height', val); - } - }); - return this; - }; + if(!isNaN(val)){ + node.min_height = (val || false); + el.attr('data-gs-min-height', val); + } + }); + return this; + }; - GridStack.prototype.min_width = function (el, val) { - el = $(el); - el.each(function (index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { - return; - } + GridStack.prototype.min_width = function (el, val) { + el = $(el); + el.each(function (index, el) { + el = $(el); + var node = el.data('_gridstack_node'); + if (typeof node == 'undefined' || node == null) { + return; + } - if(!isNaN(val)){ - node.min_width = (val || false); - el.attr('data-gs-min-width', val); - } - }); - return this; - }; + if(!isNaN(val)){ + node.min_width = (val || false); + el.attr('data-gs-min-width', val); + } + }); + return this; + }; GridStack.prototype._update_element = function(el, callback) { el = $(el).first(); @@ -947,15 +984,59 @@ }); }; - GridStack.prototype.cell_height = function(val) { - if (typeof val == 'undefined') { - return this.opts.cell_height; + function parseHeight(val) { + var height = val; + var height_unit = 'px'; + if (height && _.isString(height)) { + var match = height.match(/^([0-9]+)(px|em|rem)?$/); + if (!match) { + throw new Error('Invalid height'); + } + height_unit = match[2]; + height = parseInt(match[1]); + } + return {height: height, unit: height_unit}; + } + + GridStack.prototype.vertical_margin = function (val, noUpdate) { + if (typeof val == 'undefined') { + return this.opts.vertical_margin; + } + + var heightData = parseHeight(val); + + if (this.opts.vertical_margin_unit === heightData.unit && this.opts.height === heightData.height) { + return ; + } + this.opts.vertical_margin_unit = heightData.unit; + this.opts.vertical_margin = heightData.height; + + if (!noUpdate) { + this._update_styles(); + } + }; + + GridStack.prototype.cell_height = function (val, noUpdate) { + if (typeof val == 'undefined') { + if (this.opts.cell_height) { + return this.opts.cell_height; + } else { + var o = this.container.children('.' + this.opts.item_class).first(); + return Math.ceil(o.outerHeight() / o.attr('data-gs-height')); + } + } + + var heightData = parseHeight(val); + + if (this.opts.cell_height_unit === heightData.height_unit && this.opts.height === heightData.height) { + return ; + } + this.opts.cell_height_unit = heightData.unit; + this.opts.cell_height = heightData.height; + + if (!noUpdate) { + this._update_styles(); } - 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() { @@ -969,7 +1050,7 @@ 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 row_height = 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)}; }; diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index 52d486f..df10912 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -5,5 +5,5 @@ * 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){var c=window,d={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},e=0,f=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._update_counter=0,this._float=this["float"]};f.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},f.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},f.prototype._fix_collisions=function(a){this._sort_nodes(-1);var c=a,e=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||e||(c={x:0,y:a.y,width:this.width,height:a.height});;){var f=b.find(this.nodes,b.bind(function(b){return b!=a&&d.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},f.prototype.is_area_empty=function(a,c,e,f){var g={x:a||0,y:c||0,width:e||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return d.is_intercepted(a,g)},this));return null==h},f.prototype._sort_nodes=function(a){this.nodes=d.sort(this.nodes,a,this.width)},f.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var e=a.y;e>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f||(a._dirty=!0,a.y=e),--e}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var e=a.y-1,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return d.is_intercepted({x:a.x,y:e,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=e,a.y=e}},this))},f.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},f.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},f.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},f.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},f.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++e,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var f=c%this.width,g=Math.floor(c/this.width);if(!(f+a.width>this.width||b.find(this.nodes,function(b){return d.is_intercepted({x:f,y:g,width:a.width,height:a.height},b)}))){a.x=f,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},f.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},f.prototype.can_move_node=function(c,d,e,g,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,g,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},f.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new f(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},f.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},f.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},f.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},f.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var g=function(c,d){var e,g=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.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 f(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._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){g._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").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(g._is_one_column_mode()){if(e)return;e=!0,g.grid._sort_nodes(),b.each(g.grid.nodes,function(a){g.container.append(a.el),g.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,g.opts.static_grid)return;b.each(g.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return g.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},g.prototype._init_styles=function(){this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=d.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0)},g.prototype._update_styles=function(a){if(null!=this._styles){var b="."+this.opts._class+" ."+this.opts.item_class;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),0==this._styles._max&&d.insert_css_rule(this._styles,b,"min-height: "+this.opts.cell_height+"px;",0),a>this._styles._max){for(var c=this._styles._max;a>c;++c)d.insert_css_rule(this._styles,b+'[data-gs-height="'+(c+1)+'"]',"height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-min-height="'+(c+1)+'"]',"min-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-max-height="'+(c+1)+'"]',"max-height: "+(this.opts.cell_height*(c+1)+this.opts.vertical_margin*c)+"px;",c),d.insert_css_rule(this._styles,b+'[data-gs-y="'+c+'"]',"top: "+(this.opts.cell_height*c+this.opts.vertical_margin*c)+"px;",c);this._styles._max=a}}},g.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)},g.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},g.prototype._prepare_element=function(c){var e=this;c=a(c),c.addClass(this.opts.item_class);var f=e.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:d.toBool(c.attr("data-gs-auto-position")),no_resize:d.toBool(c.attr("data-gs-no-resize")),no_move:d.toBool(c.attr("data-gs-no-move")),locked:d.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!e.opts.static_grid){var g,h,i=function(a,b){var c,d,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),d=Math.round(b.size.height/h)),e.grid.can_move_node(f,i,j,c,d)&&(e.grid.move_node(f,i,j,c,d),e._update_container_height())},j=function(b,d){e.container.append(e.placeholder);var i=a(this);e.grid.clean_nodes(),e.grid.begin_update(f),g=i.outerWidth()/i.attr("data-gs-width"),h=e.opts.cell_height+e.opts.vertical_margin,e.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(),f.el=e.placeholder,c.resizable("option","minWidth",Math.round(g*(f.min_width||1))),c.resizable("option","minHeight",e.opts.cell_height*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){e.placeholder.detach();var d=a(this);f.el=d,e.placeholder.hide(),d.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),e._update_container_height(),e._trigger_change_event(),e.grid.end_update();var g=d.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),d.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null,start:j,stop:k,drag:i})).resizable(b.extend(this.opts.resizable,{start:j,stop:k,resize:i})),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},g.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},g.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.make_widget=function(b){return b=a(b),this._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},g.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},g.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},g.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},g.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),d.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},g.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},g.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},g.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},g.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},g.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},g.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},g.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},g.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},g.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},g.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},g.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},g.prototype.cell_height=function(a){return"undefined"==typeof a?this.opts.cell_height:(a=parseInt(a),void(a!=this.opts.cell_height&&(this.opts.cell_height=a||this.opts.cell_height,this._update_styles())))},g.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},g.prototype.get_cell_from_pixel=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=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(c/e),y:Math.floor(d/f)}},g.prototype.batch_update=function(){this.grid.batch_update()},g.prototype.commit=function(){this.grid.commit(),this._update_container_height()},g.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},g.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},g.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},c.GridStackUI=g,c.GridStackUI.Utils=d,a.fn.gridstack=function(b){return this.each(function(){var c=a(this);c.data("gridstack")||c.data("gridstack",new g(this,b))})},c.GridStackUI}); +!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={is_intercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(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)})},create_stylesheet: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},remove_stylesheet:function(b){a("STYLE[data-gs-id="+b+"]").remove()},insert_css_rule: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)}},f=0,g=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._update_counter=0,this._float=this["float"]};g.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},g.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},g.prototype._fix_collisions=function(a){this._sort_nodes(-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 f=b.find(this.nodes,b.bind(function(b){return b!=a&&e.is_intercepted(b,c)},this));if("undefined"==typeof f)return;this.move_node(f,f.x,a.y+a.height,f.width,f.height,!0)}},g.prototype.is_area_empty=function(a,c,d,f){var g={x:a||0,y:c||0,width:d||1,height:f||1},h=b.find(this.nodes,b.bind(function(a){return e.is_intercepted(a,g)},this));return null==h},g.prototype._sort_nodes=function(a){this.nodes=e.sort(this.nodes,a,this.width)},g.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._orig_y&&a.y!=a._orig_y)for(var d=a.y;d>=a._orig_y;){var f=b.chain(this.nodes).find(function(b){return a!=b&&e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f||(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,f=0==c;if(c>0){var g=b.chain(this.nodes).take(c).find(function(b){return e.is_intercepted({x:a.x,y:d,width:a.width,height:a.height},b)}).value();f="undefined"==typeof g}if(!f)break;a._dirty=a.y!=d,a.y=d}},this))},g.prototype._prepare_node=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.auto_position=a.auto_position||!1,a.no_resize=a.no_resize||!1,a.no_move=a.no_move||!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},g.prototype._notify=function(){if(!this._update_counter){var a=Array.prototype.slice.call(arguments,1).concat(this.get_dirty_nodes());a=a.concat(this.get_dirty_nodes()),this.onchange(a)}},g.prototype.clean_nodes=function(){b.each(this.nodes,function(a){a._dirty=!1})},g.prototype.get_dirty_nodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},g.prototype.add_node=function(a){if(a=this._prepare_node(a),"undefined"!=typeof a.max_width&&(a.width=Math.min(a.width,a.max_width)),"undefined"!=typeof a.max_height&&(a.height=Math.min(a.height,a.max_height)),"undefined"!=typeof a.min_width&&(a.width=Math.max(a.width,a.min_width)),"undefined"!=typeof a.min_height&&(a.height=Math.max(a.height,a.min_height)),a._id=++f,a._dirty=!0,a.auto_position){this._sort_nodes();for(var c=0;;++c){var d=c%this.width,g=Math.floor(c/this.width);if(!(d+a.width>this.width||b.find(this.nodes,function(b){return e.is_intercepted({x:d,y:g,width:a.width,height:a.height},b)}))){a.x=d,a.y=g;break}}}return this.nodes.push(a),this._fix_collisions(a),this._pack_nodes(),this._notify(),a},g.prototype.remove_node=function(a){a._id=null,this.nodes=b.without(this.nodes,a),this._pack_nodes(),this._notify(a)},g.prototype.can_move_node=function(c,d,e,f,h){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));k.move_node(j,d,e,f,h);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.get_grid_height()<=this.height),l},g.prototype.can_be_placed_with_respect_to_height=function(c){if(!this.height)return!0;var d=new g(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.add_node(c),d.get_grid_height()<=this.height},g.prototype.move_node=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.max_width&&(d=Math.min(d,a.max_width)),"undefined"!=typeof a.max_height&&(e=Math.min(e,a.max_height)),"undefined"!=typeof a.min_width&&(d=Math.max(d,a.min_width)),"undefined"!=typeof a.min_height&&(e=Math.max(e,a.min_height)),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._prepare_node(a,g),this._fix_collisions(a),f||(this._pack_nodes(),this._notify()),a},g.prototype.get_grid_height=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},g.prototype.begin_update=function(a){b.each(this.nodes,function(a){a._orig_y=a.y}),a._updating=!0},g.prototype.end_update=function(){b.each(this.nodes,function(a){a._orig_y=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var h=function(c,d){var e,f=this;d=d||{},this.container=a(c),d.item_class=d.item_class||"grid-stack-item";var h=this.container.closest("."+d.item_class).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,item_class:"grid-stack-item",placeholder_class:"grid-stack-placeholder",placeholder_text:"",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-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,always_show_resize_handle:d.always_show_resize_handle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.always_show_resize_handle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handle_class?"."+d.handle_class:d.handle?d.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"})}),this.opts.is_nested=h,this.cell_height(this.opts.cell_height,!0),this.vertical_margin(this.opts.vertical_margin,!0),this.container.addClass(this.opts._class),this._set_static_class(),h&&this.container.addClass("grid-stack-nested"),this._init_styles(),this.grid=new g(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))}),f._update_styles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var i=[],j=this;this.container.children("."+this.opts.item_class+":not(."+this.opts.placeholder_class+")").each(function(b,c){c=a(c),i.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*j.opts.width})}),b.chain(i).sortBy(function(a){return a.i}).each(function(a){f._prepare_element(a.el)}).value()}this.set_animation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholder_text+"
").hide(),this._update_container_height(),this.on_resize_handler=function(){if(f._is_one_column_mode()){if(e)return;e=!0,f.grid._sort_nodes(),b.each(f.grid.nodes,function(a){f.container.append(a.el),f.opts.static_grid||(a.no_move||a.el.draggable("disable"),a.no_resize||a.el.resizable("disable"))})}else{if(!e)return;if(e=!1,f.opts.static_grid)return;b.each(f.grid.nodes,function(a){a.no_move||a.el.draggable("enable"),a.no_resize||a.el.resizable("enable")})}},a(window).resize(this.on_resize_handler),this.on_resize_handler()};return h.prototype._trigger_change_event=function(a){var b=this.grid.get_dirty_nodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},h.prototype._init_styles=function(){this.opts.cell_height&&(this._styles_id&&a('[data-gs-id="'+this._styles_id+'"]').remove(),this._styles_id="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=e.create_stylesheet(this._styles_id),null!=this._styles&&(this._styles._max=0))},h.prototype._update_styles=function(a){if(null!=this._styles){var b,c="."+this.opts._class+" ."+this.opts.item_class,d=this;if("undefined"==typeof a&&(a=this._styles._max,this._init_styles(),this._update_container_height()),this.opts.cell_height&&!(0!==this._styles._max&&a<=this._styles._max)&&(b=this.opts.vertical_margin&&this.opts.cell_height_unit!==this.opts.vertical_margin_unit?function(a,b){return a&&b?"calc("+(d.opts.cell_height*a+d.opts.cell_height_unit)+" + "+(d.opts.vertical_margin*b+d.opts.vertical_margin_unit)+")":d.opts.cell_height*a+d.opts.vertical_margin*b+d.opts.cell_height_unit}:function(a,b){return d.opts.cell_height*a+d.opts.vertical_margin*b+d.opts.cell_height_unit},0==this._styles._max&&e.insert_css_rule(this._styles,c,"min-height: "+b(1,0)+";",0),a>this._styles._max)){for(var f=this._styles._max;a>f;++f)e.insert_css_rule(this._styles,c+'[data-gs-height="'+(f+1)+'"]',"height: "+b(f+1,f)+";",f),e.insert_css_rule(this._styles,c+'[data-gs-min-height="'+(f+1)+'"]',"min-height: "+b(f+1,f)+";",f),e.insert_css_rule(this._styles,c+'[data-gs-max-height="'+(f+1)+'"]',"max-height: "+b(f+1,f)+";",f),e.insert_css_rule(this._styles,c+'[data-gs-y="'+f+'"]',"top: "+b(f,f)+";",f);this._styles._max=a}}},h.prototype._update_container_height=function(){if(!this.grid._update_counter){var a=this.grid.get_grid_height();this.container.attr("data-gs-current-height",a),this.opts.cell_height&&(this.opts.vertical_margin?this.opts.cell_height_unit===this.opts.vertical_margin_unit?this.container.css("height",a*(this.opts.cell_height+this.opts.vertical_margin)-this.opts.vertical_margin+this.opts.cell_height_unit):this.container.css("height","calc("+(a*this.opts.cell_height+this.opts.cell_height_unit)+" + "+(a*(this.opts.vertical_margin-1)+this.opts.vertical_margin_unit)+")"):this.container.css("height",a*this.opts.cell_height+this.opts.cell_height_unit))}},h.prototype._is_one_column_mode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.min_width},h.prototype._prepare_element=function(c){var d=this;c=a(c),c.addClass(this.opts.item_class);var f=d.grid.add_node({x:c.attr("data-gs-x"),y:c.attr("data-gs-y"),width:c.attr("data-gs-width"),height:c.attr("data-gs-height"),max_width:c.attr("data-gs-max-width"),min_width:c.attr("data-gs-min-width"),max_height:c.attr("data-gs-max-height"),min_height:c.attr("data-gs-min-height"),auto_position:e.toBool(c.attr("data-gs-auto-position")),no_resize:e.toBool(c.attr("data-gs-no-resize")),no_move:e.toBool(c.attr("data-gs-no-move")),locked:e.toBool(c.attr("data-gs-locked")),el:c});if(c.data("_gridstack_node",f),!d.opts.static_grid){var g,h,i=function(a,b){var c,e,i=Math.round(b.position.left/g),j=Math.floor((b.position.top+h/2)/h);"drag"!=a.type&&(c=Math.round(b.size.width/g),e=Math.round(b.size.height/h)),d.grid.can_move_node(f,i,j,c,e)&&(d.grid.move_node(f,i,j,c,e),d._update_container_height())},j=function(b,e){d.container.append(d.placeholder);var i=a(this);d.grid.clean_nodes(),d.grid.begin_update(f),g=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(),f.el=d.placeholder,c.resizable("option","minWidth",g*(f.min_width||1)),c.resizable("option","minHeight",j*(f.min_height||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},k=function(b,c){d.placeholder.detach();var e=a(this);f.el=e,d.placeholder.hide(),e.attr("data-gs-x",f.x).attr("data-gs-y",f.y).attr("data-gs-width",f.width).attr("data-gs-height",f.height).removeAttr("style"),d._update_container_height(),d._trigger_change_event(),d.grid.end_update();var g=e.find(".grid-stack");g.length&&"resizestop"==b.type&&(g.each(function(b,c){a(c).data("gridstack").on_resize_handler()}),e.find(".grid-stack-item").trigger("resizestop"))};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.is_nested?this.container.parent():null,start:j,stop:k,drag:i})).resizable(b.extend(this.opts.resizable,{start:j,stop:k,resize:i})),(f.no_move||this._is_one_column_mode())&&c.draggable("disable"),(f.no_resize||this._is_one_column_mode())&&c.resizable("disable"),c.attr("data-gs-locked",f.locked?"yes":null)}},h.prototype.set_animation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},h.prototype.add_widget=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._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.make_widget=function(b){return b=a(b),this._prepare_element(b),this._update_container_height(),this._trigger_change_event(!0),b},h.prototype.will_it_fit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,auto_position:e};return this.grid.can_be_placed_with_respect_to_height(f)},h.prototype.remove_widget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");this.grid.remove_node(d),b.removeData("_gridstack_node"),this._update_container_height(),c&&b.remove(),this._trigger_change_event(!0)},h.prototype.remove_all=function(a){b.each(this.grid.nodes,b.bind(function(b){this.remove_widget(b.el,a)},this)),this.grid.nodes=[],this._update_container_height()},h.prototype.destroy=function(){a(window).off("resize",this.on_resize_handler),this.disable(),this.container.remove(),e.remove_stylesheet(this._styles_id),this.grid&&(this.grid=null)},h.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.no_resize=!c,f.no_resize||d._is_one_column_mode()?e.resizable("disable"):e.resizable("enable"))}),this},h.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.no_move=!c,f.no_move||d._is_one_column_mode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},h.prototype.disable=function(){this.movable(this.container.children("."+this.opts.item_class),!1),this.resizable(this.container.children("."+this.opts.item_class),!1),this.container.trigger("disable")},h.prototype.enable=function(){this.movable(this.container.children("."+this.opts.item_class),!0),this.resizable(this.container.children("."+this.opts.item_class),!0),this.container.trigger("enable")},h.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},h.prototype.min_height=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.min_height=c||!1,d.attr("data-gs-min-height",c)))}),this},h.prototype.min_width=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.min_width=c||!1,d.attr("data-gs-min-width",c)))}),this},h.prototype._update_element=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!=d){var e=this;e.grid.clean_nodes(),e.grid.begin_update(d),c.call(this,b,d),e._update_container_height(),e._trigger_change_event(),e.grid.end_update()}},h.prototype.resize=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.width,c=null!=c&&"undefined"!=typeof c?c:d.height,this.grid.move_node(d,d.x,d.y,b,c)})},h.prototype.move=function(a,b,c){this._update_element(a,function(a,d){b=null!=b&&"undefined"!=typeof b?b:d.x,c=null!=c&&"undefined"!=typeof c?c:d.y,this.grid.move_node(d,b,c,d.width,d.height)})},h.prototype.update=function(a,b,c,d,e){this._update_element(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.move_node(f,b,c,d,e)})},h.prototype.vertical_margin=function(a,b){if("undefined"==typeof a)return this.opts.vertical_margin;var d=c(a);(this.opts.vertical_margin_unit!==d.unit||this.opts.height!==d.height)&&(this.opts.vertical_margin_unit=d.unit,this.opts.vertical_margin=d.height,b||this._update_styles())},h.prototype.cell_height=function(a,b){if("undefined"==typeof a){if(this.opts.cell_height)return this.opts.cell_height;var d=this.container.children("."+this.opts.item_class).first();return Math.ceil(d.outerHeight()/d.attr("data-gs-height"))}var e=c(a);(this.opts.cell_height_unit!==e.height_unit||this.opts.height!==e.height)&&(this.opts.cell_height_unit=e.unit,this.opts.cell_height=e.height,b||this._update_styles())},h.prototype.cell_width=function(){var a=this.container.children("."+this.opts.item_class).first();return Math.ceil(a.outerWidth()/a.attr("data-gs-width"))},h.prototype.get_cell_from_pixel=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)}},h.prototype.batch_update=function(){this.grid.batch_update()},h.prototype.commit=function(){this.grid.commit(),this._update_container_height()},h.prototype.is_area_empty=function(a,b,c,d){return this.grid.is_area_empty(a,b,c,d)},h.prototype.set_static=function(a){this.opts.static_grid=a===!0,this._set_static_class()},h.prototype._set_static_class=function(){var a="grid-stack-static";this.opts.static_grid===!0?this.container.addClass(a):this.container.removeClass(a)},d.GridStackUI=h,d.GridStackUI.Utils=e,a.fn.gridstack=function(b){return this.each(function(){var c=a(this);c.data("gridstack")||c.data("gridstack",new h(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 5e0b05c..44d7f2f 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","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","bind","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","placeholder_text","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","drag_or_resize","event","ui","round","position","left","top","type","on_start_moving","o","outerWidth","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","start","stop","drag","enable","removeClass","add_widget","make_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","val","movable","isNaN","_update_element","callback","first","move","update","ceil","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","set_static","static_value","static_class_name","GridStackUI","fn","gridstack"],"mappings":";;;;;;;CAOA,SAAUA,GACN,GAAsB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,OAE3B,IAAuB,mBAAZG,SAAyB,CACvC,IAAMC,OAASC,QAAQ,UAAa,MAAMC,IAC1C,IAAMC,EAAIF,QAAQ,UAAa,MAAMC,IACrCN,EAAQI,OAAQG,OAGdP,GAAQI,OAAQG,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,E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U0K,oBAAsB,SAAStC,GAC/C,GAAIuC,GAAe9K,KAAKwE,UAAU+D,WAC9BwC,EAAexC,EAASC,KAAOsC,EAAatC,KAC5CwC,EAAczC,EAASE,IAAMqC,EAAarC,IAE1CwC,EAAepI,KAAKM,MAAMnD,KAAKwE,UAAUlH,QAAU0C,KAAKqE,KAAK/G,OAC7D4N,EAAalL,KAAKqE,KAAKa,YAAclF,KAAKqE,KAAKc,eAEnD,QAAQ9H,EAAGwF,KAAKM,MAAM4H,EAAeE,GAAe1N,EAAGsF,KAAKM,MAAM6H,EAAcE,KAGpF/G,EAAUhE,UAAUC,aAAe,WAC/BJ,KAAKqG,KAAKjG,gBAGd+D,EAAUhE,UAAUE,OAAS,WACzBL,KAAKqG,KAAKhG,SACVL,KAAK4H,4BAGTzD,EAAUhE,UAAUc,cAAgB,SAAS5D,EAAGE,EAAGD,EAAOE,GACtD,MAAOwC,MAAKqG,KAAKpF,cAAc5D,EAAGE,EAAGD,EAAOE,IAGhD2G,EAAUhE,UAAUgL,WAAa,SAASC,GACtCpL,KAAKqE,KAAKiB,YAAe8F,KAAiB,EAC1CpL,KAAKmG,qBAGThC,EAAUhE,UAAUgG,kBAAoB,WACpC,GAAIkF,GAAoB,mBAEpBrL,MAAKqE,KAAKiB,eAAgB,EAC1BtF,KAAKwE,UAAU0B,SAASmF,GAExBrL,KAAKwE,UAAUiF,YAAY4B,IAInCtO,EAAMuO,YAAcnH,EAEpBpH,EAAMuO,YAAYrO,MAAQA,EAE1BH,EAAEyO,GAAGC,UAAY,SAASnH,GACtB,MAAOrE,MAAKkB,KAAK,WACb,GAAI0H,GAAI9L,EAAEkD,KACL4I,GAAEX,KAAK,cACRW,EACKX,KAAK,YAAa,GAAI9D,GAAUnE,KAAMqE,OAKhDtH,EAAMuO","file":"gridstack.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/gridstack.js"],"names":["factory","define","amd","exports","jQuery","require","e","_","$","parseHeight","val","height","height_unit","isString","match","Error","parseInt","unit","scope","window","Utils","is_intercepted","a","b","x","width","y","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","bind","move_node","is_area_empty","each","i","_updating","_orig_y","new_y","bn","_dirty","can_be_moved","take","_prepare_node","resizing","defaults","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","placeholder_text","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","_update_container_height","on_resize_handler","_is_one_column_mode","append","resize","_trigger_change_event","forceTrigger","hasChanges","eventParams","length","trigger","_styles_id","_styles","_max","get_height","prefix","cell_height_unit","vertical_margin_unit","nbRows","nbMargins","css","innerWidth","documentElement","clientWidth","body","data","cell_width","drag_or_resize","event","ui","round","position","left","top","type","on_start_moving","o","ceil","outerWidth","strict_cell_height","outerHeight","show","on_end_moving","detach","removeAttr","nested_grids","containment","parent","start","stop","drag","enable","removeClass","add_widget","make_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","destroy","off","disable","movable","isNaN","_update_element","callback","first","move","update","noUpdate","heightData","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_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L,MAAKoE,KAAKiB,eAAgB,EAC1BrF,KAAKuE,UAAU0B,SAAS4F,GAExB7L,KAAKuE,UAAU0F,YAAY4B,IAInC7O,EAAM8O,YAAc5H,EAEpBlH,EAAM8O,YAAY5O,MAAQA,EAE1BZ,EAAEyP,GAAGC,UAAY,SAAS5H,GACtB,MAAOpE,MAAKkB,KAAK,WACb,GAAI+H,GAAI3M,EAAE0D,KACLiJ,GAAEX,KAAK,cACRW,EACKX,KAAK,YAAa,GAAIpE,GAAUlE,KAAMoE,OAKhDpH,EAAM8O","file":"gridstack.min.js"} \ No newline at end of file From b968bb3501dc91ad859589c323a7a3c592349a4b Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Tue, 16 Feb 2016 15:40:23 -0800 Subject: [PATCH 54/67] last pr credenrials --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db86b20..8c492d3 100644 --- a/README.md +++ b/README.md @@ -781,7 +781,7 @@ Changes #### v0.2.5-dev (Development version) -- `cell_height` and `vertical_margin` can now be string (e.g. '3em', '20px') +- `cell_height` and `vertical_margin` can now be string (e.g. '3em', '20px') (Thanks to @jlowcs) #### v0.2.4 (2016-02-15) From 2bb81a708531e00f2bb0672049b15b09cc39a05f Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Tue, 16 Feb 2016 15:46:42 -0800 Subject: [PATCH 55/67] update docs --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8c492d3..32a7eac 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ You can download files from `dist` directory as well. ## Basic usage -``` +```html
@@ -556,7 +556,7 @@ $(function () { and HTML: -``` +```html
``` @@ -564,7 +564,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: [ '
', @@ -621,7 +621,7 @@ and so on. Here is a SASS code snipped which can make life easier (Thanks to @ascendantofrain, [#81](https://github.com/troolee/gridstack.js/issues/81)): -``` +```sass .grid-stack-item { $gridstack-columns: 12; @@ -645,7 +645,7 @@ There are few extra CSS batteries in `gridstack-extra.css` (`gridstack-extra.min You can use other than 12 grid width: -``` +```html
...
``` ```javascript @@ -731,7 +731,7 @@ CSS stylesheet dynamically. As a workaround you can do the following: - Create `gridstack-ie8.css` for your configuration (sample for grid with cell height of 60px can be found [here](https://gist.github.com/troolee/6edfea5857f4cd73e6f1)). - Include this CSS: -``` +```html From 12e3d5f8ec347cfab7c0e0a15ef530a8251cc12a Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Tue, 16 Feb 2016 19:31:42 -0800 Subject: [PATCH 56/67] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 32a7eac..4bdc993 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ 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. +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. From 64de4684e332e89790f424425fbd4db64e6697da Mon Sep 17 00:00:00 2001 From: d Date: Wed, 17 Feb 2016 15:46:48 -0500 Subject: [PATCH 57/67] Added obsoletion code for deprecated methods and options. Added jscs settings and ensured code passed. Ensured code passed jshint. --- .jscsrc | 14 + src/gridstack.js | 2087 +++++++++++++++++++++++++--------------------- 2 files changed, 1142 insertions(+), 959 deletions(-) create mode 100644 .jscsrc 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/src/gridstack.js b/src/gridstack.js index 15e2a2a..ac1d889 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -6,1015 +6,1184 @@ * @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 { - factory(jQuery, _); - } + 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 { + factory(jQuery, _); + } })(function($, _) { - var scope = window; - - var Utils = { - is_intercepted: function(a, b) { - return !(a.x + a.width <= b.x || b.x + b.width <= a.x || a.y + a.height <= b.y || b.y + b.height <= a.y); - }, - - sort: function(nodes, dir, width) { - width = width || _.chain(nodes).map(function(node) { return node.x + node.width; }).max().value(); - dir = dir != -1 ? 1 : -1; - return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); }); - }, - - create_stylesheet: function(id) { - var style = document.createElement('style'); - style.setAttribute('type', 'text/css'); - style.setAttribute('data-gs-id', id); - if (style.styleSheet) { - style.styleSheet.cssText = ''; - } - else { - style.appendChild(document.createTextNode('')); - } - document.getElementsByTagName('head')[0].appendChild(style); - return style.sheet; - }, - remove_stylesheet: function(id) { - $("STYLE[data-gs-id=" + id +"]").remove(); - }, - insert_css_rule: function(sheet, selector, rules, index) { - if (typeof sheet.insertRule === 'function') { - sheet.insertRule(selector + '{' + rules + '}', index); - } - else if (typeof sheet.addRule === 'function') { - sheet.addRule(selector, rules, index); - } - }, - - toBool: function(v) { - if (typeof v == 'boolean') - return v; - if (typeof v == 'string') { - v = v.toLowerCase(); - return !(v == '' || v == 'no' || v == 'false' || v == '0'); - } - return Boolean(v); - } - }; - - var id_seq = 0; - - var GridStackEngine = function(width, onchange, float_mode, height, items) { - this.width = width; - this['float'] = float_mode || false; - this.height = height || 0; - - this.nodes = items || []; - this.onchange = onchange || function() {}; - - this._update_counter = 0; - this._float = this['float']; - }; - - GridStackEngine.prototype.batch_update = function() { - this._update_counter = 1; - this.float = true; - }; - - GridStackEngine.prototype.commit = function() { - this._update_counter = 0; - if (this._update_counter == 0) { - this.float = this._float; - this._pack_nodes(); - this._notify(); - } - }; - - GridStackEngine.prototype._fix_collisions = function(node) { - this._sort_nodes(-1); - - var nn = node, has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked })); - if (!this.float && !has_locked) { - nn = {x: 0, y: node.y, width: this.width, height: node.height}; - } - - while (true) { - var collision_node = _.find(this.nodes, _.bind(function(n) { - return n != node && Utils.is_intercepted(n, nn); - }, this)); - if (typeof collision_node == 'undefined') { - return; - } - this.move_node(collision_node, collision_node.x, node.y + node.height, - collision_node.width, collision_node.height, true); - } - }; - - GridStackEngine.prototype.is_area_empty = function(x, y, width, height) { - var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1}; - var collision_node = _.find(this.nodes, _.bind(function(n) { - return Utils.is_intercepted(n, nn); - }, this)); - return collision_node == null; - }; - - GridStackEngine.prototype._sort_nodes = function(dir) { - this.nodes = Utils.sort(this.nodes, dir, this.width); - }; - - GridStackEngine.prototype._pack_nodes = function() { - this._sort_nodes(); - - if (this.float) { - _.each(this.nodes, _.bind(function(n, i) { - if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y) - return; - - var new_y = n.y; - while (new_y >= n._orig_y) { - var collision_node = _.chain(this.nodes) - .find(function(bn) { - return n != bn && - Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn); - }) - .value(); - - if (!collision_node) { - n._dirty = true; - n.y = new_y; - } - --new_y; - } - }, 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; - - if (i > 0) { - var collision_node = _.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); - }) - .value(); - can_be_moved = typeof collision_node == 'undefined'; - } - - if (!can_be_moved) { - break; - } - n._dirty = n.y != new_y; - n.y = new_y; - } - }, this)); - } - }; - - GridStackEngine.prototype._prepare_node = 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; - - if (node.width > this.width) { - node.width = this.width; - } - else if (node.width < 1) { - node.width = 1; - } - - if (node.height < 1) { - node.height = 1; - } - - if (node.x < 0) { - node.x = 0; - } - - if (node.x + node.width > this.width) { - if (resizing) { - node.width = this.width - node.x; - } - else { - node.x = this.width - node.width; - } - } - - if (node.y < 0) { - node.y = 0; - } - - return node; - }; - - GridStackEngine.prototype._notify = function() { - if (this._update_counter) { - 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); - }; - - GridStackEngine.prototype.clean_nodes = function() { - _.each(this.nodes, function(n) {n._dirty = false }); - }; - - GridStackEngine.prototype.get_dirty_nodes = function() { - return _.filter(this.nodes, function(n) { return n._dirty; }); - }; - - GridStackEngine.prototype.add_node = function(node) { - node = this._prepare_node(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); - - node._id = ++id_seq; - node._dirty = true; - - if (node.auto_position) { - this._sort_nodes(); - - for (var i = 0;; ++i) { - var x = i % this.width, y = Math.floor(i / this.width); - if (x + node.width > this.width) { - continue; - } - if (!_.find(this.nodes, function(n) { - return Utils.is_intercepted({x: x, y: y, width: node.width, height: node.height}, n); - })) { - node.x = x; - node.y = y; - break; - } - } - } - - this.nodes.push(node); - - this._fix_collisions(node); - this._pack_nodes(); - this._notify(); - return node; - }; - - GridStackEngine.prototype.remove_node = function(node) { - node._id = null; - this.nodes = _.without(this.nodes, node); - this._pack_nodes(); - this._notify(node); - }; - - GridStackEngine.prototype.can_move_node = function(node, x, y, width, height) { - var has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked })); - - if (!this.height && !has_locked) - return true; - - var cloned_node; - var clone = new GridStackEngine( - this.width, - null, - this.float, - 0, - _.map(this.nodes, function(n) { - if (n == node) { - cloned_node = $.extend({}, n); - return cloned_node; - } - return $.extend({}, n); - })); - - clone.move_node(cloned_node, x, y, width, height); - - var res = true; - - if (has_locked) - res &= !Boolean(_.find(clone.nodes, function(n) { - return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty); - })); - if (this.height) - res &= clone.get_grid_height() <= this.height; - - return res; - }; - - GridStackEngine.prototype.can_be_placed_with_respect_to_height = 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; - }; - - 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; - - 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 (node.x == x && node.y == y && node.width == width && node.height == height) { - return node; - } - - var resizing = node.width != width; - node._dirty = true; - - node.x = x; - node.y = y; - node.width = width; - node.height = height; - - node = this._prepare_node(node, resizing); - - this._fix_collisions(node); - if (!no_pack) { - this._pack_nodes(); - this._notify(); - } - return node; - }; - - GridStackEngine.prototype.get_grid_height = function() { - return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0); - }; - - GridStackEngine.prototype.begin_update = function(node) { - _.each(this.nodes, function(n) { - n._orig_y = n.y; - }); - node._updating = true; - }; - - GridStackEngine.prototype.end_update = function() { - _.each(this.nodes, function(n) { - n._orig_y = n.y; - }); - var n = _.find(this.nodes, function(n) { return n._updating; }); - if (n) { - n._updating = false; - } - }; - - var GridStack = function(el, opts) { - var self = this, one_column_mode; - - 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; - - 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', - placeholder_text: '', - handle: '.grid-stack-item-content', - handle_class: null, - cell_height: 60, - vertical_margin: 20, - auto: true, - min_width: 768, - float: false, - static_grid: 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, - resizable: _.defaults(opts.resizable || {}, { - autoHide: !(opts.always_show_resize_handle || false), - handles: 'se' - }), - draggable: _.defaults(opts.draggable || {}, { - handle: (opts.handle_class ? '.' + opts.handle_class : (opts.handle ? opts.handle : '')) || '.grid-stack-item-content', - scroll: false, - appendTo: 'body' - }) - }); - this.opts.is_nested = is_nested; - - this.container.addClass(this.opts._class); - - this._set_static_class(); - - if (is_nested) { - this.container.addClass('grid-stack-nested'); - } - - this._init_styles(); - - this.grid = new GridStackEngine(this.opts.width, function(nodes) { - var max_height = 0; - _.each(nodes, function(n) { - if (n._id == null) { - n.el.remove(); - } - 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); - } - }); - self._update_styles(max_height + 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) { - el = $(el); - elements.push({ - el: el, - i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width - }); - }); - _.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) { - self._prepare_element(i.el); - }).value(); - } - - this.set_animation(this.opts.animate); - - this.placeholder = $( - '
' + - '
' + this.opts.placeholder_text + '
').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 (self._is_one_column_mode()) { - if (one_column_mode) - return; - - one_column_mode = true; - - self.grid._sort_nodes(); - _.each(self.grid.nodes, function(node) { - self.container.append(node.el); - - if (self.opts.static_grid) { - return; - } - if (!node.no_move) { - node.el.draggable('disable'); - } - if (!node.no_resize) { - node.el.resizable('disable'); - } - }); - } - else { - if (!one_column_mode) - return; - - one_column_mode = false; - - if (self.opts.static_grid) { - return; - } - - _.each(self.grid.nodes, function(node) { - if (!node.no_move) { - node.el.draggable('enable'); - } - if (!node.no_resize) { - node.el.resizable('enable'); - } - }); - } - }; - - $(window).resize(this.on_resize_handler); - this.on_resize_handler(); - }; - - GridStack.prototype._trigger_change_event = function(forceTrigger) { - var elements = this.grid.get_dirty_nodes(); - var hasChanges = false; - - var eventParams = []; - if (elements && elements.length) { - eventParams.push(elements); - hasChanges = true; - } - - if (hasChanges || forceTrigger === true) { - this.container.trigger('change', eventParams); - } - }; - - GridStack.prototype._init_styles = function() { - if (this._styles_id) { - $('[data-gs-id="' + this._styles_id + '"]').remove(); - } - this._styles_id = 'gridstack-style-' + (Math.random() * 100000).toFixed(); - this._styles = Utils.create_stylesheet(this._styles_id); - if (this._styles != null) - this._styles._max = 0; - }; - - GridStack.prototype._update_styles = function(max_height) { - if (this._styles == null) { - return; - } - - var prefix = '.' + this.opts._class + ' .' + this.opts.item_class; - - if (typeof max_height == 'undefined') { - max_height = this._styles._max; - this._init_styles(); - this._update_container_height(); - } - - if (this._styles._max == 0) { - Utils.insert_css_rule(this._styles, prefix, 'min-height: ' + (this.opts.cell_height) + 'px;', 0); - } - - if (max_height > this._styles._max) { - for (var i = this._styles._max; i < max_height; ++i) { - Utils.insert_css_rule(this._styles, - prefix + '[data-gs-height="' + (i + 1) + '"]', - 'height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', - i - ); - Utils.insert_css_rule(this._styles, - prefix + '[data-gs-min-height="' + (i + 1) + '"]', - 'min-height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', - i - ); - Utils.insert_css_rule(this._styles, - prefix + '[data-gs-max-height="' + (i + 1) + '"]', - 'max-height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;', - i - ); - Utils.insert_css_rule(this._styles, - prefix + '[data-gs-y="' + i + '"]', - 'top: ' + (this.opts.cell_height * i + this.opts.vertical_margin * i) + 'px;', - i - ); - } - this._styles._max = max_height; - } - }; - - GridStack.prototype._update_container_height = function() { - if (this.grid._update_counter) { - return; - } - this.container.height( - this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - - this.opts.vertical_margin); - }; - - GridStack.prototype._is_one_column_mode = function() { - return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= - this.opts.min_width; - }; - - GridStack.prototype._prepare_element = function(el) { - var self = this; - el = $(el); - - el.addClass(this.opts.item_class); - - var node = self.grid.add_node({ - 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')), - locked: Utils.toBool(el.attr('data-gs-locked')), - el: el - }); - el.data('_gridstack_node', node); - - if (self.opts.static_grid) { - return; - } - - var cell_width, cell_height; - - var drag_or_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, height; - if (event.type != "drag") { - 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(); - }; - - var on_start_moving = function(event, ui) { - self.container.append(self.placeholder); - var o = $(this); - self.grid.clean_nodes(); - self.grid.begin_update(node); - cell_width = o.outerWidth() / o.attr('data-gs-width'); - cell_height = self.opts.cell_height + self.opts.vertical_margin; - self.placeholder - .attr('data-gs-x', o.attr('data-gs-x')) - .attr('data-gs-y', o.attr('data-gs-y')) - .attr('data-gs-width', o.attr('data-gs-width')) - .attr('data-gs-height', o.attr('data-gs-height')) - .show(); - node.el = self.placeholder; - - el.resizable('option', 'minWidth', Math.round(cell_width * (node.min_width || 1))); - el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1)); - - if (event.type == 'resizestart') { - o.find('.grid-stack-item').trigger('resizestart'); - } - }; - - var on_end_moving = function(event, ui) { - self.placeholder.detach(); - var o = $(this); - node.el = o; - self.placeholder.hide(); - o - .attr('data-gs-x', node.x) - .attr('data-gs-y', node.y) - .attr('data-gs-width', node.width) - .attr('data-gs-height', node.height) - .removeAttr('style'); - self._update_container_height(); - self._trigger_change_event(); - - self.grid.end_update(); - - var nested_grids = o.find('.grid-stack'); - if (nested_grids.length && event.type == 'resizestop') { - nested_grids.each(function(index, el) { - $(el).data('gridstack').on_resize_handler(); - }); - o.find('.grid-stack-item').trigger('resizestop'); - } - }; - - el - .draggable(_.extend(this.opts.draggable, { - containment: this.opts.is_nested ? this.container.parent() : null, - start: on_start_moving, - stop: on_end_moving, - drag: drag_or_resize - })) - .resizable(_.extend(this.opts.resizable, { - start: on_start_moving, - stop: on_end_moving, - resize: drag_or_resize - })); - - if (node.no_move || this._is_one_column_mode()) { - el.draggable('disable'); - } - - if (node.no_resize || this._is_one_column_mode()) { - el.resizable('disable'); - } - - el.attr('data-gs-locked', node.locked ? 'yes' : null); - }; - - GridStack.prototype.set_animation = function(enable) { - if (enable) { - this.container.addClass('grid-stack-animate'); - } - else { - this.container.removeClass('grid-stack-animate'); - } - }; - - GridStack.prototype.add_widget = function(el, x, y, width, height, auto_position) { - el = $(el); - if (typeof x != 'undefined') el.attr('data-gs-x', x); - if (typeof y != 'undefined') el.attr('data-gs-y', y); - 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); - this.container.append(el); - this._prepare_element(el); - this._update_container_height(); - this._trigger_change_event(true); - - return el; - }; - - GridStack.prototype.make_widget = function(el) { - el = $(el); - this._prepare_element(el); - this._update_container_height(); - this._trigger_change_event(true); - - return el; - }; - - GridStack.prototype.will_it_fit = function(x, y, width, height, auto_position) { - var node = {x: x, y: y, width: width, height: height, auto_position: auto_position}; - return this.grid.can_be_placed_with_respect_to_height(node); - }; - - GridStack.prototype.remove_widget = function(el, detach_node) { - detach_node = typeof detach_node === 'undefined' ? true : detach_node; - el = $(el); - var node = el.data('_gridstack_node'); - this.grid.remove_node(node); - el.removeData('_gridstack_node'); - this._update_container_height(); - if (detach_node) - el.remove(); - this._trigger_change_event(true); - }; - - GridStack.prototype.remove_all = function(detach_node) { - _.each(this.grid.nodes, _.bind(function(node) { - this.remove_widget(node.el, detach_node); - }, this)); - this.grid.nodes = []; - this._update_container_height(); - }; - - GridStack.prototype.destroy = function() { - $(window).off("resize", this.on_resize_handler); - this.disable(); - this.container.remove(); - Utils.remove_stylesheet(this._styles_id); - if (this.grid) - this.grid = null; - }; - - GridStack.prototype.resizable = function(el, val) { - var self = this; - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { - return; - } - - node.no_resize = !(val || false); - if (node.no_resize || self._is_one_column_mode()) { - el.resizable('disable'); - } - else { - el.resizable('enable'); - } - }); - return this; - }; - - 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) { - return; - } - - node.no_move = !(val || false); - if (node.no_move || self._is_one_column_mode()) { - el.draggable('disable'); - 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.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.container.trigger('enable'); - }; - - GridStack.prototype.locked = 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; - } - - node.locked = (val || false); - el.attr('data-gs-locked', node.locked ? 'yes' : null); - }); - return this; - }; - - GridStack.prototype.min_height = function (el, val) { + 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 = { + 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(nodes, dir, width) { + width = width || _.chain(nodes).map(function(node) { return node.x + node.width; }).max().value(); + dir = dir != -1 ? 1 : -1; + return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); }); + }, + + 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 { + style.appendChild(document.createTextNode('')); + } + document.getElementsByTagName('head')[0].appendChild(style); + return style.sheet; + }, + + removeStylesheet: function(id) { + $('STYLE[data-gs-id=' + id + ']').remove(); + }, + + insertCSSRule: function(sheet, selector, rules, index) { + if (typeof sheet.insertRule === 'function') { + sheet.insertRule(selector + '{' + rules + '}', index); + } else if (typeof sheet.addRule === 'function') { + sheet.addRule(selector, rules, index); + } + }, + + toBool: function(v) { + if (typeof v == 'boolean') { + return v; + } + if (typeof v == 'string') { + v = v.toLowerCase(); + 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); + } + }; + + // jscs:disable requireCamelCaseOrUpperCaseIdentifiers + Utils.is_intercepted = obsolete(Utils.isIntercepted, 'is_intercepted', 'isIntercepted'); + + 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 = floatMode || false; + this.height = height || 0; + + this.nodes = items || []; + this.onchange = onchange || function() {}; + + this._updateCounter = 0; + this._float = this.float; + }; + + GridStackEngine.prototype.batchUpdate = function() { + this._updateCounter = 1; + this.float = true; + }; + + GridStackEngine.prototype.commit = function() { + this._updateCounter = 0; + if (this._updateCounter === 0) { + this.float = this._float; + this._packNodes(); + this._notify(); + } + }; + + GridStackEngine.prototype._fixCollisions = function(node) { + var self = this; + this._sortNodes(-1); + + 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 collisionNode = _.find(this.nodes, _.bind(Utils._collisionNodeCheck, {node: node, nn: nn})); + if (typeof collisionNode == 'undefined') { + return; + } + this.moveNode(collisionNode, collisionNode.x, node.y + node.height, + collisionNode.width, collisionNode.height, true); + } + }; + + GridStackEngine.prototype.isAreaEmpty = function(x, y, width, height) { + var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1}; + var collisionNode = _.find(this.nodes, _.bind(function(n) { + return Utils.isIntercepted(n, nn); + }, this)); + return collisionNode === null; + }; + + GridStackEngine.prototype._sortNodes = function(dir) { + this.nodes = Utils.sort(this.nodes, dir, this.width); + }; + + GridStackEngine.prototype._packNodes = function() { + this._sortNodes(); + + if (this.float) { + _.each(this.nodes, _.bind(function(n, i) { + if (n._updating || typeof n._origY == 'undefined' || n.y == n._origY) { + return; + } + + var newY = n.y; + while (newY >= n._origY) { + var collisionNode = _.chain(this.nodes) + .find(_.bind(Utils._didCollide, {n: n, newY: newY})) + .value(); + + if (!collisionNode) { + n._dirty = true; + n.y = newY; + } + --newY; + } + }, this)); + } else { + _.each(this.nodes, _.bind(function(n, i) { + if (n.locked) { + return; + } + while (n.y > 0) { + var newY = n.y - 1; + var canBeMoved = i === 0; + + if (i > 0) { + var collisionNode = _.chain(this.nodes) + .take(i) + .find(_.bind(Utils._didCollide, {n: n, newY: newY})) + .value(); + canBeMoved = typeof collisionNode == 'undefined'; + } + + if (!canBeMoved) { + break; + } + n._dirty = n.y != newY; + n.y = newY; + } + }, this)); + } + }; + + 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.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) { + node.width = 1; + } + + if (node.height < 1) { + node.height = 1; + } + + if (node.x < 0) { + node.x = 0; + } + + if (node.x + node.width > this.width) { + if (resizing) { + node.width = this.width - node.x; + } else { + node.x = this.width - node.width; + } + } + + if (node.y < 0) { + node.y = 0; + } + + return node; + }; + + GridStackEngine.prototype._notify = function() { + if (this._updateCounter) { + return; + } + var deletedNodes = Array.prototype.slice.call(arguments, 1).concat(this.getDirtyNodes()); + deletedNodes = deletedNodes.concat(this.getDirtyNodes()); + this.onchange(deletedNodes); + }; + + GridStackEngine.prototype.cleanNodes = function() { + _.each(this.nodes, function(n) {n._dirty = false; }); + }; + + GridStackEngine.prototype.getDirtyNodes = function() { + return _.filter(this.nodes, function(n) { return n._dirty; }); + }; + + GridStackEngine.prototype.addNode = function(node) { + node = this._prepareNode(node); + + 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 = ++idSeq; + node._dirty = true; + + if (node.autoPosition) { + this._sortNodes(); + + for (var i = 0;; ++i) { + var x = i % this.width; + var y = Math.floor(i / this.width); + if (x + node.width > this.width) { + continue; + } + if (!_.find(this.nodes, _.bind(Utils._isAddNodeIntercepted, {x: x, y: y, node: node}))) { + node.x = x; + node.y = y; + break; + } + } + } + + this.nodes.push(node); + + this._fixCollisions(node); + this._packNodes(); + this._notify(); + return node; + }; + + GridStackEngine.prototype.removeNode = function(node) { + node._id = null; + this.nodes = _.without(this.nodes, node); + this._packNodes(); + this._notify(node); + }; + + GridStackEngine.prototype.canMoveNode = function(node, x, y, width, height) { + var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; })); + + if (!this.height && !hasLocked) { + return true; + } + + var clonedNode; + var clone = new GridStackEngine( + this.width, + null, + this.float, + 0, + _.map(this.nodes, function(n) { + if (n == node) { + clonedNode = $.extend({}, n); + return clonedNode; + } + return $.extend({}, n); + })); + + clone.moveNode(clonedNode, x, y, width, height); + + var res = true; + + if (hasLocked) { + res &= !Boolean(_.find(clone.nodes, function(n) { + return n != clonedNode && Boolean(n.locked) && Boolean(n._dirty); + })); + } + if (this.height) { + res &= clone.getGridHeight() <= this.height; + } + + return res; + }; + + 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.addNode(node); + return clone.getGridHeight() <= this.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.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; + } + + var resizing = node.width != width; + node._dirty = true; + + node.x = x; + node.y = y; + node.width = width; + node.height = height; + + node = this._prepareNode(node, resizing); + + this._fixCollisions(node); + if (!noPack) { + this._packNodes(); + this._notify(); + } + return node; + }; + + GridStackEngine.prototype.getGridHeight = function() { + return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0); + }; + + GridStackEngine.prototype.beginUpdate = function(node) { + _.each(this.nodes, function(n) { + n._origY = n.y; + }); + node._updating = true; + }; + + GridStackEngine.prototype.endUpdate = function() { + _.each(this.nodes, function(n) { + n._origY = n.y; + }); + var n = _.find(this.nodes, function(n) { return n._updating; }); + if (n) { + n._updating = false; + } + }; + + var GridStack = function(el, opts) { + var self = this; + var oneColumnMode; + + opts = opts || {}; + + this.container = $(el); + + // 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, + itemClass: 'grid-stack-item', + placeholderClass: 'grid-stack-placeholder', + placeholderText: '', + handle: '.grid-stack-item-content', + handleClass: null, + cellHeight: 60, + verticalMargin: 20, + auto: true, + minWidth: 768, + float: false, + staticGrid: false, + _class: 'grid-stack-instance-' + (Math.random() * 10000).toFixed(0), + animate: Boolean(this.container.attr('data-gs-animate')) || false, + alwaysShowResizeHandle: opts.alwaysShowResizeHandle || false, + resizable: _.defaults(opts.resizable || {}, { + autoHide: !(opts.alwaysShowResizeHandle || false), + handles: 'se' + }), + draggable: _.defaults(opts.draggable || {}, { + handle: (opts.handleClass ? '.' + opts.handleClass : (opts.handle ? opts.handle : '')) || + '.grid-stack-item-content', + scroll: false, + appendTo: 'body' + }) + }); + this.opts.isNested = isNested; + + this.container.addClass(this.opts._class); + + this._setStaticClass(); + + if (isNested) { + this.container.addClass('grid-stack-nested'); + } + + this._initStyles(); + + this.grid = new GridStackEngine(this.opts.width, function(nodes) { + var maxHeight = 0; + _.each(nodes, function(n) { + if (n._id === null) { + n.el.remove(); + } 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); + maxHeight = Math.max(maxHeight, n.y + n.height); + } + }); + self._updateStyles(maxHeight + 10); + }, this.opts.float, this.opts.height); + + if (this.opts.auto) { + var elements = []; + var _this = this; + this.container.children('.' + this.opts.itemClass + ':not(.' + this.opts.placeholderClass + ')') + .each(function(index, el) { + el = $(el); + elements.push({ + el: el, + i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width + }); + }); + _.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) { + self._prepareElement(i.el); + }).value(); + } + + this.setAnimation(this.opts.animate); + + this.placeholder = $( + '
' + + '
' + this.opts.placeholderText + '
').hide(); + + this.container.height( + this.grid.getGridHeight() * (this.opts.cellHeight + this.opts.verticalMargin) - + this.opts.verticalMargin); + + this.onResizeHandler = function() { + if (self._isOneColumnMode()) { + if (oneColumnMode) { + return; + } + + oneColumnMode = true; + + self.grid._sortNodes(); + _.each(self.grid.nodes, function(node) { + self.container.append(node.el); + + if (self.opts.staticGrid) { + return; + } + if (!node.noMove) { + node.el.draggable('disable'); + } + if (!node.noResize) { + node.el.resizable('disable'); + } + }); + } else { + if (!oneColumnMode) { + return; + } + + oneColumnMode = false; + + if (self.opts.staticGrid) { + return; + } + + _.each(self.grid.nodes, function(node) { + if (!node.noMove) { + node.el.draggable('enable'); + } + if (!node.noResize) { + node.el.resizable('enable'); + } + }); + } + }; + + $(window).resize(this.onResizeHandler); + this.onResizeHandler(); + }; + + GridStack.prototype._triggerChangeEvent = function(forceTrigger) { + var elements = this.grid.getDirtyNodes(); + var hasChanges = false; + + var eventParams = []; + if (elements && elements.length) { + eventParams.push(elements); + hasChanges = true; + } + + if (hasChanges || forceTrigger === true) { + this.container.trigger('change', eventParams); + } + }; + + GridStack.prototype._initStyles = function() { + 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._updateStyles = function(maxHeight) { + if (this._styles === null) { + return; + } + + var prefix = '.' + this.opts._class + ' .' + this.opts.itemClass; + + if (typeof maxHeight == 'undefined') { + maxHeight = this._styles._max; + this._initStyles(); + this._updateContainerHeight(); + } + + if (this._styles._max === 0) { + Utils.insertCSSRule(this._styles, prefix, 'min-height: ' + (this.opts.cellHeight) + 'px;', 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.cellHeight * (i + 1) + this.opts.verticalMargin * i) + 'px;', + i + ); + Utils.insertCSSRule(this._styles, + prefix + '[data-gs-min-height="' + (i + 1) + '"]', + 'min-height: ' + (this.opts.cellHeight * (i + 1) + this.opts.verticalMargin * i) + 'px;', + i + ); + Utils.insertCSSRule(this._styles, + prefix + '[data-gs-max-height="' + (i + 1) + '"]', + 'max-height: ' + (this.opts.cellHeight * (i + 1) + this.opts.verticalMargin * i) + 'px;', + i + ); + Utils.insertCSSRule(this._styles, + prefix + '[data-gs-y="' + i + '"]', + 'top: ' + (this.opts.cellHeight * i + this.opts.verticalMargin * i) + 'px;', + i + ); + } + this._styles._max = maxHeight; + } + }; + + GridStack.prototype._updateContainerHeight = function() { + if (this.grid._updateCounter) { + return; + } + this.container.height( + this.grid.getGridHeight() * (this.opts.cellHeight + this.opts.verticalMargin) - + this.opts.verticalMargin); + }; + + GridStack.prototype._isOneColumnMode = function() { + return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= + this.opts.minWidth; + }; + + GridStack.prototype._prepareElement = function(el) { + var self = this; el = $(el); - el.each(function (index, el) { + + 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'), + 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.staticGrid) { + return; + } + + var cellWidth; + var cellHeight; + + 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.cleanNodes(); + self.grid.beginUpdate(node); + cellWidth = o.outerWidth() / o.attr('data-gs-width'); + cellHeight = self.opts.cellHeight + self.opts.verticalMargin; + self.placeholder + .attr('data-gs-x', o.attr('data-gs-x')) + .attr('data-gs-y', o.attr('data-gs-y')) + .attr('data-gs-width', o.attr('data-gs-width')) + .attr('data-gs-height', o.attr('data-gs-height')) + .show(); + node.el = self.placeholder; + + el.resizable('option', 'minWidth', Math.round(cellWidth * (node.minWidth || 1))); + el.resizable('option', 'minHeight', self.opts.cellHeight * (node.minHeight || 1)); + + if (event.type == 'resizestart') { + o.find('.grid-stack-item').trigger('resizestart'); + } + }; + + var onEndMoving = function(event, ui) { + self.placeholder.detach(); + var o = $(this); + node.el = o; + self.placeholder.hide(); + o + .attr('data-gs-x', node.x) + .attr('data-gs-y', node.y) + .attr('data-gs-width', node.width) + .attr('data-gs-height', node.height) + .removeAttr('style'); + self._updateContainerHeight(); + self._triggerChangeEvent(); + + 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, { + 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.noMove || this._isOneColumnMode()) { + el.draggable('disable'); + } + + if (node.noResize || this._isOneColumnMode()) { + el.resizable('disable'); + } + + el.attr('data-gs-locked', node.locked ? 'yes' : null); + }; + + GridStack.prototype.setAnimation = function(enable) { + if (enable) { + this.container.addClass('grid-stack-animate'); + } else { + this.container.removeClass('grid-stack-animate'); + } + }; + + 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 autoPosition != 'undefined') { el.attr('data-gs-auto-position', autoPosition ? 'yes' : null); } + this.container.append(el); + this._prepareElement(el); + this._updateContainerHeight(); + this._triggerChangeEvent(true); + + return el; + }; + + GridStack.prototype.makeWidget = function(el) { + el = $(el); + this._prepareElement(el); + this._updateContainerHeight(); + this._triggerChangeEvent(true); + + return el; + }; + + 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.removeNode(node); + el.removeData('_gridstack_node'); + this._updateContainerHeight(); + if (detachNode) { + el.remove(); + } + this._triggerChangeEvent(true); + }; + + GridStack.prototype.removeAll = function(detachNode) { + _.each(this.grid.nodes, _.bind(function(node) { + this.removeWidget(node.el, detachNode); + }, this)); + this.grid.nodes = []; + this._updateContainerHeight(); + }; + + GridStack.prototype.destroy = function() { + $(window).off('resize', this.onResizeHandler); + this.disable(); + this.container.remove(); + 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; } - if(!isNaN(val)){ - node.min_height = (val || false); + node.noResize = !(val || false); + if (node.noResize || self._isOneColumnMode()) { + el.resizable('disable'); + } else { + el.resizable('enable'); + } + }); + return this; + }; + + 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) { + return; + } + + node.noMove = !(val || false); + if (node.noMove || self._isOneColumnMode()) { + el.draggable('disable'); + 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.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.itemClass), true); + this.resizable(this.container.children('.' + this.opts.itemClass), true); + this.container.trigger('enable'); + }; + + GridStack.prototype.locked = 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; + } + + node.locked = (val || false); + el.attr('data-gs-locked', node.locked ? 'yes' : null); + }); + return this; + }; + + 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.minHeight = (val || false); el.attr('data-gs-min-height', val); } }); return this; }; - GridStack.prototype.min_width = function (el, val) { + GridStack.prototype.minWidth = function(el, val) { el = $(el); - el.each(function (index, el) { + el.each(function(index, el) { el = $(el); var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { + if (typeof node == 'undefined' || node === null) { return; } - if(!isNaN(val)){ - node.min_width = (val || false); + if (!isNaN(val)) { + node.minWidth = (val || false); el.attr('data-gs-min-width', val); } }); return this; }; - GridStack.prototype._update_element = function(el, callback) { - el = $(el).first(); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node == null) { - return; - } + GridStack.prototype._updateElement = function(el, callback) { + el = $(el).first(); + var node = el.data('_gridstack_node'); + if (typeof node == 'undefined' || node === null) { + return; + } - var self = this; + var self = this; - self.grid.clean_nodes(); - self.grid.begin_update(node); + self.grid.cleanNodes(); + self.grid.beginUpdate(node); - callback.call(this, el, 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; + GridStack.prototype.resize = function(el, width, 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; + GridStack.prototype.move = function(el, x, 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; + GridStack.prototype.update = function(el, x, y, width, 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; - } - val = parseInt(val); - if (val == this.opts.cell_height) - return; - this.opts.cell_height = val || this.opts.cell_height; - this._update_styles(); - }; + GridStack.prototype.cellHeight = function(val) { + if (typeof val == 'undefined') { + return this.opts.cellHeight; + } + val = parseInt(val); + if (val == this.opts.cellHeight) { + return; + } + this.opts.cellHeight = val || this.opts.cellHeight; + this._updateStyles(); + }; - GridStack.prototype.cell_width = function() { - var o = this.container.children('.' + this.opts.item_class).first(); - return Math.ceil(o.outerWidth() / o.attr('data-gs-width')); - }; + 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) { - var containerPos = this.container.position(); - var relativeLeft = position.left - containerPos.left; - var relativeTop = position.top - containerPos.top; + 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 = this.opts.cellHeight + this.opts.verticalMargin; - 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(); - }; + GridStack.prototype.commit = function() { + this.grid.commit(); + 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); - } else { - this.container.removeClass(static_class_name); - } - }; + if (this.opts.staticGrid === true) { + this.container.addClass(staticClassName); + } else { + this.container.removeClass(staticClassName); + } + }; - scope.GridStackUI = GridStack; + // 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.Utils = Utils; + scope.GridStackUI = GridStack; - $.fn.gridstack = function(opts) { - return this.each(function() { - var o = $(this); - if (!o.data('gridstack')) { - o - .data('gridstack', new GridStack(this, opts)); - } - }); - }; + scope.GridStackUI.Utils = Utils; - return scope.GridStackUI; + $.fn.gridstack = function(opts) { + return this.each(function() { + var o = $(this); + if (!o.data('gridstack')) { + o + .data('gridstack', new GridStack(this, opts)); + } + }); + }; + + return scope.GridStackUI; }); From 7bcbeba84908451293e13119e38e6316128fce91 Mon Sep 17 00:00:00 2001 From: d Date: Wed, 17 Feb 2016 16:07:40 -0500 Subject: [PATCH 58/67] Added previous PR. --- src/gridstack.js | 132 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 107 insertions(+), 25 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index ac1d889..e3f0ddc 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -513,6 +513,9 @@ }); this.opts.isNested = isNested; + this.cellHeight(this.opts.cellHeight, true); + this.verticalMargin(this.opts.verticalMargin, true); + this.container.addClass(this.opts._class); this._setStaticClass(); @@ -562,9 +565,7 @@ '
' + '
' + this.opts.placeholderText + '
').hide(); - this.container.height( - this.grid.getGridHeight() * (this.opts.cellHeight + this.opts.verticalMargin) - - this.opts.verticalMargin); + this._updateContainerHeight(); this.onResizeHandler = function() { if (self._isOneColumnMode()) { @@ -630,6 +631,9 @@ }; GridStack.prototype._initStyles = function() { + if (!this.opts.cellHeight) { //that will be handled by CSS + return ; + } if (this._stylesId) { $('[data-gs-id="' + this._stylesId + '"]').remove(); } @@ -646,37 +650,59 @@ } var prefix = '.' + this.opts._class + ' .' + this.opts.itemClass; + var self = this; + var getHeight; 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.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 (this._styles._max === 0) { - Utils.insertCSSRule(this._styles, prefix, 'min-height: ' + (this.opts.cellHeight) + 'px;', 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.cellHeight * (i + 1) + this.opts.verticalMargin * i) + 'px;', + 'height: ' + getHeight(i + 1, i) + ';', i ); Utils.insertCSSRule(this._styles, prefix + '[data-gs-min-height="' + (i + 1) + '"]', - 'min-height: ' + (this.opts.cellHeight * (i + 1) + this.opts.verticalMargin * i) + 'px;', + 'min-height: ' + getHeight(i + 1, i) + ';', i ); Utils.insertCSSRule(this._styles, prefix + '[data-gs-max-height="' + (i + 1) + '"]', - 'max-height: ' + (this.opts.cellHeight * (i + 1) + this.opts.verticalMargin * i) + 'px;', + 'max-height: ' + getHeight(i + 1, i) + ';', i ); Utils.insertCSSRule(this._styles, prefix + '[data-gs-y="' + i + '"]', - 'top: ' + (this.opts.cellHeight * i + this.opts.verticalMargin * i) + 'px;', + 'top: ' + getHeight(i, i) + ';', i ); } @@ -688,9 +714,20 @@ if (this.grid._updateCounter) { return; } - this.container.height( - this.grid.getGridHeight() * (this.opts.cellHeight + this.opts.verticalMargin) - - this.opts.verticalMargin); + 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._isOneColumnMode = function() { @@ -749,8 +786,9 @@ var o = $(this); self.grid.cleanNodes(); self.grid.beginUpdate(node); - cellWidth = o.outerWidth() / o.attr('data-gs-width'); - cellHeight = self.opts.cellHeight + self.opts.verticalMargin; + 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')) @@ -759,8 +797,8 @@ .show(); node.el = self.placeholder; - el.resizable('option', 'minWidth', Math.round(cellWidth * (node.minWidth || 1))); - el.resizable('option', 'minHeight', self.opts.cellHeight * (node.minHeight || 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'); @@ -958,7 +996,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; } @@ -975,7 +1013,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; } @@ -1036,16 +1074,60 @@ }); }; - GridStack.prototype.cellHeight = function(val) { + 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.cellHeight; + return this.opts.verticalMargin; } - val = parseInt(val); - if (val == this.opts.cellHeight) { - return; + + var heightData = parseHeight(val); + + if (this.opts.verticalMarginUnit === heightData.unit && this.opts.height === heightData.height) { + return ; } - this.opts.cellHeight = val || this.opts.cellHeight; - this._updateStyles(); + this.opts.verticalMarginUnit = heightData.unit; + this.opts.verticalMargin = heightData.height; + + if (!noUpdate) { + this._updateStyles(); + } + }; + + 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() { @@ -1059,7 +1141,7 @@ var relativeTop = position.top - containerPos.top; var columnWidth = Math.floor(this.container.width() / this.opts.width); - var rowHeight = this.opts.cellHeight + this.opts.verticalMargin; + var rowHeight = Math.floor(this.container.height() / parseInt(this.container.attr('data-gs-current-height'))); return {x: Math.floor(relativeLeft / columnWidth), y: Math.floor(relativeTop / rowHeight)}; }; From a654096a39ee2f74efcf28649c6182cff462cd32 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 17 Feb 2016 18:35:37 -0800 Subject: [PATCH 59/67] remove `static` from serialization demo grid --- demo/serialization.html | 1 - 1 file changed, 1 deletion(-) diff --git a/demo/serialization.html b/demo/serialization.html index 06ddbc6..aca9d32 100644 --- a/demo/serialization.html +++ b/demo/serialization.html @@ -56,7 +56,6 @@ ``` +## 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 +- `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`). Can be: +- `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. You need also update your css file (`@media (max-width: 768px) {...}`) with corresponding value (default: `768`) -- `placeholder_class` - class for placeholder (default: `'grid-stack-placeholder'`) -- `placeholder_text` - placeholder default content (default: `''`) +- `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`). Can be: +- `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`) @@ -204,12 +211,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); }); ``` @@ -267,7 +274,7 @@ $('.grid-stack').on('enable', function(event) { ## API -### add_widget(el, x, y, width, height, auto_position) +### addWidget(el, x, y, width, height, autoPosition) Creates new widget and returns it. @@ -275,7 +282,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 @@ -285,10 +292,10 @@ 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); ``` -### make_widget(el) +### makeWidget(el) 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. @@ -302,33 +309,33 @@ $('.grid-stack').gridstack(); $('.grid-stack').append('
') var grid = $('.grid-stack').data('gridstack'); -grid.make_widget('gsi-1'); +grid.makeWidget('gsi-1'); ``` -### batch_update() +### batchUpdate() 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.cell_width() * 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() @@ -352,7 +359,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. @@ -362,7 +369,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. @@ -373,14 +380,14 @@ Locks/unlocks widget. - `el` - widget to modify. - `val` - if `true` widget will be locked. -### min_width(el, val) +### minWidth(el, val) Set the minWidth for a widget. - `el` - widget to modify. - `val` - A numeric value of the number of columns -### min_height(el, val) +### minHeight(el, val) Set the minHeight for a widget. @@ -403,16 +410,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. @@ -432,7 +439,7 @@ Enables/Disables resizing. - `el` - widget to modify - `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. @@ -448,14 +455,14 @@ 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'); @@ -487,7 +494,7 @@ working on touch-based devices. ``` -Also `always_show_resize_handle` option may be useful: +Also `alwaysShowResizeHandle` option may be useful: ```javascript $(function () { @@ -517,9 +524,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); }); }; }; @@ -695,10 +702,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); }); ``` @@ -781,6 +788,7 @@ Changes #### v0.2.5-dev (Development version) - `cell_height` and `vertical_margin` can now be string (e.g. '3em', '20px') (Thanks to @jlowcs) +- update names to respect js naming convention #### v0.2.4 (2016-02-15) From 1527485f75ebe885fd7b65961db37820bf278a8e Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 17 Feb 2016 18:48:03 -0800 Subject: [PATCH 63/67] update demo --- demo/float.html | 7 ++++--- demo/knockout.html | 14 ++++++++------ demo/knockout2.html | 14 ++++++++------ demo/serialization.html | 31 +++++++++++++++++-------------- demo/two.html | 2 +- 5 files changed, 38 insertions(+), 30 deletions(-) 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 aca9d32..b8484ea 100644 --- a/demo/serialization.html +++ b/demo/serialization.html @@ -60,7 +60,7 @@ $('.grid-stack').gridstack(options); new function () { - this.serialized_data = [ + this.serializedData = [ {x: 0, y: 0, width: 2, height: 2}, {x: 3, y: 1, width: 1, height: 2}, {x: 4, y: 1, width: 1, height: 1}, @@ -73,17 +73,18 @@ this.grid = $('.grid-stack').data('gridstack'); - this.load_grid = function () { - this.grid.remove_all(); - var items = GridStackUI.Utils.sort(this.serialized_data); + this.loadGrid = function () { + this.grid.removeAll(); + var items = GridStackUI.Utils.sort(this.serializedData); _.each(items, function (node) { - this.grid.add_widget($('
'), + this.grid.addWidget($('
'), node.x, node.y, node.width, node.height); }, this); + return false; }.bind(this); - this.save_grid = function () { - this.serialized_data = _.map($('.grid-stack > .grid-stack-item:visible'), function (el) { + this.saveGrid = function () { + this.serializedData = _.map($('.grid-stack > .grid-stack-item:visible'), function (el) { el = $(el); var node = el.data('_gridstack_node'); return { @@ -93,18 +94,20 @@ height: node.height }; }, this); - $('#saved-data').val(JSON.stringify(this.serialized_data, null, ' ')); + $('#saved-data').val(JSON.stringify(this.serializedData, null, ' ')); + return false; }.bind(this); - this.clear_grid = function () { - this.grid.remove_all(); + this.clearGrid = function () { + this.grid.removeAll(); + return false; }.bind(this); - $('#save-grid').click(this.save_grid); - $('#load-grid').click(this.load_grid); - $('#clear-grid').click(this.clear_grid); + $('#save-grid').click(this.saveGrid); + $('#load-grid').click(this.loadGrid); + $('#clear-grid').click(this.clearGrid); - this.load_grid(); + this.loadGrid(); }; }); 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); }); From 29857f41312e69d76d1d1eaef75a3e8a00b6661d Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 17 Feb 2016 18:50:59 -0800 Subject: [PATCH 64/67] update doc to be all functions in alphabetical order --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 21f87ac..e51328f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com - [enable(event)](#enableevent) - [API](#api) - [addWidget(el, x, y, width, height, autoPosition)](#addwidgetel-x-y-width-height-autoposition) - - [makeWidget(el)](#makewidgetel) - [batchUpdate()](#batchupdate) - [cellHeight()](#cellheight) - [cellHeight(val)](#cellheightval) @@ -45,6 +44,7 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com - [getCellFromPixel(position)](#getcellfrompixelposition) - [isAreaEmpty(x, y, width, height)](#isareaemptyx-y-width-height) - [locked(el, val)](#lockedel-val) + - [makeWidget(el)](#makewidgetel) - [minWidth(el, val)](#minwidthel-val) - [minHeight(el, val)](#minheightel-val) - [movable(el, val)](#movableel-val) @@ -295,23 +295,6 @@ var grid = $('.grid-stack').data('gridstack'); grid.addWidget(el, 0, 0, 3, 2, true); ``` -### makeWidget(el) - -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'); -``` - ### batchUpdate() Initailizes batch updates. You will see no changes until `commit` method is called. @@ -380,6 +363,23 @@ Locks/unlocks widget. - `el` - widget to modify. - `val` - if `true` widget will be locked. +### makeWidget(el) + +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'); +``` + ### minWidth(el, val) Set the minWidth for a widget. From 02f0eba64dfa821ec57228d79bbeeddcbdfcccce Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 17 Feb 2016 19:03:21 -0800 Subject: [PATCH 65/67] add maxWidth/maxHeight --- README.md | 31 ++++++++++++++++++++++++------- dist/gridstack.js | 34 ++++++++++++++++++++++++++++++++++ dist/gridstack.min.js | 2 +- dist/gridstack.min.map | 2 +- src/gridstack.js | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e51328f..4f3539c 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,10 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com - [isAreaEmpty(x, y, width, height)](#isareaemptyx-y-width-height) - [locked(el, val)](#lockedel-val) - [makeWidget(el)](#makewidgetel) - - [minWidth(el, val)](#minwidthel-val) + - [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) - [removeWidget(el, detachNode)](#removewidgetel-detachnode) @@ -380,19 +382,33 @@ var grid = $('.grid-stack').data('gridstack'); grid.makeWidget('gsi-1'); ``` -### minWidth(el, val) +### maxHeight(el, val) -Set the minWidth for a widget. +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 -### minHeight(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) @@ -787,8 +803,9 @@ Changes #### v0.2.5-dev (Development version) -- `cell_height` and `vertical_margin` can now be string (e.g. '3em', '20px') (Thanks to @jlowcs) - 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) diff --git a/dist/gridstack.js b/dist/gridstack.js index 7396fe5..73bdd28 100644 --- a/dist/gridstack.js +++ b/dist/gridstack.js @@ -991,6 +991,23 @@ return this; }; + 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.maxHeight = (val || false); + el.attr('data-gs-max-height', val); + } + }); + return this; + }; + GridStack.prototype.minHeight = function(el, val) { el = $(el); el.each(function(index, el) { @@ -1008,6 +1025,23 @@ return this; }; + 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) { diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index 2b5b230..7c982de 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -12,5 +12,5 @@ g.is_intercepted=e(g.isIntercepted,"is_intercepted","isIntercepted"),g.create_st 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.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.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}); +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 5527ac9..f2b6988 100644 --- a/dist/gridstack.min.map +++ b/dist/gridstack.min.map @@ -1 +1 @@ -{"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,MAAOC,IAC3C,IAAMC,EAAIF,QAAQ,UAAa,MAAOC,IACtCN,EAAQI,OAAQG,OAEhBP,GAAQI,OAAQG,IAErB,SAASC,EAAGD,GAkiCX,QAASE,GAAYC,GACjB,GAAIC,GAASD,EACTE,EAAa,IACjB,IAAID,GAAUJ,EAAEM,SAASF,GAAS,CAC9B,GAAIG,GAAQH,EAAOG,MAAM,yBACzB,KAAKA,EACD,KAAM,IAAIC,OAAM,iBAEpBH,GAAaE,EAAM,GACnBH,EAASK,SAASF,EAAM,IAE5B,OAAQH,OAAQA,EAAQM,KAAML,GA3iClC,GAAIM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H,UAAU2R,WAAarS,EAASiI,EAAUvH,UAAUsM,UAC1D,aAAc,aAClB/E,EAAUvH,UAAU4R,oBAAsBtS,EAASiI,EAAUvH,UAAUoP,iBACnE,sBAAuB,oBAC3B7H,EAAUvH,UAAU6P,aAAevQ,EAASiI,EAAUvH,UAAU6D,YAC5D,eAAgB,eACpB0D,EAAUvH,UAAU+P,cAAgBzQ,EAASiI,EAAUvH,UAAUyE,YAC7D,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 +{"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,MAAOC,IAC3C,IAAMC,EAAIF,QAAQ,UAAa,MAAOC,IACtCN,EAAQI,OAAQG,OAEhBP,GAAQI,OAAQG,IAErB,SAASC,EAAGD,GAokCX,QAASE,GAAYC,GACjB,GAAIC,GAASD,EACTE,EAAa,IACjB,IAAID,GAAUJ,EAAEM,SAASF,GAAS,CAC9B,GAAIG,GAAQH,EAAOG,MAAM,yBACzB,KAAKA,EACD,KAAM,IAAIC,OAAM,iBAEpBH,GAAaE,EAAM,GACnBH,EAASK,SAASF,EAAM,IAE5B,OAAQH,OAAQA,EAAQM,KAAML,GA7kClC,GAAIM,GAAQC,OAERC,EAAW,SAASC,EAAGC,EAASC,GAChC,GAAIC,GAAU,WAGV,MAFAC,SAAQC,KAAK,2BAA6BJ,EAAU,4DAChDC,EAAU,iDACPF,EAAEM,MAAMC,KAAMC,WAIzB,OAFAL,GAAQM,UAAYT,EAAES,UAEfN,GAGPO,EAAe,SAAST,EAASC,GACjCE,QAAQC,KAAK,yBAA2BJ,EAAU,4DAC9CC,EAAU,kDAGdS,GACAC,cAAe,SAASC,EAAGC,GACvB,QAASD,EAAEE,EAAIF,EAAEG,OAASF,EAAEC,GAAKD,EAAEC,EAAID,EAAEE,OAASH,EAAEE,GAAKF,EAAEI,EAAIJ,EAAEvB,QAAUwB,EAAEG,GAAKH,EAAEG,EAAIH,EAAExB,QAAUuB,EAAEI,IAG1GC,KAAM,SAASC,EAAOC,EAAKJ,GAGvB,MAFAA,GAAQA,GAAS9B,EAAEmC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,UAAUsI,WAC3D,cAAe,cACnBf,EAAUvH,UAAU2R,WAAarS,EAASiI,EAAUvH,UAAUsM,UAC1D,aAAc,aAClB/E,EAAUvH,UAAU4R,oBAAsBtS,EAASiI,EAAUvH,UAAUoP,iBACnE,sBAAuB,oBAC3B7H,EAAUvH,UAAU6P,aAAevQ,EAASiI,EAAUvH,UAAU6D,YAC5D,eAAgB,eACpB0D,EAAUvH,UAAU+P,cAAgBzQ,EAASiI,EAAUvH,UAAUyE,YAC7D,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/src/gridstack.js b/src/gridstack.js index 7396fe5..73bdd28 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -991,6 +991,23 @@ return this; }; + 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.maxHeight = (val || false); + el.attr('data-gs-max-height', val); + } + }); + return this; + }; + GridStack.prototype.minHeight = function(el, val) { el = $(el); el.each(function(index, el) { @@ -1008,6 +1025,23 @@ return this; }; + 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) { From fe865db46004d270eec012c09766b9c0231dd3e8 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 17 Feb 2016 19:23:49 -0800 Subject: [PATCH 66/67] remove knockout.js from requirements --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 4f3539c..09e8d5f 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,6 @@ Usage * [lodash.js](https://lodash.com) (>= 3.5.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 From a4540dc118a1ba14d06513b652e0a566a431e3a5 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Wed, 17 Feb 2016 22:30:54 -0800 Subject: [PATCH 67/67] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09e8d5f..d76fd7d 100644 --- a/README.md +++ b/README.md @@ -310,7 +310,7 @@ Update current cell height. This method rebuilds an internal CSS stylesheet. Not call this method too often. ```javascript -grid.cellHeight(grid.cell_width() * 1.2); +grid.cellHeight(grid.cellWidth() * 1.2); ``` ### cellWidth()