Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Restructured if/else's for better readability

(cherry picked from commit 3ce8429)
  • Loading branch information...
commit eb3d95543870447d1194f6e9e7c43c6d2637a35f 1 parent c9341a3
@thg2k thg2k authored scottgonzalez committed
Showing with 7 additions and 11 deletions.
  1. +7 −11 ui/jquery.ui.button.js
View
18 ui/jquery.ui.button.js
@@ -182,21 +182,17 @@ $.widget( "ui.button", {
},
_determineButtonType: function() {
-
+
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 {
- if ( this.element.is(":radio") ) {
- this.type = "radio";
- } else {
- if ( this.element.is("input") ) {
- this.type = "input";
- } else {
- this.type = "button";
- }
- }
+ 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
Please sign in to comment.
Something went wrong with that request. Please try again.