diff --git a/README.md b/README.md index b6d4028..75e67bc 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Inspired by [gridster.js](http://gridster.net). Built with love. - [Load grid from array](#load-grid-from-array) - [Override resizable/draggable options](#override-resizabledraggable-options) - [IE8 support](#ie8-support) + - [Nested grids](#nested-grids) - [Changes](#changes) - [v0.2.3 (development version)](#v023-development-version) - [v0.2.2 (2014-12-23)](#v022-2014-12-23) @@ -621,6 +622,13 @@ There are at least two more issues with gridstack in IE8 with jQueryUI resizable 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. +See example: [Nested grid demo](http://troolee.github.io/gridstack.js/demo/nested.html) + + Changes ======= diff --git a/demo/nested.html b/demo/nested.html new file mode 100644 index 0000000..156a2ed --- /dev/null +++ b/demo/nested.html @@ -0,0 +1,81 @@ + + + + + + + + + Nested grids demo + + + + + + + + + + + + + + +
+

Nested grids demo

+ +
+
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque eius eligendi eos fuga magnam numquam perferendis provident quos rem. Asperiores assumenda dolor error eveniet impedit nihil numquam provident repellat ullam. +
+
+
+
+ +
+
1
+
2
+
3
+
4
+ +
5
+
6
+
+ +
+
+
+
+ + + + + diff --git a/dist/gridstack.min.css b/dist/gridstack.min.css index c96367d..a964730 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;overflow:auto}.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: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;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 diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js index a50d981..225446c 100644 --- a/dist/gridstack.min.js +++ b/dist/gridstack.min.js @@ -1,2 +1,2 @@ -!function(t){"function"==typeof define&&define.amd?define(["jquery","underscore"],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},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)}},o=0,s=function(t,e,i,n,o){this.width=t,this["float"]=i||!1,this.height=n||0,this.nodes=o||[],this.onchange=e||function(){},this._update_counter=0,this._float=this["float"]};s.prototype.batch_update=function(){this._update_counter=1,this["float"]=!0},s.prototype.commit=function(){this._update_counter=0,0==this._update_counter&&(this["float"]=this._float,this._pack_nodes(),this._notify())},s.prototype._fix_collisions=function(t){this._sort_nodes(-1);var i=t,o=Boolean(e.find(this.nodes,function(t){return t.locked}));for(this["float"]||o||(i={x:0,y:t.y,width:this.width,height:t.height});;){var s=e.find(this.nodes,function(e){return e!=t&&n.is_intercepted(e,i)},this);if("undefined"==typeof s)return;this.move_node(s,s.x,t.y+t.height,s.width,s.height,!0)}},s.prototype._sort_nodes=function(t){this.nodes=n.sort(this.nodes,t,this.width)},s.prototype._pack_nodes=function(){this._sort_nodes(),this["float"]?e.each(this.nodes,function(t){if(!t._updating&&"undefined"!=typeof t._orig_y&&t.y!=t._orig_y)for(var i=t.y;i>=t._orig_y;){var o=e.chain(this.nodes).find(function(e){return t!=e&&n.is_intercepted({x:t.x,y:i,width:t.width,height:t.height},e)}).value();o||(t._dirty=!0,t.y=i),--i}},this):e.each(this.nodes,function(t,i){if(!t.locked)for(;t.y>0;){var o=t.y-1,s=0==i;if(i>0){var a=e.chain(this.nodes).first(i).find(function(e){return n.is_intercepted({x:t.x,y:o,width:t.width,height:t.height},e)}).value();s="undefined"==typeof a}if(!s)break;t._dirty=t.y!=o,t.y=o}},this)},s.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},s.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)}},s.prototype.clean_nodes=function(){e.each(this.nodes,function(t){t._dirty=!1})},s.prototype.get_dirty_nodes=function(){return e.filter(this.nodes,function(t){return t._dirty})},s.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=++o,t._dirty=!0,t.auto_position){this._sort_nodes();for(var i=0;;++i){var s=i%this.width,a=Math.floor(i/this.width);if(!(s+t.width>this.width||e.find(this.nodes,function(e){return n.is_intercepted({x:s,y:a,width:t.width,height:t.height},e)}))){t.x=s,t.y=a;break}}}return this.nodes.push(t),this._fix_collisions(t),this._pack_nodes(),this._notify(),t},s.prototype.remove_node=function(t){t._id=null,this.nodes=e.without(this.nodes,t),this._pack_nodes(),this._notify(t)},s.prototype.can_move_node=function(i,n,o,a,h){var d=Boolean(e.find(this.nodes,function(t){return t.locked}));if(!this.height&&!d)return!0;var r,_=new s(this.width,null,this["float"],0,e.map(this.nodes,function(e){return e==i?r=t.extend({},e):t.extend({},e)}));_.move_node(r,n,o,a,h);var l=!0;return d&&(l&=!Boolean(e.find(_.nodes,function(t){return t!=r&&Boolean(t.locked)&&Boolean(t._dirty)}))),this.height&&(l&=_.get_grid_height()<=this.height),l},s.prototype.can_be_placed_with_respect_to_height=function(i){if(!this.height)return!0;var n=new s(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},s.prototype.move_node=function(t,e,i,n,o,s){if("number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof n&&(n=t.width),"number"!=typeof o&&(o=t.height),"undefined"!=typeof t.max_width&&(n=Math.min(n,t.max_width)),"undefined"!=typeof t.max_height&&(o=Math.min(o,t.max_height)),"undefined"!=typeof t.min_width&&(n=Math.max(n,t.min_width)),"undefined"!=typeof t.min_height&&(o=Math.max(o,t.min_height)),t.x==e&&t.y==i&&t.width==n&&t.height==o)return t;var a=t.width!=n;return t._dirty=!0,t.x=e,t.y=i,t.width=n,t.height=o,t=this._prepare_node(t,a),this._fix_collisions(t),s||(this._pack_nodes(),this._notify()),t},s.prototype.get_grid_height=function(){return e.reduce(this.nodes,function(t,e){return Math.max(t,e.y+e.height)},0)},s.prototype.begin_update=function(t){e.each(this.nodes,function(t){t._orig_y=t.y}),t._updating=!0},s.prototype.end_update=function(){var t=e.find(this.nodes,function(t){return t._updating});t&&(t._updating=!1)};var a=function(i,n){var o,a=this;if(this.container=t(i),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",cell_height:60,vertical_margin:20,auto:!0,min_width:768,"float":!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:".grid-stack-item-content",scroll:!0,appendTo:"body"})}),this.container.addClass(this.opts._class),this._init_styles(),this.grid=new s(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 h=[];this.container.find("."+this.opts.item_class).each(function(e,i){i=t(i),h.push({el:i,i:parseInt(i.attr("data-gs-x"))+parseInt(i.attr("data-gs-y"))*parseInt(i.attr("data-gs-width"))})}),e.chain(h).sortBy(function(t){return t.i}).each(function(t){a._prepare_element(t.el)})}this.set_animation(this.opts.animate),this.placeholder=t('
').hide(),this.container.append(this.placeholder),this.container.height(this.grid.get_grid_height()*(this.opts.cell_height+this.opts.vertical_margin)-this.opts.vertical_margin);var d=function(){if(a._is_one_column_mode()){if(o)return;o=!0,a.grid._sort_nodes(),e.each(a.grid.nodes,function(t){a.container.append(t.el),t.no_move||t.el.draggable("disable"),t.no_resize||t.el.resizable("disable")})}else{if(!o)return;o=!1,e.each(a.grid.nodes,function(t){t.no_move||t.el.draggable("enable"),t.no_resize||t.el.resizable("enable")})}};t(window).resize(d),d()};return 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 t(window).width()<=this.opts.min_width},a.prototype._prepare_element=function(i){var o=this;i=t(i),i.addClass(this.opts.item_class);var s=o.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});i.data("_gridstack_node",s);var a,h,d=function(){var e=t(this);o.grid.clean_nodes(),o.grid.begin_update(s),a=Math.ceil(e.outerWidth()/e.attr("data-gs-width")),h=o.opts.cell_height+o.opts.vertical_margin,o.placeholder.attr("data-gs-x",e.attr("data-gs-x")).attr("data-gs-y",e.attr("data-gs-y")).attr("data-gs-width",e.attr("data-gs-width")).attr("data-gs-height",e.attr("data-gs-height")).show(),s.el=o.placeholder},r=function(){var e=t(this);s.el=e,o.placeholder.hide(),e.attr("data-gs-x",s.x).attr("data-gs-y",s.y).attr("data-gs-width",s.width).attr("data-gs-height",s.height).removeAttr("style"),o._update_container_height(),o.container.trigger("change",[o.grid.get_dirty_nodes()]),o.grid.end_update()};i.draggable(e.extend(this.opts.draggable,{start:d,stop:r,drag:function(t,e){var i=Math.round(e.position.left/a),n=Math.floor((e.position.top+h/2)/h);o.grid.can_move_node(s,i,n,s.width,s.height)&&(o.grid.move_node(s,i,n),o._update_container_height())}})).resizable(e.extend(this.opts.resizable,{start:d,stop:r,resize:function(t,e){var i=Math.round(e.position.left/a),n=Math.floor((e.position.top+h/2)/h),d=Math.round(e.size.width/a),r=Math.round(e.size.height/h);o.grid.can_move_node(s,i,n,d,r)&&(o.grid.move_node(s,i,n,d,r),o._update_container_height())}})),(s.no_move||this._is_one_column_mode())&&i.draggable("disable"),(s.no_resize||this._is_one_column_mode())&&i.resizable("disable"),i.attr("data-gs-locked",s.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,o,s,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 o&&e.attr("data-gs-width",o),"undefined"!=typeof s&&e.attr("data-gs-height",s),"undefined"!=typeof a&&e.attr("data-gs-auto-position",a?"yes":null),this.container.append(e),this._prepare_element(e),this._update_container_height(),e},a.prototype.will_it_fit=function(t,e,i,n,o){var s={x:t,y:e,width:i,height:n,auto_position:o};return this.grid.can_be_placed_with_respect_to_height(s)},a.prototype.remove_widget=function(e){e=t(e);var i=e.data("_gridstack_node");this.grid.remove_node(i),e.remove(),this._update_container_height()},a.prototype.remove_all=function(){e.each(this.grid.nodes,function(t){t.el.remove()}),this.grid.nodes=[],this._update_container_height()},a.prototype.resizable=function(e,i){return e=t(e),e.each(function(e,n){n=t(n);var o=n.data("_gridstack_node");"undefined"!=typeof o&&(o.no_resize=!i,n.resizable(o.no_resize?"disable":"enable"))}),this},a.prototype.movable=function(e,i){return e=t(e),e.each(function(e,n){n=t(n);var o=n.data("_gridstack_node");"undefined"!=typeof o&&(o.no_move=!i,n.draggable(o.no_move?"disable":"enable"))}),this},a.prototype.disable=function(){this.movable(this.container.find("."+this.opts.item_class),!1),this.resizable(this.container.find("."+this.opts.item_class),!1)},a.prototype.enable=function(){this.movable(this.container.find("."+this.opts.item_class),!0),this.resizable(this.container.find("."+this.opts.item_class),!0)},a.prototype.locked=function(e,i){return e=t(e),e.each(function(e,n){n=t(n);var o=n.data("_gridstack_node");"undefined"!=typeof o&&(o.locked=i||!1,n.attr("data-gs-locked",o.locked?"yes":null))}),this},a.prototype._update_element=function(e,i){e=t(e).first();var n=e.data("_gridstack_node");if("undefined"!=typeof n){var o=this;o.grid.clean_nodes(),o.grid.begin_update(n),i.call(this,e,n),o._update_container_height(),o.container.trigger("change",[o.grid.get_dirty_nodes()]),o.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,o){this._update_element(t,function(t,s){e=null!=e&&"undefined"!=typeof e?e:s.x,i=null!=i&&"undefined"!=typeof i?i:s.y,n=null!=n&&"undefined"!=typeof n?n:s.width,o=null!=o&&"undefined"!=typeof o?o:s.height,this.grid.move_node(s,e,i,n,o)})},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.find("."+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,o=Math.floor(this.container.width()/this.opts.width),s=this.opts.cell_height+this.opts.vertical_margin;return{x:Math.floor(i/o),y:Math.floor(n/s)}},a.prototype.batch_update=function(){this.grid.batch_update()},a.prototype.commit=function(){this.grid.commit(),this._update_container_height()},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){"function"==typeof define&&define.amd?define(["jquery","underscore"],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},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._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){if(!t._updating&&"undefined"!=typeof t._orig_y&&t.y!=t._orig_y)for(var i=t.y;i>=t._orig_y;){var s=e.chain(this.nodes).find(function(e){return t!=e&&n.is_intercepted({x:t.x,y:i,width:t.width,height:t.height},e)}).value();s||(t._dirty=!0,t.y=i),--i}},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).first(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 d=Boolean(e.find(this.nodes,function(t){return t.locked}));if(!this.height&&!d)return!0;var r,_=new o(this.width,null,this["float"],0,e.map(this.nodes,function(e){return e==i?r=t.extend({},e):t.extend({},e)}));_.move_node(r,n,s,a,h);var l=!0;return d&&(l&=!Boolean(e.find(_.nodes,function(t){return t!=r&&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(){var t=e.find(this.nodes,function(t){return t._updating});t&&(t._updating=!1)};var a=function(i,n){var s,a=this;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",cell_height:60,vertical_margin:20,auto:!0,min_width:768,"float":!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:".grid-stack-item-content",scroll:!1,appendTo:"body"})}),this.opts.is_nested=h,this.container.addClass(this.opts._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 d=[];this.container.children("."+this.opts.item_class).each(function(e,i){i=t(i),d.push({el:i,i:parseInt(i.attr("data-gs-x"))+parseInt(i.attr("data-gs-y"))*parseInt(i.attr("data-gs-width"))})}),e.chain(d).sortBy(function(t){return t.i}).each(function(t){a._prepare_element(t.el)})}this.set_animation(this.opts.animate),this.placeholder=t('
').hide(),this.container.append(this.placeholder),this.container.height(this.grid.get_grid_height()*(this.opts.cell_height+this.opts.vertical_margin)-this.opts.vertical_margin);var r=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),t.no_move||t.el.draggable("disable"),t.no_resize||t.el.resizable("disable")})}else{if(!s)return;s=!1,e.each(a.grid.nodes,function(t){t.no_move||t.el.draggable("enable"),t.no_resize||t.el.resizable("enable")})}};t(window).resize(r),r()};return 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 t(window).width()<=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});i.data("_gridstack_node",o);var a,h,d=function(){var e=t(this);s.grid.clean_nodes(),s.grid.begin_update(o),a=Math.ceil(e.outerWidth()/e.attr("data-gs-width")),h=s.opts.cell_height+s.opts.vertical_margin,s.placeholder.attr("data-gs-x",e.attr("data-gs-x")).attr("data-gs-y",e.attr("data-gs-y")).attr("data-gs-width",e.attr("data-gs-width")).attr("data-gs-height",e.attr("data-gs-height")).show(),o.el=s.placeholder},r=function(){var e=t(this);o.el=e,s.placeholder.hide(),e.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.container.trigger("change",[s.grid.get_dirty_nodes()]),s.grid.end_update()};i.draggable(e.extend(this.opts.draggable,{start:d,stop:r,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:d,stop:r,resize:function(t,e){var i=Math.round(e.position.left/a),n=Math.floor((e.position.top+h/2)/h),d=Math.round(e.size.width/a),r=Math.round(e.size.height/h);s.grid.can_move_node(o,i,n,d,r)&&(s.grid.move_node(o,i,n,d,r),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(),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){e=t(e);var i=e.data("_gridstack_node");this.grid.remove_node(i),e.remove(),this._update_container_height()},a.prototype.remove_all=function(){e.each(this.grid.nodes,function(t){t.el.remove()}),this.grid.nodes=[],this._update_container_height()},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&&(s.no_resize=!i,n.resizable(s.no_resize?"disable":"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&&(s.no_move=!i,n.draggable(s.no_move?"disable":"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&&(s.locked=i||!1,n.attr("data-gs-locked",s.locked?"yes":null))}),this},a.prototype._update_element=function(e,i){e=t(e).first();var n=e.data("_gridstack_node");if("undefined"!=typeof n){var s=this;s.grid.clean_nodes(),s.grid.begin_update(n),i.call(this,e,n),s._update_container_height(),s.container.trigger("change",[s.grid.get_dirty_nodes()]),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()},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 36f84f5..c4bc000 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","insert_css_rule","selector","rules","index","insertRule","addRule","toBool","v","toLowerCase","Boolean","id_seq","GridStackEngine","onchange","float","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","each","_updating","_orig_y","new_y","bn","_dirty","i","can_be_moved","first","_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","attr","item_class","placeholder_class","handle","cell_height","vertical_margin","auto","_class","random","toFixed","animate","always_show_resize_handle","resizable","autoHide","handles","draggable","scroll","appendTo","addClass","_init_styles","grid","remove","_update_styles","elements","_prepare_element","set_animation","placeholder","hide","append","on_resize_handler","_is_one_column_mode","resize","_styles_id","_styles","_max","prefix","_update_container_height","data","cell_width","on_start_moving","o","ceil","outerWidth","show","on_end_moving","removeAttr","trigger","start","stop","drag","event","ui","round","position","left","top","size","enable","removeClass","add_widget","will_it_fit","remove_widget","remove_all","val","movable","disable","_update_element","callback","move","update","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAWA,GACe,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,cAAeD,GAGjCA,EAAQG,OAAQC,IAErB,SAAUC,EAAGD,GAEZ,GAAIE,GAAQC,OAERC,GACAC,eAAgB,SAAUC,EAAGC,GACzB,QAASD,EAAEE,EAAIF,EAAEG,OAASF,EAAEC,G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,EAAU9D,UAAU0G,WAAa,WAC7B,GAAIE,GAAI/G,KAAKsE,UAAU1D,KAAK,IAAMZ,KAAKmE,KAAKK,YAAYhD,OACxD,OAAOmB,MAAKqE,KAAKD,EAAEE,aAAeF,EAAExC,KAAK,mBAG7CN,EAAU9D,UAAU0I,oBAAsB,SAASjB,GAC/C,GAAIkB,GAAe9I,KAAKsE,UAAUsD,WAC9BmB,EAAenB,EAASC,KAAOiB,EAAajB,KAC5CmB,EAAcpB,EAASE,IAAMgB,EAAahB,IAE1CmB,EAAetG,KAAKM,MAAMjD,KAAKsE,UAAU9G,QAAUwC,KAAKmE,KAAK3G,OAC7D0L,EAAalJ,KAAKmE,KAAKQ,YAAc3E,KAAKmE,KAAKS,eAEnD,QAAQrH,EAAGoF,KAAKM,MAAM8F,EAAeE,GAAexL,EAAGkF,KAAKM,MAAM+F,EAAcE,KAGpFjF,EAAU9D,UAAUC,aAAe,WAC/BJ,KAAK2F,KAAKvF,gBAGd6D,EAAU9D,UAAUE,OAAS,WACzBL,KAAK2F,KAAKtF,SACVL,KAAK2G,4BAGT1J,EAAMkM,YAAclF,EAEpBhH,EAAMkM,YAAYhM,MAAQA,EAE1BH,EAAEoM,GAAGC,UAAY,SAAUlF,GACvB,MAAOnE,MAAKgB,KAAK,WACRhE,EAAEgD,MAAM4G,KAAK,cACd5J,EAAEgD,MAAM4G,KAAK,YAAa,GAAI3C,GAAUjE,KAAMmE,OAKnDlH,EAAMkM"} \ No newline at end of file +{"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","insert_css_rule","selector","rules","index","insertRule","addRule","toBool","v","toLowerCase","Boolean","id_seq","GridStackEngine","onchange","float","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","each","_updating","_orig_y","new_y","bn","_dirty","i","can_be_moved","first","_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","cell_height","vertical_margin","auto","_class","random","toFixed","animate","always_show_resize_handle","resizable","autoHide","handles","draggable","scroll","appendTo","addClass","_init_styles","grid","remove","_update_styles","elements","children","_prepare_element","set_animation","placeholder","hide","append","on_resize_handler","_is_one_column_mode","resize","_styles_id","_styles","_max","prefix","_update_container_height","data","cell_width","on_start_moving","o","ceil","outerWidth","show","on_end_moving","removeAttr","trigger","start","stop","drag","event","ui","round","position","left","top","containment","parent","enable","removeClass","add_widget","will_it_fit","remove_widget","remove_all","val","movable","disable","_update_element","callback","move","update","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAWA,GACe,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,cAAeD,GAGjCA,EAAQG,OAAQC,IAErB,SAAUC,EAAGD,GAEZ,GAAIE,GAAQC,OAERC,GACAC,eAAgB,SAAUC,EAAGC,GACzB,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,SAAUC,EAAOC,EAAKL,GAGxB,MAFAA,GAAQA,GAAST,EAAEe,MAAMF,GAAOG,IAAI,SAAUC,GAAQ,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9E,KAAKgG,qBAGT/B,EAAU9D,UAAU8G,WAAa,WAC7B,GAAIE,GAAInH,KAAKsE,UAAU4B,SAAS,IAAMlG,KAAKmE,KAAKI,YAAY/C,OAC5D,OAAOmB,MAAKyE,KAAKD,EAAEE,aAAeF,EAAExC,KAAK,mBAG7CV,EAAU9D,UAAU+I,oBAAsB,SAASlB,GAC/C,GAAImB,GAAenJ,KAAKsE,UAAU0D,WAC9BoB,EAAepB,EAASC,KAAOkB,EAAalB,KAC5CoB,EAAcrB,EAASE,IAAMiB,EAAajB,IAE1CoB,EAAe3G,KAAKM,MAAMjD,KAAKsE,UAAU9G,QAAUwC,KAAKmE,KAAK3G,OAC7D+L,EAAavJ,KAAKmE,KAAKW,YAAc9E,KAAKmE,KAAKY,eAEnD,QAAQxH,EAAGoF,KAAKM,MAAMmG,EAAeE,GAAe7L,EAAGkF,KAAKM,MAAMoG,EAAcE,KAGpFtF,EAAU9D,UAAUC,aAAe,WAC/BJ,KAAK8F,KAAK1F,gBAGd6D,EAAU9D,UAAUE,OAAS,WACzBL,KAAK8F,KAAKzF,SACVL,KAAK+G,4BAGT9J,EAAMuM,YAAcvF,EAEpBhH,EAAMuM,YAAYrM,MAAQA,EAE1BH,EAAEyM,GAAGC,UAAY,SAAUvF,GACvB,MAAOnE,MAAKgB,KAAK,WACRhE,EAAEgD,MAAMgH,KAAK,cACdhK,EAAEgD,MAAMgH,KAAK,YAAa,GAAI/C,GAAUjE,KAAMmE,OAKnDlH,EAAMuM"} \ No newline at end of file diff --git a/src/gridstack.css b/src/gridstack.css index e0f96d9..50d468e 100644 --- a/src/gridstack.css +++ b/src/gridstack.css @@ -15,7 +15,6 @@ bottom: 0; width: auto; z-index: 0 !important; - overflow: auto; } .grid-stack > .grid-stack-item { min-width: 8.33333333%; @@ -31,7 +30,8 @@ bottom: 0; width: auto; z-index: 0 !important; - overflow: auto; + overflow-x: hidden; + overflow-y: auto; } .grid-stack > .grid-stack-item > .ui-resizable-handle { position: absolute; diff --git a/src/gridstack.js b/src/gridstack.js index e5f0baf..66dcfc6 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -362,6 +362,9 @@ 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, @@ -382,12 +385,17 @@ }), draggable: _.defaults(opts.draggable || {}, { handle: '.grid-stack-item-content', - scroll: true, + scroll: false, appendTo: 'body' }) }); + this.opts.is_nested = is_nested; this.container.addClass(this.opts._class); + if (is_nested) { + this.container.addClass('grid-stack-nested'); + } + this._init_styles(); this.grid = new GridStackEngine(this.opts.width, function (nodes) { @@ -410,7 +418,7 @@ if (this.opts.auto) { var elements = []; - this.container.find('.' + this.opts.item_class).each(function (index, el) { + this.container.children('.' + this.opts.item_class).each(function (index, el) { el = $(el); elements.push({ el: el, @@ -600,7 +608,8 @@ } 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, @@ -713,13 +722,13 @@ }; GridStack.prototype.disable = function () { - this.movable(this.container.find('.' + this.opts.item_class), false); - this.resizable(this.container.find('.' + this.opts.item_class), false); + this.movable(this.container.children('.' + this.opts.item_class), false); + this.resizable(this.container.children('.' + this.opts.item_class), false); }; GridStack.prototype.enable = function () { - this.movable(this.container.find('.' + this.opts.item_class), true); - this.resizable(this.container.find('.' + this.opts.item_class), true); + this.movable(this.container.children('.' + this.opts.item_class), true); + this.resizable(this.container.children('.' + this.opts.item_class), true); }; GridStack.prototype.locked = function (el, val) { @@ -798,7 +807,7 @@ }; GridStack.prototype.cell_width = function () { - var o = this.container.find('.' + this.opts.item_class).first(); + var o = this.container.children('.' + this.opts.item_class).first(); return Math.ceil(o.outerWidth() / o.attr('data-gs-width')); }; diff --git a/src/gridstack.scss b/src/gridstack.scss index 961627c..9c8d94b 100644 --- a/src/gridstack.scss +++ b/src/gridstack.scss @@ -26,7 +26,6 @@ $animation_speed: .3s; bottom: 0; width: auto; z-index: 0 !important; - overflow: auto; } > .grid-stack-item { @@ -43,7 +42,8 @@ $animation_speed: .3s; bottom: 0; width: auto; z-index: 0 !important; - overflow: auto; + overflow-x: hidden; + overflow-y: auto; } > .ui-resizable-handle {