Sha256: c86f0e72c814ac00acc4efb6070da39aa9ea74cf01f7a9f0d6ae824e44afaa6c
Contents?: true
Size: 790 Bytes
Versions: 16
Compression:
Stored size: 790 Bytes
Contents
//= require alchemy/solidus/admin/select2_config $.fn.alchemyProductSelect = 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.products.map(function(product) { return { id: product.id, text: product.name } }), more: page * data.per_page < data.total_count } } }, formatSelection: function(product) { return product.text || product.name } })) }
Version data entries
16 entries across 16 versions & 1 rubygems