Commit ff31cb7b authored by radiolips's avatar radiolips Committed by GitHub
Browse files

Merge pull request #775 from adumesny/minHeight_fix

Min height fix
parents dfc9b42d 123cc016
......@@ -9,7 +9,8 @@
},
"scripts": {
"build": "grunt ; doctoc ./README.md ; doctoc ./doc/README.md ; doctoc ./doc/CHANGES.md",
"test": "grunt lint && karma start karma.conf.js"
"test": "grunt lint && karma start karma.conf.js",
"lint": "grunt lint"
},
"keywords": [
"gridstack",
......
......@@ -1033,9 +1033,13 @@
return;
}
var height = this.grid.getGridHeight();
var minHeight = parseInt(this.container.css('min-height')) / this.cellHeight();
if (height < minHeight) {
height = minHeight;
// check for css min height. Each row is cellHeight + verticalMargin, until last one which has no margin below
var cssMinHeight = parseInt(this.container.css('min-height'));
if (cssMinHeight > 0) {
var minHeight = (cssMinHeight + this.opts.verticalMargin) / (this.cellHeight() + this.opts.verticalMargin);
if (height < minHeight) {
height = minHeight;
}
}
this.container.attr('data-gs-current-height', height);
if (!this.opts.cellHeight) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment