diff options
author | Giovanni Giacobbi <giovanni@giacobbi.net> | 2011-03-20 03:19:36 +0100 |
---|---|---|
committer | Giovanni Giacobbi <giovanni@giacobbi.net> | 2011-03-20 03:19:36 +0100 |
commit | 3ce8429f4fce08176c8bc06d4ff4bf8830f8c916 (patch) | |
tree | 785fed3a3e75b34914b593626e6b7390c685745b /ui | |
parent | 6d0164571647e169c9674a2853f3223caf188e7e (diff) | |
download | jquery-ui-3ce8429f4fce08176c8bc06d4ff4bf8830f8c916.tar.gz jquery-ui-3ce8429f4fce08176c8bc06d4ff4bf8830f8c916.zip |
Restructured if/else's for better readability
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.button.js | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 9cf8974b2..5777d4753 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -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 |