Skip to content

Commit

Permalink
Initially hide comment feedback elements using a class
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Nov 12, 2023
1 parent e92f16a commit e9a4596
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/publify.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@
.tag-sidebar-tag-cloud {
overflow: hidden;
}

.hidden {
display: none;
}
4 changes: 2 additions & 2 deletions app/views/articles/_comment_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= form_tag @article.comment_url, id: 'comment_form', remote: true do %>
<div class="comment-box">
<div id="errors" style="display: none"></div>
<div id="preview" style="display: none"></div>
<div id="errors" class="hidden"></div>
<div id="preview" class="hidden"></div>

<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
Expand Down
2 changes: 1 addition & 1 deletion app/views/articles/comment_failed.js.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
var message = "<%= j render 'articles/comment_errors', comment: @comment %>";
$('#preview').hide();
$('#errors').hide().html(message).fadeIn();
$('#errors').hide().removeClass("hidden").html(message).fadeIn();
2 changes: 1 addition & 1 deletion app/views/comments/preview.js.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
var preview = "<%= j render 'articles/comment_preview', comment: @comment %>";
$('#errors').hide();
$('#preview').hide().html(preview).fadeIn();
$('#preview').hide().removeClass("hidden").html(preview).fadeIn();

0 comments on commit e9a4596

Please sign in to comment.