Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure formatting toolbars on comments appear in all variations #8477

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/views/comments/_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
#imagebar {width:100%;}
</style>

<% if params[:controller] == 'questions' %>
<%= render :partial => "editor/toolbar" %>
<% end %>

<%= render :partial => "editor/toolbar" %>

<div id="c<%= comment.id%>div" class="form-group">
<textarea aria-label="Edit Comment" onFocus="editing=true" name="body" class="form-control" id="c<%= comment.id%>text" rows="6" cols="40" placeholder="<%= placeholder %>"><%= !(comment.is_a?Answer) ? comment.comment : comment.content %></textarea>

Expand Down
5 changes: 2 additions & 3 deletions app/views/comments/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
}
</style>

<% if params[:controller] == 'questions' %>
<%= render :partial => "editor/toolbar" %>
<% end %>

<%= render :partial => "editor/toolbar" %>

<% if local_assigns[:reply_to].present? %>
<%= hidden_field_tag :reply_to, local_assigns[:reply_to] %>
Expand Down
1 change: 1 addition & 0 deletions app/views/comments/create.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ $('#answer-<%= @answer_id %>-comment-section .help-block').remove();
notyNotification('mint', 3000, 'success', 'topRight', 'Comment Added!');
$('#comment-count')[0].innerHTML = parseInt($('#comment-count')[0].innerHTML, 10)+1;


4 changes: 2 additions & 2 deletions test/system/comment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def setup
# Create a comment
page.execute_script <<-JS
var commentForm = $('.comment-form-wrapper')[1];
var submitCommentBtn = $(commentForm).find('.btn')[0];
var submitCommentBtn = $(commentForm).find('.btn-primary')[0];
var commentTextarea = $(commentForm).find('#text-input')[0]

$(commentTextarea).val('Great post Jeff!')
Expand All @@ -236,7 +236,7 @@ def setup
# Create a comment
page.execute_script <<-JS
var commentForm = $('.comment-form-wrapper')[1];
var submitCommentBtn = $(commentForm).find('.btn')[0];
var submitCommentBtn = $(commentForm).find('.btn-primary')[0];
var commentTextarea = $(commentForm).find('#text-input')[0]

// Fill the form
Expand Down