var App = App || {}; App.Controls = App.Controls || {}; App.Controls.AutoCompleteInput = function($input) { var _ = App.DI.get('_'); var jQuery = App.DI.get('jQuery'); var tagList = App.DI.get('tagList'); var KEY_TAB = 9; var KEY_RETURN = 13; var KEY_DELETE = 46; var KEY_ESCAPE = 27; var KEY_UP = 38; var KEY_DOWN = 40; var options = { caseSensitive: false, source: null, maxResults: 15, minLengthToArbitrarySearch: 3, onApply: null, onDelete: null, onRender: null, additionalFilter: null, }; var showTimeout = null; var cachedSource = null; var results = []; var activeResult = -1; var monitorInputHidingInterval = null; if ($input.length === 0) { throw new Error('Input element was not found'); } if ($input.length > 1) { throw new Error('Cannot add autocompletion to more than one element at once'); } if ($input.attr('data-autocomplete')) { throw new Error('Autocompletion was already added for this element'); } $input.attr('data-autocomplete', true); $input.attr('autocomplete', 'off'); var $div = jQuery('
'); var $list = jQuery('