Skip to content
Permalink
Browse files

Autocomplete: Simplify _create() method

Uses logical expressions in place of conditional expressions.

Closes #1490
  • Loading branch information
jzaefferer committed Mar 17, 2015
1 parent 581bfb5 commit 4212d072a112d0315df1c26f81764fafd96a478d
Showing with 5 additions and 8 deletions.
  1. +5 −8 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;

0 comments on commit 4212d07

Please sign in to comment.
You can’t perform that action at this time.