Sha256: b2ca0d154345b57a2b12ca5fe037c41f8b4061b3e8c7c4b1a30b028286d10686
Contents?: true
Size: 771 Bytes
Versions: 12
Compression:
Stored size: 771 Bytes
Contents
import Default from './autocomplete/default' import Work from './autocomplete/work' import LinkedData from './autocomplete/linked_data' export default class Autocomplete { /** * Setup for the autocomplete field. * @param {jQuery} element - The input field to add autocompete to # @param {string} fieldName - The name of the field (e.g. 'based_near') # @param {string} url - The url for the autocompete search endpoint */ setup (element, fieldName, url) { switch (fieldName) { case 'work': new Work( element, url, element.data('exclude-work') ) break case 'based_near': new LinkedData(element, url) default: new Default(element, url) break } } }
Version data entries
12 entries across 12 versions & 1 rubygems