{:uriI"çfile:///usr/local/bundle/bundler/gems/solidus-28213ce2047d/backend/app/assets/javascripts/spree/backend/product_picker.js?type=application/javascript&pipeline=self&id=4bb39bb6b5a45432e421a8475145af133dac5d81f3511f270c157a40c894e467:ET:load_pathI"W/usr/local/bundle/bundler/gems/solidus-28213ce2047d/backend/app/assets/javascripts;T: filenameI"w/usr/local/bundle/bundler/gems/solidus-28213ce2047d/backend/app/assets/javascripts/spree/backend/product_picker.js;T: nameI"!spree/backend/product_picker;T:logical_pathI")spree/backend/product_picker.self.js;T:content_typeI"application/javascript;T: sourceI"Í$.fn.productAutocomplete = function (options) { 'use strict'; // Default options options = options || {} var multiple = typeof(options['multiple']) !== 'undefined' ? options['multiple'] : true function formatProduct(product) { return Select2.util.escapeMarkup(product.name); } this.select2({ minimumInputLength: 3, multiple: multiple, initSelection: function (element, callback) { $.get(Spree.pathFor('admin/search/products'), { ids: element.val().split(','), token: Spree.api_key, show_all: true }, function (data) { callback(multiple ? data.products : data.products[0]); }); }, ajax: { url: Spree.pathFor('admin/search/products'), datatype: 'json', params: { "headers": { 'Authorization': 'Bearer ' + Spree.api_key } }, data: function (term, page) { return { q: { name_cont: term, variants_including_master_sku_start: term, m: 'or' }, token: Spree.api_key, page: page }; }, results: function (data, page) { var products = data.products ? data.products : []; return { results: products, more: (data.current_page * data.per_page) < data.total_count }; } }, formatResult: formatProduct, formatSelection: formatProduct }); }; Spree.ready(function () { $('.product_picker').productAutocomplete(); }); ;T: metadata{:dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"€file-digest:///usr/local/bundle/bundler/gems/solidus-28213ce2047d/backend/app/assets/javascripts/spree/backend/product_picker.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: to_loado;;}F: to_linko;;}F:map{ I" version;TiI" file;TI"$spree/backend/product_picker.js;TI" mappings;TI" AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;TI" sources;T[I"product_picker.source.js;TI" names;T[I"x_sprockets_linecount;Ti;: charsetI" utf-8;F: digest"%XßânÁüŒâ vÍã™ã(.><¡QפUœg• : lengthiÍ:environment_versionI"1.0;T:dependencies_digest"%Å€«@ðø€S”xj_,¼³ ƒ‘º âõçæ«Ú‡y·:idI"E4bb39bb6b5a45432e421a8475145af133dac5d81f3511f270c157a40c894e467;F