Skip to content
Extraits de code Groupes Projets
Valider bde3b47c rédigé par Marien Fressinaud's avatar Marien Fressinaud Validation de Augier
Parcourir les fichiers

[WIP] [mobile] Embedded new comment form in HTML

parent 053625c2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -122,27 +122,29 @@ ...@@ -122,27 +122,29 @@
showCommentBox: function(link){ showCommentBox: function(link){
if(!link.hasClass("inactive") || link.hasClass("loading")) { return; } if(!link.hasClass("inactive") || link.hasClass("loading")) { return; }
var self = this; // var self = this;
$.ajax({ // $.ajax({
url: link.attr("href"), // url: link.attr("href"),
beforeSend: function(){ // beforeSend: function(){
link.addClass("loading"); // link.addClass("loading");
}, // },
context: link, // context: link,
success: function(data) { // success: function(data) {
self.appendCommentBox.call(this, link, data); // self.appendCommentBox.call(this, link, data);
}, // },
error: function() { // error: function() {
link.removeClass("loading"); // link.removeClass("loading");
} // }
}); // });
this.appendCommentBox(link);
}, },
appendCommentBox: function(link, data) { appendCommentBox: function(link) {
link.removeClass("loading"); link.removeClass("loading");
link.removeClass("inactive"); link.removeClass("inactive");
var bottomBar = link.closest(".bottom_bar").first(); var bottomBar = link.closest(".bottom_bar").first();
bottomBar.append(data); // bottomBar.append(data);
var addCommentSwitcher = bottomBar.find(".add-comment-switcher").removeClass('hidden')
var textArea = bottomBar.find("textarea.comment_box").first()[0]; var textArea = bottomBar.find("textarea.comment_box").first()[0];
autosize(textArea); autosize(textArea);
}, },
......
...@@ -29,3 +29,6 @@ ...@@ -29,3 +29,6 @@
- if defined?(expanded_info) && expanded_info - if defined?(expanded_info) && expanded_info
= render partial: "shared/post_stats", locals: {post: @post} = render partial: "shared/post_stats", locals: {post: @post}
.add-comment-switcher{class: ('hidden' unless defined?(expanded_info) && expanded_info)}
= render :partial => 'comments/new_comment', :locals =>{:post_id => post.id}
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