Sha256: 3b64f35eeab077679a756e7d700248610b913c29747404e204f43e9a69b4ba92
Contents?: true
Size: 774 Bytes
Versions: 11
Compression:
Stored size: 774 Bytes
Contents
//= require alchemy/solidus/admin/select2_config $.fn.alchemyTaxonSelect = function(options) { var config = Alchemy.Solidus.getSelect2Config(options) this.select2($.extend(true, config, { ajax: { data: function(term, page) { return { q: $.extend({ name_cont: term }, options.query_params), page: page } }, results: function(data, page) { return { results: data.taxons.map(function(taxon) { return { id: taxon.id, text: taxon.name } }), more: page * data.per_page < data.total_count } } }, formatSelection: function(taxon) { return taxon.text || taxon.name } })) }
Version data entries
11 entries across 11 versions & 1 rubygems