Replaces icons of expand/collapse comments

This commit is contained in:
decabeza
2020-04-16 23:22:14 +02:00
parent d99875cde2
commit 111e3d3083
4 changed files with 8 additions and 19 deletions

View File

@@ -40,13 +40,7 @@
$("#js-comment-form-" + id).toggle(); $("#js-comment-form-" + id).toggle();
}, },
toggle_arrow: function(id) { toggle_arrow: function(id) {
var arrow; $("span#" + id + "_arrow").toggleClass("fa-minus-square").toggleClass("fa-plus-square");
arrow = "span#" + id + "_arrow";
if ($(arrow).hasClass("icon-arrow-right")) {
$(arrow).removeClass("icon-arrow-right").addClass("icon-arrow-down");
} else {
$(arrow).removeClass("icon-arrow-down").addClass("icon-arrow-right");
}
}, },
initialize: function() { initialize: function() {
$("body .js-add-comment-link").each(function() { $("body .js-add-comment-link").each(function() {

View File

@@ -203,10 +203,6 @@
content: "\f00b"; content: "\f00b";
} }
.icon-arrow-down::before {
content: "\f0dd";
}
.icon-arrow-left::before { .icon-arrow-left::before {
content: "\f0d9"; content: "\f0d9";
} }

View File

@@ -2116,17 +2116,16 @@ table {
padding: $line-height / 4; padding: $line-height / 4;
position: relative; position: relative;
.relative, .relative {
[class^="icon-arrow"] { padding-left: rem-calc(18);
padding-left: $line-height / 2;
} }
[class^="icon-arrow"] { .far {
font-size: $base-font-size; font-size: $small-font-size;
left: -20px; left: 0;
position: absolute; position: absolute;
text-decoration: none; text-decoration: none;
top: -1px; top: 2px;
} }
.divider { .divider {

View File

@@ -94,7 +94,7 @@
<%= link_to "", class: "js-toggle-children relative", data: { "id": "#{dom_id(comment)}" } do %> <%= link_to "", class: "js-toggle-children relative", data: { "id": "#{dom_id(comment)}" } do %>
<span class="show-for-sr js-child-toggle" style="display: none;"><%= t("shared.show") %></span> <span class="show-for-sr js-child-toggle" style="display: none;"><%= t("shared.show") %></span>
<span class="show-for-sr js-child-toggle"><%= t("shared.hide") %></span> <span class="show-for-sr js-child-toggle"><%= t("shared.hide") %></span>
<span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span> <span id="<%= dom_id(comment) %>_children_arrow" class="far fa-minus-square"></span>
<span class="js-child-toggle" style="display: none;"><%= t("comments.comment.responses_show", count: comment.children.size) %></span> <span class="js-child-toggle" style="display: none;"><%= t("comments.comment.responses_show", count: comment.children.size) %></span>
<span class="js-child-toggle"><%= t("comments.comment.responses_collapse", count: comment.children.size) %></span> <span class="js-child-toggle"><%= t("comments.comment.responses_collapse", count: comment.children.size) %></span>
<% end %> <% end %>