mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Autocomplete: Simplify _create() method
Uses logical expressions in place of conditional expressions.
Closes #1490
(cherry picked from commit 4212d072a1
)
This commit is contained in:
parent
9ac18234e1
commit
ec44c24a50
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user