Sha256: b64a792f04040b6ff47f512ec064fc2e2853d930a4fc78a345221a20b959fce9
Contents?: true
Size: 1.13 KB
Versions: 17
Compression:
Stored size: 1.13 KB
Contents
$(document).ready(function () { 'use strict'; 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_type_search, { ids: element.val() }); return $.getJSON(url, null, function (data) { return callback(data); }); }, ajax: { url: Spree.routes.option_type_search, quietMillis: 200, datatype: 'json', data: function (term) { return { q: { name_cont: term }, token: Spree.api_key }; }, results: function (data) { return { results: data }; } }, formatResult: function (option_type) { return option_type.presentation + ' (' + option_type.name + ')'; }, formatSelection: function (option_type) { return option_type.presentation + ' (' + option_type.name + ')'; } }); } });
Version data entries
17 entries across 17 versions & 1 rubygems