Sha256: 95e87f0e99c69fd898cee3c77f098e94d40ad78444205949ef8882636fe2a10a
Contents?: true
Size: 910 Bytes
Versions: 16
Compression:
Stored size: 910 Bytes
Contents
$.fn.optionTypeAutocomplete = function () { 'use strict' console.warn('optionTypeAutocomplete is deprecated and will be removed in Spree 5.0') this.select2({ minimumInputLength: 2, multiple: true, ajax: { url: Spree.routes.option_types_api_v2, datatype: 'json', headers: Spree.apiV2Authentication(), data: function (params) { return { filter: { name_i_cont: params.term } } }, processResults: function (data) { return formatSelect2Options(data) } } }) } document.addEventListener("spree:load", function() { var productOptionTypeSelector = document.getElementById('product_option_type_ids') if (productOptionTypeSelector == null) return if (productOptionTypeSelector.hasAttribute('data-autocomplete-url-value')) return $('#product_option_type_ids').optionTypeAutocomplete() })
Version data entries
16 entries across 16 versions & 1 rubygems