Add followable specific notices to follows controller actions and render notice on AJAX JS response.
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
App.Followable =
|
||||
|
||||
update: (followable_id, button) ->
|
||||
update: (followable_id, button, notice) ->
|
||||
$("#" + followable_id + " .js-follow").html(button)
|
||||
if ($('[data-alert]').length > 0)
|
||||
$('[data-alert]').replaceWith(notice)
|
||||
else
|
||||
$("body").append(notice)
|
||||
|
||||
Reference in New Issue
Block a user