]> source.dussan.org Git - jquery-ui.git/commitdiff
Restructured if/else's for better readability
authorGiovanni Giacobbi <giovanni@giacobbi.net>
Sun, 20 Mar 2011 02:19:36 +0000 (03:19 +0100)
committerScott González <scott.gonzalez@gmail.com>
Mon, 21 Mar 2011 13:48:10 +0000 (09:48 -0400)
(cherry picked from commit 3ce8429f4fce08176c8bc06d4ff4bf8830f8c916)

ui/jquery.ui.button.js

index bddedead641612a7e4cfc9d0216be2c37d76e636..a98e96f46f4ed0ce219fa864e9a535796d56c527 100644 (file)
@@ -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