Files
discourse/app/assets/javascripts/discourse/app/components/sidebar/section.hbs
Krzysztof Kotlarek 4929288bdd FIX: delay custom section reorder (#20799)
Reorder should start after 300ms.
In addition, pointer events should be blocked to not open link after reorder is finished.
2023-03-24 13:58:05 +11:00

53 lines
1.6 KiB
Handlebars

{{#if this.displaySection}}
<div
class={{concat-class "sidebar-section-wrapper sidebar-section" @class}}
data-section-name={{@sectionName}}
>
<div class="sidebar-section-header-wrapper sidebar-row">
<Sidebar::SectionHeader
@collapsable={{@collapsable}}
@sidebarSectionContentID={{this.sidebarSectionContentID}}
@toggleSectionDisplay={{this.toggleSectionDisplay}}
@isExpanded={{this.displaySectionContent}}
>
{{#if @collapsable}}
<span class="sidebar-section-header-caret">
{{d-icon this.headerCaretIcon}}
</span>
{{/if}}
<span class="sidebar-section-header-text">
{{@headerLinkText}}
</span>
</Sidebar::SectionHeader>
{{#if this.isSingleHeaderAction}}
{{#each @headerActions as |headerAction|}}
<button
type="button"
class="sidebar-section-header-button"
{{on "click" headerAction.action}}
title={{headerAction.title}}
>
{{d-icon @headerActionsIcon}}
</button>
{{/each}}
{{/if}}
{{#if this.isMultipleHeaderActions}}
<DropdownSelectBox
@options={{hash icon=@headerActionsIcon placementStrategy="absolute"}}
@content={{@headerActions}}
@onChange={{action "handleMultipleHeaderActions"}}
@class="sidebar-section-header-dropdown"
/>
{{/if}}
</div>
{{#if this.displaySectionContent}}
<ul class="sidebar-section-content" id={{this.sidebarSectionContentID}}>
{{yield}}
</ul>
{{/if}}
</div>
{{/if}}