From: Alan Knowles Date: Fri, 16 May 2014 08:05:32 +0000 (+0800) Subject: Roo/bootstrap/Button.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=9e9f605c07e1af2b26934d03ca7d73b4fe0e7a23 Roo/bootstrap/Button.js --- diff --git a/Roo/bootstrap/Button.js b/Roo/bootstrap/Button.js index fc5b4bd040..6a19e08089 100644 --- a/Roo/bootstrap/Button.js +++ b/Roo/bootstrap/Button.js @@ -275,6 +275,10 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { }, onClick : function(e) { + if (this.disabled) { + return; + } + Roo.log('button on click '); if(this.preventDefault){ e.preventDefault(); @@ -287,8 +291,17 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { this.fireEvent('click', this, e); - } - + }, + enable : function() + { + this.disabled = false; + this.el.removeClass('disabled'); + }, + disable : function() + { + this.disabled = true; + this.el.addClass('disabled'); + }, });