From a716b24fb4478b2a80167bf4e97198f634bf5fee Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Fri, 27 Feb 2015 15:57:43 -0800 Subject: [PATCH] min size --- gridstack.css | 2 ++ gridstack.js | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gridstack.css b/gridstack.css index f250f78..d451887 100644 --- a/gridstack.css +++ b/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/gridstack.js b/gridstack.js index 1b28bad..3b5f477 100644 --- a/gridstack.js +++ b/gridstack.js @@ -440,6 +440,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; @@ -454,9 +456,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;',