diff --git a/src/gridstack.css b/src/gridstack.css index f250f78..d451887 100644 --- a/src/gridstack.css +++ b/src/gridstack.css @@ -68,6 +68,8 @@ content: "\f065"; } +.grid-stack-item { min-width: 8.33333333% } + .grid-stack-item[data-gs-width="12"] { width: 100% } .grid-stack-item[data-gs-width="11"] { width: 91.66666667% } .grid-stack-item[data-gs-width="10"] { width: 83.33333333% } diff --git a/src/gridstack.js b/src/gridstack.js index 3f293f2..1335299 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -434,6 +434,8 @@ }; GridStack.prototype._update_styles = function (max_height) { + var prefix = '.' + this.opts._class + ' .' + this.opts.item_class; + if (typeof max_height == 'undefined') { max_height = this._styles._max; this._styles._max = 0; @@ -448,9 +450,12 @@ 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) { - var prefix = '.' + this.opts._class + ' .' + this.opts.item_class; 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;',