Sha256: 56e2111f5609a89db1976b5d673713942045b92074e797eb9da8b9ea9d02b6a0

Contents?: true

Size: 1.03 KB

Versions: 45

Compression:

Stored size: 1.03 KB

Contents

var rails_connector = (function(rails_connector, $) {
  rails_connector.comments = {
    initialize: function() {
      var form = $("#comment_form");
      if (form.length > 0) {
        form.find(".submit").click(function() {
          $.post(form.attr("action"), form.serialize(), function(json) {
            form.find("label").removeClass("error");
            if (json.comment) {
              $("#no_comments").hide();
              $("#comment_list_container").show();
              var comment = $(json.comment).hide();
              $("#comment_list_container").append(comment);
              comment.slideDown(750, "swing");
              $("html, body").animate({scrollTop: comment.offset().top}, 1000);
              form[0].reset();
            } else {
              $.each(json.errors, function() {
                $("#comment_form_" + this + "_label").addClass("error");
              });
            }
          }, "json");
          return false;
        });
      }
    }
  };
  return rails_connector;
}(rails_connector || {}, jQuery));

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
infopark_rails_connector-6.9.1.3.22208381 app/assets/javascripts/comments.js
infopark_rails_connector-6.9.0.3.197272233 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.3.174.51542603 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.3.115.227021242 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.3.73.75172665 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.3.2.153416031 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.3.67.110847540 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.3.1.23895778 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.2.36.82613853 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.2.7.128454143 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.1.26.236500544 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.1 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.0.539.93842523 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.0.529.114081979 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.0.518.30999728 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.0.515.34928522 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.0.498.46559598 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.0.480.261594408 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.0.444.171626367 app/assets/javascripts/comments.js
infopark_rails_connector-6.8.0.406.131718077 app/assets/javascripts/comments.js