Skip to content

Commit

Permalink
Fix sortbox
Browse files Browse the repository at this point in the history
  • Loading branch information
tfedor committed May 28, 2024
1 parent 0725ec1 commit 90a0b65
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/js/Content/Modules/Widgets/SortBox.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<svelte:options immutable={false} />

<script lang="ts">
import {L} from "@Core/Localization/Localization";
import {__sortBy, __thewordunknown} from "@Strings/_strings";
Expand All @@ -17,11 +19,11 @@
let selectedName: string;
let direction: number;
let triggerNode: HTMLElement;
let containerNode: HTMLElement;
let isOpen: boolean = false;
function clickOutsideHandler(e: MouseEvent): void {
if (!triggerNode.contains(<HTMLElement>e.target)) {
if (!containerNode.contains(<HTMLElement>e.target)) {
hide();
}
}
Expand Down Expand Up @@ -79,9 +81,8 @@
class:as-sortbox--friends={name === "friends"}
>
<div class="as-sortbox__label">{L(__sortBy)}</div>
<div class="as-sortbox__container">
<button bind:this={triggerNode}
class="as-sortbox__trigger"
<div class="as-sortbox__container" bind:this={containerNode}>
<button class="as-sortbox__trigger"
class:is-open={isOpen}
on:click={show}>{selectedName}</button>

Expand Down Expand Up @@ -145,9 +146,11 @@
}
.as-sortbox__reverse {
cursor: pointer;
color: white;
}
.as-sortbox__trigger {
display: block;
width: 100%;
color: #67c1f5;
padding: 0 30px 0 8px;
font-size: 12px;
Expand Down Expand Up @@ -180,6 +183,7 @@
}
.as-dropdown {
position: relative;
display: none;
}
.as-dropdown.is-open {
display: block;
Expand All @@ -202,6 +206,7 @@
ul button {
padding: 0 10px;
display: block;
width: 100%;
text-decoration: none;
color: #e5e4dc;
white-space: nowrap;
Expand Down

0 comments on commit 90a0b65

Please sign in to comment.