aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.button.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/jquery.ui.button.js')
-rw-r--r--ui/jquery.ui.button.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index a95dddc6c..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: "<button>",
options: {
disabled: null,
@@ -95,19 +96,22 @@ $.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.preventDefault();
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 ) {
@@ -409,6 +413,4 @@ $.widget( "ui.buttonset", {
}
});
-$.ui.buttonset.version = "@VERSION";
-
}( jQuery ) );