From 9e9f605c07e1af2b26934d03ca7d73b4fe0e7a23 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 16 May 2014 16:05:32 +0800 Subject: [PATCH] Roo/bootstrap/Button.js --- Roo/bootstrap/Button.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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'); + }, }); -- 2.39.2