Roo/bootstrap/LayoutMasonry.js
[roojs1] / Roo / bootstrap / LayoutMasonry.js
index 5c966f1..7569d4a 100644 (file)
@@ -242,6 +242,7 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component,  {
         this.colWidth = boxWidth + avail - this.padWidth;
         
         this.unitWidth = Math.round((this.colWidth - (this.gutter * 2)) / 3);
+        
         this.unitHeight = this.boxHeight > 0 ? this.boxHeight  : this.unitWidth;
     },
     
@@ -433,7 +434,6 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component,  {
     
     _horizontalLayoutItems : function ( items , isInstant)
     {
-        Roo.log(this);
         if ( !items || !items.length || items.length < 3) {
             return;
         }
@@ -640,6 +640,8 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component,  {
         var pos = this.el.getBox(true);
         var x = pos.x;
         var y = pos.y;
+        Roo.log(pos);
+        alert(JSON.stringify(pos));
         var maxY = [];
         
         for (var i = 0; i < this.cols; i++){
@@ -1250,7 +1252,6 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component,  {
         for (var i = 0; i<this.bricks.length; i++) {
             if (this.bricks[i].id == brick_id) {
                 this.bricks.splice(i,1);
-                this.selectedBrick = [];
                 this.el.dom.removeChild(Roo.get(brick_id).dom);
                 this.initial();
             }
@@ -1266,7 +1267,7 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component,  {
         var cn = new Roo.bootstrap.MasonryBrick(cfg);
         //this.register(cn);
         cn.parentId = this.id;
-        cn.onRender(this.el, null);
+        cn.render(this.el);
         return cn;
     },