Skip to content

Commit 96f5f07

Browse files
committed
Remove the collapse feature, improve visuals of categories
1 parent 587f5e8 commit 96f5f07

File tree

4 files changed

+29
-35
lines changed

4 files changed

+29
-35
lines changed

com.woltlab.wcf/templates/shared_categorizedSingleSelectionFormField.tpl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@
1919
</div>
2020
<ul class="scrollableCheckboxList">
2121
{foreach from=$field->getNestedOptions() item=__fieldNestedOption}
22-
<li{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}{if !$__fieldNestedOption[isSelectable]} data-open="true"{/if}>
23-
{if $__fieldNestedOption[isSelectable]}
22+
<li
23+
{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}
24+
{if !$__fieldNestedOption[isSelectable]} class="scrollableCheckboxList__category"{/if}
25+
>
26+
{if !$__fieldNestedOption[isSelectable]}
27+
<span class="scrollableCheckboxList__category__label">{unsafe:$__fieldNestedOption[label]}</span>
28+
{else}
2429
<label>
2530
<input {*
2631
*}type="radio" {*
@@ -31,8 +36,6 @@
3136
*}{if $field->isImmutable()} disabled{/if}{*
3237
*}> <span>{unsafe:$__fieldNestedOption[label]}</span>
3338
</label>
34-
{else}
35-
<button type="button">{icon name="chevron-down"} {unsafe:$__fieldNestedOption[label]}</button>
3639
{/if}
3740
</li>
3841
{/foreach}

ts/WoltLabSuite/Core/Component/ItemList/Categorized.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,10 @@ export class CategorizedItemList {
8282
element: li,
8383
};
8484
this.#categories.push(category);
85-
86-
li.addEventListener("click", (event) => {
87-
this.#categoryClick(event, li, items);
88-
});
8985
}
9086
}
9187
}
9288

93-
#categoryClick(event: MouseEvent, li: HTMLLIElement, items: Item[]): void {
94-
event.preventDefault();
95-
96-
const isOpen = !this.#categoryIsOpen(li);
97-
li.dataset.open = isOpen ? "true" : "false";
98-
99-
li.querySelector("fa-icon")!.setIcon(isOpen ? "chevron-down" : "chevron-right");
100-
101-
this.#showItems({
102-
items: items,
103-
element: li,
104-
});
105-
}
106-
10789
#categoryIsOpen(category: HTMLLIElement): boolean {
10890
return category.dataset.open === "true";
10991
}

wcfsetup/install/files/js/WoltLabSuite/Core/Component/ItemList/Categorized.js

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wcfsetup/install/files/style/ui/scrollableCheckboxList.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,28 @@
1414
}
1515
}
1616

17+
.scrollableCheckboxList__category:not(:first-child) {
18+
margin-top: 5px;
19+
}
20+
21+
.scrollableCheckboxList__category__label {
22+
align-items: center;
23+
color: var(--wcfContentDimmedText);
24+
column-gap: 10px;
25+
display: flex;
26+
font-size: 12px;
27+
margin-bottom: 5px;
28+
white-space: nowrap;
29+
30+
&::after {
31+
border-top: 1px solid currentColor;
32+
content: "";
33+
display: block;
34+
width: 100%;
35+
opacity: 0.34;
36+
}
37+
}
38+
1739
.dialogContent .scrollableCheckboxList {
1840
max-height: 300px;
1941
}

0 commit comments

Comments
 (0)