Sha256: a7b28aa24918f17b6953219260c1629f0f86826f5e75d0997aa341987d3324ff
Contents?: true
Size: 1.82 KB
Versions: 14
Compression:
Stored size: 1.82 KB
Contents
I"@(function() { var PageModuleEditSubjectForm, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; PageModuleEditSubjectForm = (function() { function PageModuleEditSubjectForm() { 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("/admin/posts/find", { 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.headline, value: item.headline, subject_id: item.id }); } 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() { return $('.js-post-multiselect').multiselect(); }; return PageModuleEditSubjectForm; })(); window.PageModuleEditSubjectForm = PageModuleEditSubjectForm; }).call(this); :ET
Version data entries
14 entries across 10 versions & 1 rubygems