{:uriI"file:///Users/npepinpe/work/github/barcoo/kadmin/app/assets/javascripts/kadmin/select2.js?type=application/javascript&pipeline=self&id=c9cc0e67267f2d34e5a7c6900706d540dbcc8a18204380dfe0f259658891dc24:ET:load_pathI"E/Users/npepinpe/work/github/barcoo/kadmin/app/assets/javascripts;T: filenameI"W/Users/npepinpe/work/github/barcoo/kadmin/app/assets/javascripts/kadmin/select2.js;T: nameI"kadmin/select2;T:logical_pathI"kadmin/select2.self.js;T:content_typeI"application/javascript;T: sourceI"$(document).ready(function() { $.fn.select2.defaults.set("theme", "bootstrap"); $.fn.select2.defaults.set("ajax", { cache: true, dataType: "json", delay: 300, data: transformRequest, processResults: transformResponse }); $.fn.select2.defaults.set("minimumInputLength", 2); $.fn.select2.defaults.set("allowClear", true); function transformRequest(params) { var page = params.page || 0; var page_size = this.data('kadmin--page-size') || 10; var filter_param = this.data('kadmin--filter-param') || null; var options = { page_offset: page * page_size, page_size: page_size }; if (filter_param) { options[filter_param] = params.term; } return options; } function transformResponse(data, params) { var items = data.data || data.items; var options = this.options.options.kadmin || {}; // weird but it is what it is var displayProperty = options.displayProperty || 'text'; var valueProperty = options.valueProperty || 'id'; var results = []; $(items).each(function(index, item) { results.push({ text: item[displayProperty], id: item[valueProperty] }); }); return { results: results, pagination: { more: data.more } }; } // Need to delay a bit otherwise we have issues // TODO: Figure out why this happens? setTimeout(function() { $('select.kadmin-select2').each(function() { $(this).select2(); }); }, 300); }); ;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"efile-digest:///Users/npepinpe/work/github/barcoo/kadmin/app/assets/javascripts/kadmin/select2.js;TTI"$file-digest://app/assets/images;TTI",file-digest://app/assets/images/select2;TTI")file-digest://app/assets/javascripts;TTI"1file-digest://app/assets/javascripts/select2;TTI")file-digest://app/assets/stylesheets;TTI"1file-digest://app/assets/stylesheets/select2;TTI"Nfile-digest:///Users/npepinpe/work/github/barcoo/kadmin/app/assets/images;TTI"Vfile-digest:///Users/npepinpe/work/github/barcoo/kadmin/app/assets/images/select2;TTI"Sfile-digest:///Users/npepinpe/work/github/barcoo/kadmin/app/assets/javascripts;TTI"[file-digest:///Users/npepinpe/work/github/barcoo/kadmin/app/assets/javascripts/select2;TTI"Sfile-digest:///Users/npepinpe/work/github/barcoo/kadmin/app/assets/stylesheets;TTI"[file-digest:///Users/npepinpe/work/github/barcoo/kadmin/app/assets/stylesheets/select2;TTI"Pfile-digest:///Users/npepinpe/work/github/barcoo/kadmin/vendor/assets/fonts;TTI"Xfile-digest:///Users/npepinpe/work/github/barcoo/kadmin/vendor/assets/fonts/select2;TTI"Vfile-digest:///Users/npepinpe/work/github/barcoo/kadmin/vendor/assets/javascripts;TTI"^file-digest:///Users/npepinpe/work/github/barcoo/kadmin/vendor/assets/javascripts/select2;TTI"afile-digest:///Users/npepinpe/work/github/barcoo/kadmin/vendor/assets/javascripts/select2.js;TTF: requiredo;;}I"file:///Users/npepinpe/work/github/barcoo/kadmin/vendor/assets/javascripts/select2.js?type=application/javascript&pipeline=self;TTF: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%:wȰ6OO(׬k=yVkY>B\: lengthi:dependencies_digest"%vQEfη"r-ȁM8H:idI"Ec9cc0e67267f2d34e5a7c6900706d540dbcc8a18204380dfe0f259658891dc24;F: mtimel+-|=X