1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

Change arrow direction in Categories page.

This commit is contained in:
Cotes Chung
2019-11-23 00:42:14 +08:00
parent 7f94cbe787
commit 81721ef295
5 changed files with 17 additions and 16 deletions

View File

@@ -8,22 +8,22 @@ $(function() {
var child_prefix = "l_";
var parent_prefix = "h_";
// close up Top
// close up top-category
$(".collapse").on("hide.bs.collapse", function() { // Bootstrap collapse events.
var parent_id = parent_prefix + $(this).attr('id').substring(child_prefix.length);
if (parent_id) {
$("#" + parent_id + " .far.fa-folder-open").attr("class", "far fa-folder fa-fw");
$("#" + parent_id + " i.fas.fa-angle-up").addClass("flip");
$("#" + parent_id + " i.fas").addClass("rotate");
$("#" + parent_id).removeClass("hide-border-bottom");
}
});
// expand Top Category
// expand the top category
$(".collapse").on("show.bs.collapse", function() {
var parent_id = parent_prefix + $(this).attr('id').substring(child_prefix.length);
if (parent_id) {
$("#" + parent_id + " .far.fa-folder").attr("class", "far fa-folder-open fa-fw");
$("#" + parent_id + " i.fas.fa-angle-up").removeClass("flip");
$("#" + parent_id + " i.fas").removeClass("rotate");
$("#" + parent_id).addClass("hide-border-bottom");
}
});