From c49dbe0f0120dec9922d5cb6459a93d33ef41579 Mon Sep 17 00:00:00 2001 From: Glenn Goodrich Date: Thu, 26 May 2011 11:28:17 -0400 Subject: Button: modified the event bindings for focus and blur. Fixed #6711 - checkbox/radio button do not show focused state when using Keyboard Navigation --- ui/jquery.ui.button.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'ui/jquery.ui.button.js') diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index a95dddc6c..3f3b90e92 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -95,19 +95,21 @@ $.widget( "ui.button", { } $( this ).removeClass( hoverClass ); }) - .bind( "focus.button", function() { - // no need to check disabled, focus won't be triggered anyway - $( this ).addClass( focusClass ); - }) - .bind( "blur.button", function() { - $( this ).removeClass( focusClass ); - }) .bind( "click.button", function( event ) { if ( options.disabled ) { event.stopImmediatePropagation(); } }); + this.element + .bind( "focus.button", function() { + // no need to check disabled, focus won't be triggered anyway + self.buttonElement.addClass( focusClass ); + }) + .bind( "blur.button", function() { + self.buttonElement.removeClass( focusClass ); + }); + if ( toggleButton ) { this.element.bind( "change.button", function() { if ( clickDragged ) { -- cgit v1.2.3 From 597a313ab67bc10627d9c17c941776514ea5bd7c Mon Sep 17 00:00:00 2001 From: Andrew Powell Date: Thu, 26 May 2011 12:22:40 -0400 Subject: Button: adding event.preventDefault. Fixes #5945 - Disabled buttons still allow clicks --- ui/jquery.ui.button.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ui/jquery.ui.button.js') diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 3f3b90e92..32e00e9e0 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -97,6 +97,7 @@ $.widget( "ui.button", { }) .bind( "click.button", function( event ) { if ( options.disabled ) { + event.preventDefault(); event.stopImmediatePropagation(); } }); -- cgit v1.2.3 From 6a5b21fda2730a0650e0144658d47b9b01bffc64 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sat, 28 May 2011 15:39:55 -0400 Subject: All: Moved version numbers into prototypes. Fixed #7436 - Widget: Store version numbers on instances. --- ui/jquery.ui.accordion.js | 2 +- ui/jquery.ui.autocomplete.js | 2 +- ui/jquery.ui.button.js | 3 +-- ui/jquery.ui.dialog.js | 3 +-- ui/jquery.ui.draggable.js | 5 +---- ui/jquery.ui.droppable.js | 5 +---- ui/jquery.ui.menu.js | 3 +-- ui/jquery.ui.menubar.js | 1 + ui/jquery.ui.mouse.js | 1 + ui/jquery.ui.popup.js | 1 + ui/jquery.ui.progressbar.js | 5 +---- ui/jquery.ui.resizable.js | 5 +---- ui/jquery.ui.selectable.js | 5 +---- ui/jquery.ui.slider.js | 6 +----- ui/jquery.ui.sortable.js | 5 +---- ui/jquery.ui.spinner.js | 3 +-- ui/jquery.ui.tabs.js | 5 +---- ui/jquery.ui.tooltip.js | 3 +-- ui/jquery.ui.widget.js | 2 +- 19 files changed, 19 insertions(+), 46 deletions(-) (limited to 'ui/jquery.ui.button.js') diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index c6b33befb..7602ae9bc 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -15,6 +15,7 @@ // TODO: use ui-accordion-header-active class and fix styling $.widget( "ui.accordion", { + version: "@VERSION", options: { active: 0, animated: "slide", @@ -432,7 +433,6 @@ $.widget( "ui.accordion", { }); $.extend( $.ui.accordion, { - version: "@VERSION", animations: { slide: function( options, additions ) { var showOverflow = options.toShow.css( "overflow" ), diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 4619949fb..e39b4649e 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -19,6 +19,7 @@ var requestIndex = 0; $.widget( "ui.autocomplete", { + version: "@VERSION", defaultElement: "", options: { appendTo: "body", @@ -475,7 +476,6 @@ $.widget( "ui.autocomplete", { }); $.extend( $.ui.autocomplete, { - version: "@VERSION", escapeRegex: function( value ) { return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); }, diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 32e00e9e0..482cdc24c 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -41,6 +41,7 @@ var lastActive, startXPos, startYPos, clickDragged, }; $.widget( "ui.button", { + version: "@VERSION", defaultElement: "