roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Mon, 9 Mar 2015 06:30:22 +0000 (14:30 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 9 Mar 2015 06:30:22 +0000 (14:30 +0800)
roojs-bootstrap-debug.js

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

index db5c2c0..e90df38 100644 (file)
@@ -774,9 +774,17 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
  * @cfg {Number} sm colspan out of 12 for tablet-sized screens or 0 for hidden
  * @cfg {Number} md colspan out of 12 for computer-sized screens or 0 for hidden
  * @cfg {Number} lg colspan out of 12 for large computer-sized screens or 0 for hidden
+ * @cfg {Number} xsoff colspan offset out of 12 for mobile-sized screens or 0 for hidden
+ * @cfg {Number} smoff colspan offset out of 12 for tablet-sized screens or 0 for hidden
+ * @cfg {Number} mdoff colspan offset out of 12 for computer-sized screens or 0 for hidden
+ * @cfg {Number} lgoff colspan offset out of 12 for large computer-sized screens or 0 for hidden
+ *
+ * 
  * @cfg {Boolean} hidden (true|false) hide the element
  * @cfg {String} alert (success|info|warning|danger) type alert (changes background / border...)
  * @cfg {String} fa (ban|check|...) font awesome icon
+ * @cfg {Number} fasize (1|2|....) font awsome size
+
  * @cfg {String} icon (info-sign|check|...) glyphicon name
 
  * @cfg {String} html content of column.
@@ -796,12 +804,17 @@ Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component,  {
     sm: false,
     md: false,
     lg: false,
+    xsoff: false,
+    smoff: false,
+    mdoff: false,
+    lgoff: false,
     html: '',
     offset: 0,
     alert: false,
     fa: false,
     icon : false,
     hidden : false,
+    fasize : 1,
     
     getAutoCreate : function(){
         var cfg = Roo.apply({}, Roo.bootstrap.Column.superclass.getAutoCreate.call(this));
@@ -813,7 +826,12 @@ Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component,  {
         
         var settings=this;
         ['xs','sm','md','lg'].map(function(size){
-            Roo.log( size + ':' + settings[size]);
+            //Roo.log( size + ':' + settings[size]);
+            
+            if (settings[size+'off'] !== false) {
+                cfg.cls += ' col-' + settings[size+'off'] + '-offset';
+            }
+            
             if (settings[size] === false) {
                 return;
             }
@@ -839,7 +857,13 @@ Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component,  {
             cfg.html = this.html;
         }
         if (this.fa) {
-            cfg.html = '<i class="fa fa-'+this.fa + '"></i>' + (cfg.html || '');
+            var fasize = '';
+            if (this.fasize > 1) {
+                fasize = ' fa-' + this.fasize + 'x';
+            }
+            cfg.html = '<i class="fa fa-'+this.fa + fasize + '"></i>' + (cfg.html || '');
+            
+            
         }
         if (this.icon) {
             cfg.html = '<i class="glyphicon glyphicon-'+this.icon + '"></i>' + + (cfg.html || '')
index e092987..ad67fd2 100644 (file)
@@ -20,9 +20,10 @@ this.el.enableDisplayMode();},onClick:function(e){if(this.disabled){return;}
 Roo.log('button on click ');if(this.preventDefault){e.preventDefault();}if(this.pressed===true||this.pressed===false){this.pressed=!this.pressed;this.el[this.pressed?'addClass':'removeClass']('active');this.fireEvent('toggle',this,e,this.pressed);}
 this.fireEvent('click',this,e);},enable:function(){this.disabled=false;this.el.removeClass('disabled');},disable:function(){this.disabled=true;this.el.addClass('disabled');},setActive:function(v){this.el[v?'addClass':'removeClass']('active');},toggleActive:function(){var A=this.el.hasClass('active');this.setActive(!A);},setText:function(A){this.el.select('.roo-button-text',true).first().dom.innerHTML=A;},getText:function(){return this.el.select('.roo-button-text',true).first().dom.innerHTML;},hide:function(){this.el.hide();},show:function(){this.el.show();}});
 //Roo/bootstrap/Column.js
-Roo.bootstrap.Column=function(A){Roo.bootstrap.Column.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Column,Roo.bootstrap.Component,{xs:false,sm:false,md:false,lg:false,html:'',offset:0,alert:false,fa:false,icon:false,hidden:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.Column.superclass.getAutoCreate.call(this));A={tag:'div',cls:'column'};var B=this;['xs','sm','md','lg'].map(function(C){Roo.log(C+':'+B[C]);if(B[C]===false){return;}
-Roo.log(B[C]);if(!B[C]){A.cls+=' hidden-'+C;return;}
-A.cls+=' col-'+C+'-'+B[C];});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){A.html='<i class="fa fa-'+this.fa+'"></i>'+(A.html||'');}if(this.icon){A.html='<i class="glyphicon glyphicon-'+this.icon+'"></i>'++(A.html||'')}return A;}});
+Roo.bootstrap.Column=function(A){Roo.bootstrap.Column.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Column,Roo.bootstrap.Component,{xs:false,sm:false,md:false,lg:false,xsoff:false,smoff:false,mdoff:false,lgoff:false,html:'',offset:0,alert:false,fa:false,icon:false,hidden:false,fasize:1,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.Column.superclass.getAutoCreate.call(this));A={tag:'div',cls:'column'};var B=this;['xs','sm','md','lg'].map(function(D){if(B[D+'off']!==false){A.cls+=' col-'+B[D+'off']+'-offset';}if(B[D]===false){return;}
+Roo.log(B[D]);if(!B[D]){A.cls+=' hidden-'+D;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);};Roo.extend(Roo.bootstrap.Container,Roo.bootstrap.Component,{jumbotron:false,well:'',panel:'',header:'',footer:'',sticky:'',tag:false,alert:false,fa:false,icon: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){A.cn.push({cls:'panel-heading',cn:[{tag:'h3',cls:'panel-title',html:this.header}]});}