Fix for vertical-stack-in-card

This commit is contained in:
Thomas Lovén 2019-02-20 18:11:44 +01:00
parent 2b29c007bc
commit e0ec2f21ad

View File

@ -63,9 +63,9 @@ class LayoutCard extends Polymer.Element {
if (this.config.column_num) { if (this.config.column_num) {
numcols = this.config.column_num; numcols = this.config.column_num;
} else { } else {
let colWidth = this.config.column_width || 300; const cardWidth = this.$.columns.clientWidth || (this.parentElement && this.parentElement.clientWidth);
numcols = Math.max(1,
this.parentElement ? Math.floor(this.parentElement.clientWidth/this.config.column_width) : 0); numcols = Math.max(1, Math.floor(cardWidth/this.config.column_width));
} }
numcols = Math.min(numcols, this.config.max_columns); numcols = Math.min(numcols, this.config.max_columns);
if(numcols != this.colnum) { if(numcols != this.colnum) {