diaspora/app/views/conversations/create.js.erb
kevivmatrix 6623e86a5a private message sending changed to ajax
added specs for change in controller

one form of hash used in single line of code

rendering create response on sending message

redirect user to conversation page if message sent successfully

removed deprecated way of rendering file

conversations create for mobile fixed

minor code style change

updated changelog
2013-07-06 14:35:09 +05:30

11 lines
No EOL
497 B
Text

var response = <%= raw @response.to_json %>;
<% if session[:mobile_view] %>
window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>";
<% else %>
Diaspora.page.flashMessages.render({ 'success':response.success, 'notice':response.message });
if(response.success){
$("#new_conversation").removeClass('form_do_not_clear').clearForm();
$.facebox.close();
window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>";
}
<% end %>