From 3419dac6243970fe12d2a73ebf7113ce94328c72 Mon Sep 17 00:00:00 2001 From: mmartin Date: Fri, 22 Jul 2011 08:56:54 -0700 Subject: [PATCH 1/4] Button: Set ui-state-active class accordingly to the checkbox state. Fixed #5518 - ui.button double clicking issue --- ui/jquery.ui.button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 482cdc24cf3..5de4c881ba4 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -146,7 +146,7 @@ $.widget( "ui.button", { if ( options.disabled || clickDragged ) { return false; } - $( this ).toggleClass( "ui-state-active" ); + $( this ).toggleClass( "ui-state-active", self.element[0].checked ); self.buttonElement.attr( "aria-pressed", self.element[0].checked ); }); } else if ( this.type === "radio" ) { From c2b51e6dc1b640769b258af9eaa4732cf36e5c17 Mon Sep 17 00:00:00 2001 From: mmartin Date: Thu, 11 Aug 2011 16:08:09 +0300 Subject: [PATCH 2/4] Edited ui/jquery.ui.button.js via GitHub --- ui/jquery.ui.button.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 5de4c881ba4..6beae67cc8f 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -142,13 +142,19 @@ $.widget( "ui.button", { } if ( this.type === "checkbox" ) { - this.buttonElement.bind( "click.button", function() { + this.buttonElement.bind( "click.button", function() { if ( options.disabled || clickDragged ) { return false; } - $( this ).toggleClass( "ui-state-active", self.element[0].checked ); - self.buttonElement.attr( "aria-pressed", self.element[0].checked ); + $( this ).toggleClass( "ui-state-active", !self.element[0].checked ); + self.buttonElement.attr( "aria-pressed", !self.element[0].checked ); }); + this.buttonElement.bind( "dblclick.buttonElement", function(e) { + if ( options.disabled || clickDragged ) { + return false; + } + self.refresh(); + }); } else if ( this.type === "radio" ) { this.buttonElement.bind( "click.button", function() { if ( options.disabled || clickDragged ) { From 608b978ac0896a07fd50057d9a73e6aa71da6049 Mon Sep 17 00:00:00 2001 From: mmartin Date: Thu, 11 Aug 2011 16:09:17 +0300 Subject: [PATCH 3/4] Edited ui/jquery.ui.button.js via GitHub --- ui/jquery.ui.button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 6beae67cc8f..f9957e23a29 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -142,7 +142,7 @@ $.widget( "ui.button", { } if ( this.type === "checkbox" ) { - this.buttonElement.bind( "click.button", function() { + this.buttonElement.bind( "click.button", function() { if ( options.disabled || clickDragged ) { return false; } From 1af1601ddddf07b71407a81a525ead04dddd5fec Mon Sep 17 00:00:00 2001 From: mmartin Date: Thu, 11 Aug 2011 16:11:22 +0300 Subject: [PATCH 4/4] Edited ui/jquery.ui.button.js via GitHub --- ui/jquery.ui.button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index f9957e23a29..4b13d0cad36 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -149,7 +149,7 @@ $.widget( "ui.button", { $( this ).toggleClass( "ui-state-active", !self.element[0].checked ); self.buttonElement.attr( "aria-pressed", !self.element[0].checked ); }); - this.buttonElement.bind( "dblclick.buttonElement", function(e) { + this.buttonElement.bind( "dblclick.buttonElement", function() { if ( options.disabled || clickDragged ) { return false; }