Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a716b24

Browse files
committed
min size
1 parent 0378b18 commit a716b24

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

gridstack.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
content: "\f065";
6969
}
7070

71+
.grid-stack-item { min-width: 8.33333333% }
72+
7173
.grid-stack-item[data-gs-width="12"] { width: 100% }
7274
.grid-stack-item[data-gs-width="11"] { width: 91.66666667% }
7375
.grid-stack-item[data-gs-width="10"] { width: 83.33333333% }

gridstack.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@
440440
};
441441

442442
GridStack.prototype._update_styles = function (max_height) {
443+
var prefix = '.' + this.opts._class + ' .' + this.opts.item_class;
444+
443445
if (typeof max_height == 'undefined') {
444446
max_height = this._styles._max;
445447
this._styles._max = 0;
@@ -454,9 +456,12 @@
454456
this._update_container_height();
455457
}
456458

459+
if (this._styles._max == 0) {
460+
Utils.insert_css_rule(this._styles, prefix, 'min-height: ' + (this.opts.cell_height) + 'px;', 0);
461+
}
462+
457463
if (max_height > this._styles._max) {
458464
for (var i = this._styles._max; i < max_height; ++i) {
459-
var prefix = '.' + this.opts._class + ' .' + this.opts.item_class;
460465
Utils.insert_css_rule(this._styles,
461466
prefix + '[data-gs-height="' + (i + 1) + '"]',
462467
'height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px;',

0 commit comments

Comments
 (0)