Sha256: 222347b32d8c699e8749f76d6449b30930cd8d4678ff64370382bb453788863e

Contents?: true

Size: 530 Bytes

Versions: 9

Compression:

Stored size: 530 Bytes

Contents

export class Subject {
  constructor(element, url) {
    this.url = url
    element.autocomplete(this.options());
  }

  options() {
    return {
      minLength: 2,
      source: ( request, response ) => {
        $.getJSON(this.url, {
          q: request.term
        }, response );
      },
      focus: function() {
        // prevent value inserted on focus
        return false;
      },
      complete: function(event) {
        $('.ui-autocomplete-loading').removeClass("ui-autocomplete-loading");
      }
    };
  }
}


Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
sufia-7.3.0.rc3 app/assets/javascripts/sufia/autocomplete/subject.es6
sufia-7.3.0.rc2 app/assets/javascripts/sufia/autocomplete/subject.es6
sufia-7.3.0.rc1 app/assets/javascripts/sufia/autocomplete/subject.es6
test_hyrax-0.0.1.alpha app/assets/javascripts/hyrax/autocomplete/subject.es6
sufia-7.2.0 app/assets/javascripts/sufia/autocomplete/subject.es6
sufia-7.1.0 app/assets/javascripts/sufia/autocomplete/subject.es6
sufia-7.0.0 app/assets/javascripts/sufia/autocomplete/subject.es6
sufia-7.0.0.rc2 app/assets/javascripts/sufia/autocomplete/subject.es6
sufia-7.0.0.rc1 app/assets/javascripts/sufia/autocomplete/subject.es6