roojs-bootstrap.js
authorbenny <benny@roojs.com>
Fri, 20 Jul 2018 07:08:51 +0000 (15:08 +0800)
committerbenny <benny@roojs.com>
Fri, 20 Jul 2018 07:08:51 +0000 (15:08 +0800)
roojs-bootstrap-debug.js

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

index 3f2f0f2..0aad301 100644 (file)
@@ -892,6 +892,14 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
        this.setActive(!active);
        
         
+    },
+     /**
+     * get the current active state
+     * @return {boolean} true if it's active
+     */
+    isActive : function()
+    {
+        return this.el.hasClass('active');
     },
     setText : function(str)
     {
index e42f694..83bd3fc 100644 (file)
@@ -32,8 +32,9 @@ A.cn=[{tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon}];}if(this.badge){A.
 }if(this.removeClass){A.cls='';}if(this.target){A.target=this.target;}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;this.menu.triggerEl=this.el;this.addxtype(Roo.apply({},this.menu));}if(this.el.hasClass('roo-button')){this.el.on('click',this.onClick,this);
 }else{this.el.select('.roo-button').on('click',this.onClick,this);}if(this.removeClass){this.el.on('click',this.onClick,this);}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();},setWeight:function(A){this.el.removeClass(this.weightClass);this.el.addClass('btn-'+A);}});
+},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);},isActive:function(){return this.el.hasClass('active');
+},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();},setWeight:function(A){this.el.removeClass(this.weightClass);
+this.el.addClass('btn-'+A);}});
 // 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,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-'+D+'-offset-'+B[D+'off'];}if(B[D]===false){return;}if(!B[D]){A.cls+=' hidden-'+D;return;