From f4108dfaabc605ff42681c72157f1df791104068 Mon Sep 17 00:00:00 2001 From: john Date: Tue, 16 Oct 2018 16:57:02 +0800 Subject: [PATCH] sync --- Roo/bootstrap/LayoutMasonry.js | 8 +++++++- roojs-bootstrap-debug.js | 8 +++++++- roojs-bootstrap.js | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Roo/bootstrap/LayoutMasonry.js b/Roo/bootstrap/LayoutMasonry.js index 7864971314..63d4ee538d 100644 --- a/Roo/bootstrap/LayoutMasonry.js +++ b/Roo/bootstrap/LayoutMasonry.js @@ -36,7 +36,13 @@ Roo.bootstrap.LayoutMasonry = function(config){ * @param {Roo.bootstrap.LayoutMasonry} this * @param {Roo.EventObject} e */ - "layout" : true + "layout" : true, + /** + * @event childrenrendered + * Fires when the children have been rendered.. + * @param {Roo.bootstrap.Component} this + */ + "childrenrendered" : true }); }; diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 0dc7ff60c5..4de1e32d93 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -30815,7 +30815,13 @@ Roo.bootstrap.LayoutMasonry = function(config){ * @param {Roo.bootstrap.LayoutMasonry} this * @param {Roo.EventObject} e */ - "layout" : true + "layout" : true, + /** + * @event childrenrendered + * Fires when the children have been rendered.. + * @param {Roo.bootstrap.Component} this + */ + "childrenrendered" : true }); }; diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 9c9176a483..135e897e96 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1309,7 +1309,7 @@ return A;}this.markInvalid();return A;},markValid:function(){var A=this.el.selec var C=this.el.select('i.fa-star',true).first();if(B&&!C){this.el.select('.roo-date-split-field-label',true).createChild({tag:'i',cls:'text-danger fa fa-lg fa-star',tooltip:'This field is required',style:'margin-right:5px;'},B,true);}this.fireEvent('invalid',this,A); },clearInvalid:function(){var A=this.el.select('label',true).first();var B=this.el.select('i.fa-star',true).first();if(A&&B){B.remove();}this.fireEvent('valid',this);},getName:function(){return this.name;}}); // Roo/bootstrap/LayoutMasonry.js -Roo.bootstrap.LayoutMasonry=function(A){Roo.bootstrap.LayoutMasonry.superclass.constructor.call(this,A);this.bricks=[];Roo.bootstrap.LayoutMasonry.register(this);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,selectedBrick:[],getAutoCreate:function(){var A=Roo.apply({} +Roo.bootstrap.LayoutMasonry=function(A){Roo.bootstrap.LayoutMasonry.superclass.constructor.call(this,A);this.bricks=[];Roo.bootstrap.LayoutMasonry.register(this);this.addEvents({"layout":true,"childrenrendered":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,selectedBrick:[],getAutoCreate:function(){var A=Roo.apply({} ,Roo.bootstrap.LayoutMasonry.superclass.getAutoCreate.call(this));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.selectedBrick=[];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"); -- 2.39.2