diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-03-13 17:16:24 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-03-17 16:05:31 +0100 |
commit | 4212d072a112d0315df1c26f81764fafd96a478d (patch) | |
tree | 8a2e2959530947983d2997a1cbb261dd2f370672 /ui | |
parent | 581bfb55bf4f4f614a6e0c0ac545cf1aa7d29d0a (diff) | |
download | jquery-ui-4212d072a112d0315df1c26f81764fafd96a478d.tar.gz jquery-ui-4212d072a112d0315df1c26f81764fafd96a478d.zip |
Autocomplete: Simplify _create() method
Uses logical expressions in place of conditional expressions.
Closes #1490
Diffstat (limited to 'ui')
-rw-r--r-- | ui/autocomplete.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/ui/autocomplete.js b/ui/autocomplete.js index 3a52e1b17..bdf995621 100644 --- a/ui/autocomplete.js +++ b/ui/autocomplete.js @@ -76,14 +76,11 @@ $.widget( "ui.autocomplete", { isTextarea = nodeName === "textarea", isInput = nodeName === "input"; - this.isMultiLine = - // Textareas are always multi-line - isTextarea ? true : - // Inputs are always single-line, even if inside a contentEditable element - // IE also treats inputs as contentEditable - isInput ? false : - // All other element types are determined by whether or not they're contentEditable - this.element.prop( "isContentEditable" ); + // Textareas are always multi-line + // Inputs are always single-line, even if inside a contentEditable element + // IE also treats inputs as contentEditable + // All other element types are determined by whether or not they're contentEditable + this.isMultiLine = isTextarea || !isInput && this.element.prop( "isContentEditable" ); this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; this.isNewMenu = true; |