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

Fix comment creation button state toggle #10019

Merged
merged 1 commit into from
Aug 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update create.js.erb
Made appropriate changes in the file. Please review it
  • Loading branch information
aummishra committed Aug 11, 2021
commit 19928754c77631b9b65cef68f9628f66b3120908
3 changes: 2 additions & 1 deletion app/views/comments/create.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ let fileUploadElements = [
// no other elements need upload functionality
$('#comment-<%= @comment.reply_to %>-reply-toggle').before('<%= escape_javascript(render :partial => "notes/comment", :locals => {comment: @comment, answer_id: @answer_id}) %>')
$('textarea#text-input-reply-<%= @comment.reply_to %>').val("");
$("#comment-<%= @comment.reply_to %>-reply").toggle();
<% end %>
// create image upload functionality for fresh comment's elements
// see editorToolbar.js
Expand All @@ -44,4 +45,4 @@ fileUploadElements.forEach(function(element) {
notyNotification('mint', 3000, 'success', 'topRight', 'Comment Added!');
$('#comment-count')[0].innerHTML = parseInt($('#comment-count')[0].innerHTML, 10)+1;
// attach tooltips to comment buttons
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="tooltip"]').tooltip();