aboutsummaryrefslogtreecommitdiffstats
path: root/ui/button.js
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2015-05-13 21:54:37 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2015-05-20 14:27:55 -0400
commit12df1b7dad135aa57640be631277db3f7d75d672 (patch)
tree4eebd1f09cecf57ed2dbdf358e9d4ddaea680fdd /ui/button.js
parent8b4ce807cd97e3cb953995934d6c4f614de9fa03 (diff)
downloadjquery-ui-12df1b7dad135aa57640be631277db3f7d75d672.tar.gz
jquery-ui-12df1b7dad135aa57640be631277db3f7d75d672.zip
Button: Remove core event/alias and deprecated module dependencies
Diffstat (limited to 'ui/button.js')
-rw-r--r--ui/button.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/ui/button.js b/ui/button.js
index 5182b1f12..70cc31680 100644
--- a/ui/button.js
+++ b/ui/button.js
@@ -73,8 +73,8 @@ $.widget( "ui.button", {
},
_create: function() {
this.element.closest( "form" )
- .unbind( "reset" + this.eventNamespace )
- .bind( "reset" + this.eventNamespace, formResetHandler );
+ .off( "reset" + this.eventNamespace )
+ .on( "reset" + this.eventNamespace, formResetHandler );
if ( typeof this.options.disabled !== "boolean" ) {
this.options.disabled = !!this.element.prop( "disabled" );
@@ -99,7 +99,7 @@ $.widget( "ui.button", {
this.buttonElement
.addClass( baseClasses )
.attr( "role", "button" )
- .bind( "mouseenter" + this.eventNamespace, function() {
+ .on( "mouseenter" + this.eventNamespace, function() {
if ( options.disabled ) {
return;
}
@@ -107,13 +107,13 @@ $.widget( "ui.button", {
$( this ).addClass( "ui-state-active" );
}
})
- .bind( "mouseleave" + this.eventNamespace, function() {
+ .on( "mouseleave" + this.eventNamespace, function() {
if ( options.disabled ) {
return;
}
$( this ).removeClass( activeClass );
})
- .bind( "click" + this.eventNamespace, function( event ) {
+ .on( "click" + this.eventNamespace, function( event ) {
if ( options.disabled ) {
event.preventDefault();
event.stopImmediatePropagation();
@@ -132,19 +132,19 @@ $.widget( "ui.button", {
});
if ( toggleButton ) {
- this.element.bind( "change" + this.eventNamespace, function() {
+ this.element.on( "change" + this.eventNamespace, function() {
that.refresh();
});
}
if ( this.type === "checkbox" ) {
- this.buttonElement.bind( "click" + this.eventNamespace, function() {
+ this.buttonElement.on( "click" + this.eventNamespace, function() {
if ( options.disabled ) {
return false;
}
});
} else if ( this.type === "radio" ) {
- this.buttonElement.bind( "click" + this.eventNamespace, function() {
+ this.buttonElement.on( "click" + this.eventNamespace, function() {
if ( options.disabled ) {
return false;
}
@@ -162,7 +162,7 @@ $.widget( "ui.button", {
});
} else {
this.buttonElement
- .bind( "mousedown" + this.eventNamespace, function() {
+ .on( "mousedown" + this.eventNamespace, function() {
if ( options.disabled ) {
return false;
}
@@ -172,13 +172,13 @@ $.widget( "ui.button", {
lastActive = null;
});
})
- .bind( "mouseup" + this.eventNamespace, function() {
+ .on( "mouseup" + this.eventNamespace, function() {
if ( options.disabled ) {
return false;
}
$( this ).removeClass( "ui-state-active" );
})
- .bind( "keydown" + this.eventNamespace, function(event) {
+ .on( "keydown" + this.eventNamespace, function(event) {
if ( options.disabled ) {
return false;
}
@@ -188,15 +188,15 @@ $.widget( "ui.button", {
})
// see #8559, we bind to blur here in case the button element loses
// focus between keydown and keyup, it would be left in an "active" state
- .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
+ .on( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
$( this ).removeClass( "ui-state-active" );
});
if ( this.buttonElement.is("a") ) {
- this.buttonElement.keyup(function(event) {
+ this.buttonElement.on( "keyup", function(event) {
if ( event.keyCode === $.ui.keyCode.SPACE ) {
// TODO pass through original event correctly (just as 2nd argument doesn't work)
- $( this ).click();
+ $( this ).trigger( "click" );
}
});
}