Skip to content
Extraits de code Groupes Projets
Valider 7a2f6dae rédigé par Maxwell Salzberg's avatar Maxwell Salzberg
Parcourir les fichiers

fixed js error on new comments on statusmessage show page

parent f1f0d6e2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -21,18 +21,7 @@ class CommentsController < ApplicationController
Postzord::Dispatch.new(current_user, @comment).post
respond_to do |format|
format.js{
json = { :post_id => @comment.post_id,
:comment_id => @comment.id,
:html => render_to_string(
:partial => 'comments/comment',
:locals => { :comment => @comment,
:person => current_user.person,
}
)
}
render(:json => json, :status => 201)
}
format.js{ render(:create, :status => 201)}
format.html{ render :nothing => true, :status => 201 }
format.mobile{ redirect_to @comment.post }
end
......
WebSocketReceiver.processComment(<%= @comment.post_id %>,
<%= @comment.id %>,
"<%= escape_javascript(render(:partial => 'comments/comment', :locals => { :comment => @comment, :person => current_user.person}))%>",
false);
......@@ -89,10 +89,6 @@ var Stream = {
}
});
$(stream_string + " .new_comment").live('ajax:success', function(data, json, xhr) {
json = $.parseJSON(json);
WebSocketReceiver.processComment(json.post_id, json.comment_id, json.html, false);
});
$(stream_string + ".new_comment").live('ajax:failure', function(data, html, xhr) {
Diaspora.widgets.alert.alert('Failed to post message!');
});
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter