{:uriI"Ýfile:///Users/nzaillian/Projects/virgo/app/assets/javascripts/virgo/admin/page_modules/edit_subject_form.coffee?type=application/javascript&pipeline=self&id=9b16c69f12507de6fef3810d6242baea732e6d3e9ad95f0ad16bbc693dbcc7e9:ET:load_pathI";/Users/nzaillian/Projects/virgo/app/assets/javascripts;T: filenameI"m/Users/nzaillian/Projects/virgo/app/assets/javascripts/virgo/admin/page_modules/edit_subject_form.coffee;T: nameI"/virgo/admin/page_modules/edit_subject_form;T:logical_pathI"7virgo/admin/page_modules/edit_subject_form.self.js;T:content_typeI"application/javascript;T: sourceI"• (function() { var PageModuleEditSubjectForm, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; PageModuleEditSubjectForm = (function() { function PageModuleEditSubjectForm() { this.search_posts = bind(this.search_posts, this); this.init_multiselect = bind(this.init_multiselect, this); this.init_multiselect(); this.post_select = $('#page-module-subject-select'); this.subject_id_input = $("#page_module_subject_id"); this.clear_link = $(".js-clear-page-module-subject"); this.post_select.autocomplete({ source: (function(_this) { return function(request, response) { return $.get(_this.post_select.attr("data-autocomplete-uri"), { term: request.term }, function(resp) { var data, i, item, len, ref; data = []; ref = resp.posts; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; data.push({ label: item.label, value: item.label, subject_id: item.value }); } return response(data); }); }; })(this), select: (function(_this) { return function(event, ui) { return _this.subject_id_input.val(ui.item.subject_id); }; })(this) }); this.clear_link.click((function(_this) { return function(e) { e.preventDefault(); _this.post_select.val(""); return _this.subject_id_input.val(""); }; })(this)); } PageModuleEditSubjectForm.prototype.init_multiselect = function() { this.post_multiselect = $('.js-post-multiselect'); return this.post_multiselect.multiselect({ searchFunc: this.search_posts }); }; PageModuleEditSubjectForm.prototype.search_posts = function(term, callback) { if (term !== "") { return $.get(this.post_multiselect.attr("data-autocomplete-uri"), { term: term }, (function(_this) { return function(response) { return callback([response.posts]); }; })(this)); } else { return callback([null]); } }; return PageModuleEditSubjectForm; })(); window.PageModuleEditSubjectForm = PageModuleEditSubjectForm; }).call(this); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"{file-digest:///Users/nzaillian/Projects/virgo/app/assets/javascripts/virgo/admin/page_modules/edit_subject_form.coffee;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%:²ìVø\ÑØÝæÏ4X÷BÞÔÅ ]{Ÿq’Tôí(: lengthi• :dependencies_digest"%* èO~Ö™[ y.‚ðŒ§~âg; ƒ ¿¤†:idI"E9b16c69f12507de6fef3810d6242baea732e6d3e9ad95f0ad16bbc693dbcc7e9;F: mtimel+`ÜU