ensl.org/app/views/shoutmsgs/create.js.erb

9 lines
462 B
Text
Raw Normal View History

<% if @shoutmsg.domain == "shoutbox" %>
$("div#shoutbox").prepend("<%= escape_javascript(render("shoutmsg", :shoutmsg => @shoutmsg)) %>");
$("form#new_shoutbox")[0].reset();
<% else %>
$("div#<%= @shoutmsg.domain %>").append("<%= escape_javascript(render("shoutmsg", :shoutmsg => @shoutmsg)) %>");
$("div#<%= @shoutmsg.domain %>").scrollTop($("div#<%= @shoutmsg.domain %>")[0].scrollHeight);
$("form#new_<%= @shoutmsg.domain %>")[0].reset();
<% end %>