diff options
author | Giovanni Giacobbi <giovanni@giacobbi.net> | 2011-03-20 03:19:36 +0100 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-03-21 09:48:10 -0400 |
commit | eb3d95543870447d1194f6e9e7c43c6d2637a35f (patch) | |
tree | 5abece53245fcdd11217b9baa3d7cec8adf4052e | |
parent | c9341a3619a56fabe2025761961b39f0d661db0f (diff) | |
download | jquery-ui-eb3d95543870447d1194f6e9e7c43c6d2637a35f.tar.gz jquery-ui-eb3d95543870447d1194f6e9e7c43c6d2637a35f.zip |
Restructured if/else's for better readability
(cherry picked from commit 3ce8429f4fce08176c8bc06d4ff4bf8830f8c916)
-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 bddedead6..a98e96f46 100644 --- a/ui/jquery.ui.button.js +++ b/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 |