MorningPeak/app/assets/javascripts/commentable.coffee

12 lines
423 B
CoffeeScript

commentableLoadComments = (base_url) ->
$.get(base_url + "/comments/about").done (e) ->
$("#comments").html(e)
$(document).ready ->
url = window.location.pathname
commentableLoadComments(url)
$(document).on "ajax:success", "#new_comment", (e, data, status, xhr) ->
commentableLoadComments(url)
$(document).on "ajax:complete", ".remove-comment", (e, data, status, xhr) ->
commentableLoadComments(url)