]> source.dussan.org Git - jquery-ui.git/commitdiff
Restructured if/else's for better readability 160/head
authorGiovanni Giacobbi <giovanni@giacobbi.net>
Sun, 20 Mar 2011 02:19:36 +0000 (03:19 +0100)
committerGiovanni Giacobbi <giovanni@giacobbi.net>
Sun, 20 Mar 2011 02:19:36 +0000 (03:19 +0100)
ui/jquery.ui.button.js

index 9cf8974b209f749a08bdef2cad71439e460824d0..5777d47539a4ebb1305a56a26aef76f342bcc207 100644 (file)
@@ -183,21 +183,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