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

Version Path
virgo-0.3.12 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.3.12 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.2.5 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.2.5 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.2.4 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.2.4 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.1.13 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.1.13 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.1.7 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.1.6 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.1.5 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.1.4 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.1.3 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache
virgo-0.1.2 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Sy_luYHMkKabfbEz_AomSOI66lDMF7EyiEbWH7E9dNg.cache