aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2010-03-11 21:17:28 +0000
committerRichard Worth <rdworth@gmail.com>2010-03-11 21:17:28 +0000
commitddd1026d209cc1c6fd4d13cac1a5448af3747eaf (patch)
tree921dd44e975efbcb77a27d4173208d01d0c2f81a /ui
parent789830343771ee3bb3b9dcfb030d99e4aeefafbc (diff)
downloadjquery-ui-ddd1026d209cc1c6fd4d13cac1a5448af3747eaf.tar.gz
jquery-ui-ddd1026d209cc1c6fd4d13cac1a5448af3747eaf.zip
Button: quiet jslint
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.button.js32
1 files changed, 19 insertions, 13 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index cf15d2ee6..8bf198173 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -145,7 +145,7 @@ $.widget( "ui.button", {
$( this ).removeClass( "ui-state-active" );
})
.bind( "keydown.button", function(event) {
- 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" );
}
})
@@ -171,14 +171,21 @@ $.widget( "ui.button", {
},
_determineButtonType: function() {
- this.type = this.element.is( ":checkbox" )
- ? "checkbox"
- : this.element.is( ":radio" )
- ? "radio"
- : this.element.is( "input" )
- ? "input"
- : "button";
-
+
+ if ( this.element.is(":checkbox") ) {
+ this.type = "checkbox";
+ } else {
+ if ( this.element.is(":radio") ) {
+ this.type = "radio";
+ } else {
+ if (this.element.is("input") ) {
+ this.type = "input";
+ } else {
+ this.type = "button";
+ }
+ }
+ }
+
if ( this.type === "checkbox" || this.type === "radio" ) {
// we don't search against the document in case the element
// is disconnected from the DOM
@@ -257,9 +264,8 @@ $.widget( "ui.button", {
.addClass( "ui-button-text" )
.html( this.options.label )
.appendTo( buttonElement.empty() )
- .text();
-
- var icons = this.options.icons,
+ .text(),
+ icons = this.options.icons,
multipleIcons = icons.primary && icons.secondary;
if ( icons.primary || icons.secondary ) {
buttonElement.addClass( "ui-button-text-icon" +
@@ -320,4 +326,4 @@ $.widget( "ui.buttonset", {
}
});
-})( jQuery );
+}( jQuery ));