X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fbootstrap%2FLayoutMasonry.js;h=0b082f79d6dd8d03ea9986c83732140f167f9a44;hb=05d4479b42d7cf53ba7a700636903c81ff49d9a7;hp=60e6f8b246203eccd990e897bbe6762137a16d62;hpb=b8979023f0166883875ce6a8be00ec075cf9bef3;p=roojs1 diff --git a/Roo/bootstrap/LayoutMasonry.js b/Roo/bootstrap/LayoutMasonry.js index 60e6f8b246..0b082f79d6 100644 --- a/Roo/bootstrap/LayoutMasonry.js +++ b/Roo/bootstrap/LayoutMasonry.js @@ -149,6 +149,8 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component, { initial : function() { + this.selectedBrick = []; + this.currentSize = this.el.getBox(true); Roo.EventManager.onWindowResize(this.resize, this); @@ -226,20 +228,20 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component, { } var containerWidth = this.containerWidth; - Roo.log(containerWidth); + var cols = Math.floor(containerWidth / boxWidth); - Roo.log(cols); + this.cols = Math.max( cols, 1 ); this.cols = this.maxCols > 0 ? Math.min( this.cols, this.maxCols ) : this.cols; var totalBoxWidth = this.cols * boxWidth - this.padWidth; - Roo.log(totalBoxWidth); + var avail = Math.floor((containerWidth - totalBoxWidth) / this.cols); - Roo.log(avail); + this.colWidth = boxWidth + avail - this.padWidth; - Roo.log(this.colWidth); - this.unitWidth = Math.floor((this.colWidth - (this.gutter * 2)) / 3); + + this.unitWidth = Math.round((this.colWidth - (this.gutter * 2)) / 3); this.unitHeight = this.boxHeight > 0 ? this.boxHeight : this.unitWidth; }, @@ -661,8 +663,11 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component, { b.el.setWidth(width); b.el.setHeight(height); + + b.el.select('iframe',true).first().set('width', width); + b.el.select('iframe',true).first().set(height); // iframe? - b.el.select('iframe',true).setSize(width,height); +// b.el.select('iframe',true).setSize(width,height); }, this); @@ -1247,7 +1252,6 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component, { for (var i = 0; i