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

Version Path
hyrax-2.0.3 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.2 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.1 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.0 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.0.rc3 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.0.rc2 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.0.rc1 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.0.beta5 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.0.beta4 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.0.beta3 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.0.beta2 app/assets/javascripts/hyrax/autocomplete.es6
hyrax-2.0.0.beta1 app/assets/javascripts/hyrax/autocomplete.es6