Skip to content

Commit 68d63ee

Browse files
committed
make category foldable
1 parent 7a93107 commit 68d63ee

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎css/stylesheet.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ button.indent {
6060
padding-left: 28px;
6161
}
6262

63+
button.fold {
64+
display: none !important;
65+
}
66+
6367
.divider {
6468
position: absolute !important;
6569
z-index: 3;

‎js/script.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ $.getJSON('./algorithm/category.json', function (data) {
154154
for (var category in list) {
155155
(function (category) {
156156
var $category = $('<button class="category">').append(list[category].name);
157+
$category.click(function () {
158+
$('[data-category="' + category + '"]').toggleClass('fold');
159+
});
157160
$('#list').append($category);
158161
var subList = list[category].list;
159162
for (var algorithm in subList) {

0 commit comments

Comments
 (0)