Sha256: 1173d01ae22c8012b47590dba3250804483aa2aa433f863d2a5552026920a33c
Contents?: true
Size: 1.11 KB
Versions: 57
Compression:
Stored size: 1.11 KB
Contents
$(document).ready(function () { 'use strict' function formatOptionType (optionType) { return Select2.util.escapeMarkup(optionType.presentation + ' (' + optionType.name + ')') } if ($('#product_option_type_ids').length > 0) { $('#product_option_type_ids').select2({ placeholder: Spree.translations.option_type_placeholder, multiple: true, initSelection: function (element, callback) { var url = Spree.url(Spree.routes.option_types_api, { ids: element.val(), token: Spree.api_key }) return $.getJSON(url, null, function (data) { return callback(data) }) }, ajax: { url: Spree.routes.option_types_api, quietMillis: 200, datatype: 'json', data: function (term) { return { q: { name_cont: term }, token: Spree.api_key } }, results: function (data) { return { results: data } } }, formatResult: formatOptionType, formatSelection: formatOptionType }) } })
Version data entries
57 entries across 57 versions & 1 rubygems