aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2015-03-13 17:16:24 +0100
committerScott González <scott.gonzalez@gmail.com>2016-06-09 12:17:38 -0400
commitec44c24a50876aa0a57f92f2c93e686a5def622c (patch)
tree9d6c1c6982ce2932aca4cd8b5c29eb671dd5c5a3
parent9ac18234e1a2755a91e0d2fc2206e9b50e324ced (diff)
downloadjquery-ui-ec44c24a50876aa0a57f92f2c93e686a5def622c.tar.gz
jquery-ui-ec44c24a50876aa0a57f92f2c93e686a5def622c.zip
Autocomplete: Simplify _create() method
Uses logical expressions in place of conditional expressions. Closes #1490 (cherry picked from commit 4212d072a112d0315df1c26f81764fafd96a478d)
-rw-r--r--ui/autocomplete.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/ui/autocomplete.js b/ui/autocomplete.js
index e4f998faa..4a35704fe 100644
--- a/ui/autocomplete.js
+++ b/ui/autocomplete.js
@@ -67,14 +67,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;