From: benny Date: Tue, 24 Jul 2018 10:17:49 +0000 (+0800) Subject: cmmit X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=41d7ae854d2d17e47e2454c065e30fc110861b29 cmmit --- diff --git a/Roo/bootstrap/MasonryBrick.js b/Roo/bootstrap/MasonryBrick.js index 144dd1c05a..7effe3325c 100644 --- a/Roo/bootstrap/MasonryBrick.js +++ b/Roo/bootstrap/MasonryBrick.js @@ -497,8 +497,12 @@ Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, { m.selectedBrick.push(this.id); this.el.addClass(this.activeClass); return; - } + }, + isSelected : function(){ + return this.el.hasClass(this.activeClass); + + } }); Roo.apply(Roo.bootstrap.MasonryBrick, { diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 92a0df7e0b..94afc3a1ed 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -592,13 +592,14 @@ Roo.bootstrap.Button = function(config){ /** * @event click * When a butotn is pressed - * @param {Roo.bootstrap.Button} this + * @param {Roo.bootstrap.Button} btn * @param {Roo.EventObject} e */ "click" : true, /** * @event toggle * After the button has been toggles + * @param {Roo.bootstrap.Button} btn * @param {Roo.EventObject} e * @param {boolean} pressed (also available as button.pressed) */ @@ -883,6 +884,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { setActive : function(v) { this.el[v ? 'addClass' : 'removeClass']('active'); + this.pressed = v; }, /** * toggles the current active state diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index be0eb91bc8..7462131a82 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -32,7 +32,7 @@ delete A.html;}A.cls+=this.parentType==='Navbar'?' navbar-btn':'';if(this.glyphi }else if(this.href.length>0){A.href=this.href;}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'); +},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');this.pressed=v;},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