docs/default.css
[roojs1] / roojs-bootstrap.js
index df71457..74519a4 100644 (file)
@@ -39,18 +39,18 @@ Roo.bootstrap.Column=function(A){Roo.bootstrap.Column.superclass.constructor.cal
 return;}A.cls+=' col-'+D+'-'+B[D];});if(this.hidden){A.cls+=' hidden';}if(this.alert&&["success","info","warning","danger"].indexOf(this.alert)>-1){A.cls+=' alert alert-'+this.alert;}if(this.html.length){A.html=this.html;}if(this.fa){var C='';if(this.fasize>1){C=' fa-'+this.fasize+'x';
 }A.html='<i class="fa fa-'+this.fa+C+'"></i>'+(A.html||'');}if(this.icon){A.html='<i class="glyphicon glyphicon-'+this.icon+'"></i>'+(A.html||'');}return A;}});
 // Roo/bootstrap/Container.js
-Roo.bootstrap.Container=function(A){Roo.bootstrap.Container.superclass.constructor.call(this,A);this.addEvents({"expand":true,"collapse":true});};Roo.extend(Roo.bootstrap.Container,Roo.bootstrap.Component,{jumbotron:false,well:'',panel:'',header:'',footer:'',sticky:'',tag:false,alert:false,fa:false,icon:false,expandable:false,rheader:'',expanded:true,getChildContainer:function(){if(!this.el){return false;
+Roo.bootstrap.Container=function(A){Roo.bootstrap.Container.superclass.constructor.call(this,A);this.addEvents({"expand":true,"collapse":true,"click":true});};Roo.extend(Roo.bootstrap.Container,Roo.bootstrap.Component,{jumbotron:false,well:'',panel:'',header:'',footer:'',sticky:'',tag:false,alert:false,fa:false,icon:false,expandable:false,rheader:'',expanded:true,clickable:false,getChildContainer:function(){if(!this.el){return false;
 }if(this.panel.length){return this.el.select('.panel-body',true).first();}return this.el;},getAutoCreate:function(){var A={tag:this.tag||'div',html:'',cls:''};if(this.jumbotron){A.cls='jumbotron';}if(this.sticky.length){var bd=Roo.get(document.body);if(!bd.hasClass('bootstrap-sticky')){bd.addClass('bootstrap-sticky');
 Roo.select('html',true).setStyle('height','100%');}A.cls+='bootstrap-sticky-'+this.sticky;}if(this.well.length){switch(this.well){case 'lg':case 'sm':A.cls+=' well well-'+this.well;break;default:A.cls+=' well';break;}}if(this.hidden){A.cls+=' hidden';}if(this.alert&&["success","info","warning","danger"].indexOf(this.alert)>-1){A.cls+=' alert alert-'+this.alert;
 }var B=A;if(this.panel.length){A.cls+=' panel panel-'+this.panel;A.cn=[];if(this.header.length){var h=[];if(this.expandable){A.cls=A.cls+' expandable';h.push({tag:'i',cls:(this.expanded?'fa fa-minus':'fa fa-plus')});}h.push({tag:'span',cls:'panel-title',html:(this.expandable?'&nbsp;':'')+this.header}
 ,{tag:'span',cls:'panel-header-right',html:this.rheader});A.cn.push({cls:'panel-heading',style:this.expandable?'cursor: pointer':'',cn:h});}B=false;A.cn.push({cls:'panel-body'+(this.expanded?'':' hide'),html:this.html});if(this.footer.length){A.cn.push({cls:'panel-footer',html:this.footer}
 );}}if(B){B.html=this.html||A.html;if(this.fa){B.html='<i class="fa fa-'+this.fa+'"></i>'+B.html;}if(this.icon){B.html='<i class="glyphicon glyphicon-'+this.icon+'"></i>'+B.html;}}if((!this.cls||!this.cls.length)&&(!A.cls||!A.cls.length)){A.cls='container';
-}return A;},initEvents:function(){if(!this.expandable){return;}var A=this.headerEl();if(!A){return;}A.on('click',this.onToggleClick,this);},onToggleClick:function(){var A=this.headerEl();if(!A){return;}if(this.expanded){this.collapse();return;}this.expand();
-},expand:function(){if(this.fireEvent('expand',this)){this.expanded=true;this.el.select('.panel-body',true).first().removeClass('hide');var A=this.toggleEl();if(!A){return;}A.removeClass(['fa-minus','fa-plus']).addClass(['fa-minus']);}},collapse:function(){if(this.fireEvent('collapse',this)){this.expanded=false;
-this.el.select('.panel-body',true).first().addClass('hide');var A=this.toggleEl();if(!A){return;}A.removeClass(['fa-minus','fa-plus']).addClass(['fa-plus']);}},toggleEl:function(){if(!this.el||!this.panel.length||!this.header.length||!this.expandable){return;
+}return A;},initEvents:function(){if(this.expandable){var A=this.headerEl();if(A){A.on('click',this.onToggleClick,this);}}if(this.clickable){this.el.on('click',this.onClick,this);}},onToggleClick:function(){var A=this.headerEl();if(!A){return;}if(this.expanded){this.collapse();
+return;}this.expand();},expand:function(){if(this.fireEvent('expand',this)){this.expanded=true;this.el.select('.panel-body',true).first().removeClass('hide');var A=this.toggleEl();if(!A){return;}A.removeClass(['fa-minus','fa-plus']).addClass(['fa-minus']);
+}},collapse:function(){if(this.fireEvent('collapse',this)){this.expanded=false;this.el.select('.panel-body',true).first().addClass('hide');var A=this.toggleEl();if(!A){return;}A.removeClass(['fa-minus','fa-plus']).addClass(['fa-plus']);}},toggleEl:function(){if(!this.el||!this.panel.length||!this.header.length||!this.expandable){return;
 }return this.el.select('.panel-heading .fa',true).first();},headerEl:function(){if(!this.el||!this.panel.length||!this.header.length){return;}return this.el.select('.panel-heading',true).first()},titleEl:function(){if(!this.el||!this.panel.length||!this.header.length){return;
 }return this.el.select('.panel-title',true).first();},setTitle:function(v){var A=this.titleEl();if(!A){return;}A.dom.innerHTML=v;},getTitle:function(){var A=this.titleEl();if(!A){return '';}return A.dom.innerHTML;},setRightTitle:function(v){var t=this.el.select('.panel-header-right',true).first();
-if(!t){return;}t.dom.innerHTML=v;}});
+if(!t){return;}t.dom.innerHTML=v;},onClick:function(e){e.preventDefault();this.fireEvent('click',this,e);}});
 // Roo/bootstrap/Img.js
 Roo.bootstrap.Img=function(A){Roo.bootstrap.Img.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Img,Roo.bootstrap.Component,{imgResponsive:true,border:'',src:'about:blank',href:false,target:false,xsUrl:'',smUrl:'',mdUrl:'',lgUrl:'',getAutoCreate:function(){if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){return this.createSingleImg();
 }var A={tag:'div',cls:'roo-image-responsive-group',cn:[]};var B=this;Roo.each(['xs','sm','md','lg'],function(C){if(!B[C+'Url']){return;}var D={tag:'img',cls:(B.imgResponsive)?'img-responsive':'',html:B.html||A.html,src:B[C+'Url']};D.cls+=' roo-image-responsive-'+C;