Sha256: f097571e6a83fa74b0e25e779bc946ea80f5efca6261fd11f7b4e40267d0bf54

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 KB

Contents

I"à(function() {
  window.dorsaleComments = {
    load: function() {
      return $("#dorsale-comments").map(function() {
        var container, url;
        container = $(this);
        url = this.dataset.url;
        return $.ajax({
          url: url,
          success: function(data) {
            container.html(data);
            setupUploadInputs(container);
            dorsaleComments.setupCreateForm();
            dorsaleComments.setupEditButtons();
            return dorsaleComments.setupDeleteButtons();
          }
        });
      });
    },
    reload: function() {
      return dorsaleComments.load();
    },
    setupCreateForm: function() {
      return $("#new_attachment").on("ajax:success", dorsaleComments.reload);
    },
    setupEditForm: function() {
      return $("#edit_comment").on("ajax:success", dorsaleComments.reload);
    },
    setupEditButtons: function() {
      return $("#dorsale-comment [href$=edit]").click(function() {
        var container, url;
        container = $(this).parents(".comment");
        url = this.href;
        $.ajax({
          url: url,
          success: function(data) {
            container.html(data);
            return dorsaleComments.setupEditForm();
          }
        });
        return false;
      });
    },
    setupDeleteButtons: function() {
      return $("#dorsale-attachments [data-method=delete]").map(function() {
        return $(this).on("ajax:success", dorsaleComments.reload);
      });
    }
  };

}).call(this);
:ET

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dorsale-3.1.1 spec/dummy/tmp/cache/assets/sprockets/v3.0/4w/4wz1Uw7S8oWNA2fLr4nrPHfO8mRMXfrxH-bo1LiCS1s.cache
dorsale-3.1.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/4w/4wz1Uw7S8oWNA2fLr4nrPHfO8mRMXfrxH-bo1LiCS1s.cache