diff options
Diffstat (limited to 'ui/jquery.ui.button.js')
-rw-r--r-- | ui/jquery.ui.button.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 701cb44d8..f84d748cf 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -186,7 +186,7 @@ $.widget( "ui.button", { if ( options.disabled ) { return false; } - if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) { + if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) { $( this ).addClass( "ui-state-active" ); } }) @@ -212,6 +212,7 @@ $.widget( "ui.button", { }, _determineButtonType: function() { + var ancestor, labelSelector, checked; if ( this.element.is(":checkbox") ) { this.type = "checkbox"; @@ -226,8 +227,8 @@ $.widget( "ui.button", { if ( this.type === "checkbox" || this.type === "radio" ) { // we don't search against the document in case the element // is disconnected from the DOM - var ancestor = this.element.parents().last(), - labelSelector = "label[for='" + this.element.attr("id") + "']"; + ancestor = this.element.parents().last(); + labelSelector = "label[for='" + this.element.attr("id") + "']"; this.buttonElement = ancestor.find( labelSelector ); if ( !this.buttonElement.length ) { ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings(); @@ -238,7 +239,7 @@ $.widget( "ui.button", { } this.element.addClass( "ui-helper-hidden-accessible" ); - var checked = this.element.is( ":checked" ); + checked = this.element.is( ":checked" ); if ( checked ) { this.buttonElement.addClass( "ui-state-active" ); } |