roojs-bootstrap.js
authoredward <edward@roojs.com>
Fri, 8 Dec 2017 06:26:12 +0000 (14:26 +0800)
committeredward <edward@roojs.com>
Fri, 8 Dec 2017 06:26:12 +0000 (14:26 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index ff98bc9..5c4055f 100644 (file)
@@ -5685,20 +5685,18 @@ Roo.LoadMask.prototype = {
         }
         */
     
-        
-        
-        this.el.unmask(this.removeMask);
+        (function() { this.el.unmask(this.removeMask); }).defer(50, this);
     },
     // private
     onLoad : function()
     {
-        this.el.unmask(this.removeMask);
+        (function() { this.el.unmask(this.removeMask); }).defer(50, this);
     },
 
     // private
     onBeforeLoad : function(){
         if(!this.disabled){
-            (function() { this.el.mask(this.msg, this.msgCls) }).defer(50, this);
+            (function() { this.el.mask(this.msg, this.msgCls); }).defer(50, this);
         }
     },
 
@@ -29871,6 +29869,13 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component,  {
         
     },
     
+    addItem : function(cfg)
+    {
+        Roo.log('adding item!!!!!!!!!!!!!!!!!!!!!!!!!!');
+        var brick = Roo.factory(cfg);
+        brick.render(this.getChildContainer());
+    },
+    
     resize : function()
     {
         var cs = this.el.getBox(true);
@@ -29972,6 +29977,8 @@ Roo.extend(Roo.bootstrap.LayoutMasonry, Roo.bootstrap.Component,  {
     
     layoutItems : function( isInstant )
     {
+        Roo.log(this.bricks);
+        
         var items = Roo.apply([], this.bricks);
         
         if(this.isHorizontal){
index 37e5314..6f3e29d 100644 (file)
@@ -221,9 +221,9 @@ for(var i=0,B=this.config.length;i<B;i++){var c=this.config[i];if(fn.call(A||thi
 // Roo/LoadMask.js
 Roo.LoadMask=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.store){this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);this.removeMask=false;}else{var um=this.el.getUpdateManager();
 um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('update',this.onLoad,this);um.on('failure',this.onLoad,this);this.removeMask=true;}};Roo.LoadMask.prototype={msg:'Loading...',msgCls:'x-mask-loading',disabled:false,disable:function(){this.disabled=true;
-},enable:function(){this.disabled=false;},onLoadException:function(){Roo.log(arguments);if(typeof(arguments[3])!='undefined'){Roo.MessageBox.alert("Error loading",arguments[3]);}this.el.unmask(this.removeMask);},onLoad:function(){this.el.unmask(this.removeMask);
-},onBeforeLoad:function(){if(!this.disabled){(function(){this.el.mask(this.msg,this.msgCls)}).defer(50,this);}},destroy:function(){if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.onLoadException,this);
-}else{var um=this.el.getUpdateManager();um.un('beforeupdate',this.onBeforeLoad,this);um.un('update',this.onLoad,this);um.un('failure',this.onLoad,this);}}};
+},enable:function(){this.disabled=false;},onLoadException:function(){Roo.log(arguments);if(typeof(arguments[3])!='undefined'){Roo.MessageBox.alert("Error loading",arguments[3]);}(function(){this.el.unmask(this.removeMask);}).defer(50,this);},onLoad:function(){(function(){this.el.unmask(this.removeMask);
+}).defer(50,this);},onBeforeLoad:function(){if(!this.disabled){(function(){this.el.mask(this.msg,this.msgCls);}).defer(50,this);}},destroy:function(){if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);
+this.store.un('loadexception',this.onLoadException,this);}else{var um=this.el.getUpdateManager();um.un('beforeupdate',this.onBeforeLoad,this);um.un('update',this.onLoad,this);um.un('failure',this.onLoad,this);}}};
 // Roo/bootstrap/Table.js
 Roo.bootstrap.Table=function(A){Roo.bootstrap.Table.superclass.constructor.call(this,A);this.rowSelection=(typeof(A.rowSelection)!='undefined')?A.rowSelection:this.rowSelection;this.cellSelection=(typeof(A.cellSelection)!='undefined')?A.cellSelection:this.cellSelection;
 this.headerShow=(typeof(A.thead)!='undefined')?A.thead:this.headerShow;this.footerShow=(typeof(A.tfoot)!='undefined')?A.tfoot:this.footerShow;this.sm=this.sm||{xtype:'RowSelectionModel'};if(this.sm){this.sm.grid=this;this.selModel=Roo.factory(this.sm,Roo.bootstrap.Table);
@@ -1260,12 +1260,13 @@ var C=this.el.select('i.fa-star',true).first();if(B&&!C){this.el.select('.roo-da
 // Roo/bootstrap/LayoutMasonry.js
 Roo.bootstrap.LayoutMasonry=function(A){Roo.bootstrap.LayoutMasonry.superclass.constructor.call(this,A);this.bricks=[];this.addEvents({"layout":true});};Roo.extend(Roo.bootstrap.LayoutMasonry,Roo.bootstrap.Component,{isLayoutInstant:false,boxWidth:450,boxHeight:0,padWidth:10,gutter:10,maxCols:0,isAutoInitial:true,containerWidth:0,isHorizontal:false,currentSize:null,tag:'div',cls:'',bricks:null,cols:1,_isLayoutInited:false,alternativePadWidth:50,getAutoCreate:function(){var A={tag:this.tag,cls:'blog-masonary-wrapper '+this.cls,cn:{cls:'mas-boxes masonary'}
 };return A;},getChildContainer:function(){if(this.boxesEl){return this.boxesEl;}this.boxesEl=this.el.select('.mas-boxes').first();return this.boxesEl;},initEvents:function(){var A=this;if(this.isAutoInitial){Roo.log('hook children rendered');this.on('childrenrendered',function(){Roo.log('children rendered');
-A.initial();},this);}},initial:function(){this.currentSize=this.el.getBox(true);Roo.EventManager.onWindowResize(this.resize,this);if(!this.isAutoInitial){this.layout();return;}this.layout();return;},resize:function(){var cs=this.el.getBox(true);if(this.currentSize.width==cs.width&&this.currentSize.x==cs.x&&this.currentSize.height==cs.height&&this.currentSize.y==cs.y){Roo.log("no change in with or X or Y");
+A.initial();},this);}},initial:function(){this.currentSize=this.el.getBox(true);Roo.EventManager.onWindowResize(this.resize,this);if(!this.isAutoInitial){this.layout();return;}this.layout();return;},addItem:function(A){Roo.log('adding item!!!!!!!!!!!!!!!!!!!!!!!!!!');
+var B=Roo.factory(A);B.render(this.getChildContainer());},resize:function(){var cs=this.el.getBox(true);if(this.currentSize.width==cs.width&&this.currentSize.x==cs.x&&this.currentSize.height==cs.height&&this.currentSize.y==cs.y){Roo.log("no change in with or X or Y");
 return;}this.currentSize=cs;this.layout();},layout:function(){this._resetLayout();var A=this.isLayoutInstant!==undefined?this.isLayoutInstant:!this._isLayoutInited;this.layoutItems(A);this._isLayoutInited=true;this.fireEvent('layout',this);},_resetLayout:function(){if(this.isHorizontal){this.horizontalMeasureColumns();
 return;}this.verticalMeasureColumns();},verticalMeasureColumns:function(){this.getContainerWidth();var A=this.boxWidth+this.padWidth;if(this.containerWidth<this.boxWidth){A=this.containerWidth}var B=this.containerWidth;var C=Math.floor(B/A);this.cols=Math.max(C,1);
 this.cols=this.maxCols>0?Math.min(this.cols,this.maxCols):this.cols;var D=this.cols*A-this.padWidth;var E=Math.floor((B-D)/this.cols);this.colWidth=A+E-this.padWidth;this.unitWidth=Math.floor((this.colWidth-(this.gutter*2))/3);this.unitHeight=this.boxHeight>0?this.boxHeight:this.unitWidth;
 },horizontalMeasureColumns:function(){this.getContainerWidth();var A=this.boxWidth;if(this.containerWidth<A){A=this.containerWidth;}this.unitWidth=Math.floor((A-(this.gutter*2))/3);this.el.setHeight(A);},getContainerWidth:function(){this.containerWidth=this.el.getBox(true).width;
-},layoutItems:function(A){var B=Roo.apply([],this.bricks);if(this.isHorizontal){this._horizontalLayoutItems(B,A);return;}this._verticalLayoutItems(B,A);},_verticalLayoutItems:function(A,B){if(!A||!A.length){return;}var C=[['xs','xs','xs','tall'],['xs','xs','tall'],['xs','xs','sm'],['xs','xs','xs'],['xs','tall'],['xs','sm'],['xs','xs'],['xs'],['sm','xs','xs'],['sm','xs'],['sm'],['tall','xs','xs','xs'],['tall','xs','xs'],['tall','xs'],['tall']];
+},layoutItems:function(A){Roo.log(this.bricks);var B=Roo.apply([],this.bricks);if(this.isHorizontal){this._horizontalLayoutItems(B,A);return;}this._verticalLayoutItems(B,A);},_verticalLayoutItems:function(A,B){if(!A||!A.length){return;}var C=[['xs','xs','xs','tall'],['xs','xs','tall'],['xs','xs','sm'],['xs','xs','xs'],['xs','tall'],['xs','sm'],['xs','xs'],['xs'],['sm','xs','xs'],['sm','xs'],['sm'],['tall','xs','xs','xs'],['tall','xs','xs'],['tall','xs'],['tall']];
 var D=[];var E=[];var F=[];Roo.each(A,function(H,k){switch(H.size){case 'md':case 'md-left':case 'md-right':case 'wide':if(F.length){E.push(F);F=[];}E.push([H]);break;case 'xs':case 'sm':case 'tall':F.push(H);break;default:break;}},this);if(F.length){E.push(F);
 F=[];}var G=function(H,I){if(!H.length){return;}var J=false;var K=H.slice(0,I);var L=[];Roo.each(K,function(i){L.push(i.size);},this);Roo.each(C,function(s){if(String(s)!=String(L)){return;}J=true;return false;},this);if(!J&&I==1){return;}if(!J){G(H,I-1);
 return;}D.push(K);H=H.slice(I,H.length);G(H,4);return;};Roo.each(E,function(H,k){if(!H.length){return;}if(H.length==1){D.push(H);return;}G(H,4);},this);this._processVerticalLayoutQueue(D,B);},_horizontalLayoutItems:function(A,B){if(!A||!A.length||A.length<3){return;