X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Roo%2FButton.js;h=c3cc8d6ee840c8be457b6a91391fa19313bcc641;hp=4d4ddf22d29a78c4f6983bb855ee837b7091d3ef;hb=6f4f9538e7b21526daa7b20502f10b14f80da7af;hpb=9346bd598a5fa0d23fb2ee62eabf7e2876c393e5 diff --git a/Roo/Button.js b/Roo/Button.js index 4d4ddf22d2..c3cc8d6ee8 100644 --- a/Roo/Button.js +++ b/Roo/Button.js @@ -369,7 +369,24 @@ Roo.extend(Roo.Button, Roo.util.Observable, { this.hide(); } }, - + /** + * Similar to toggle, but does not trigger event. + * @param {Boolean} state [required] Force a particular state + */ + setPressed : function(state) + { + + if(state != this.pressed){ + if(state){ + this.el.addClass("x-btn-pressed"); + this.pressed = true; + }else{ + this.el.removeClass("x-btn-pressed"); + this.pressed = false; + } + } + } + /** * If a state it passed, it becomes the pressed state otherwise the current state is toggled. * @param {Boolean} state (optional) Force a particular state @@ -392,6 +409,8 @@ Roo.extend(Roo.Button, Roo.util.Observable, { } }, + + /** * Focus the button */