mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Use button for sidebar section header
Buttons can be focused and action triggered via the enter key compared to a span.
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
{{#if @collapsable}}
|
||||
<span
|
||||
role="button"
|
||||
title={{i18n "sidebar.toggle_section"}}
|
||||
class="sidebar-section-header sidebar-section-header-collapsable"
|
||||
{{on "click" @toggleSectionDisplay}}
|
||||
>
|
||||
<DButton
|
||||
@title="sidebar.toggle_section"
|
||||
@class="sidebar-section-header sidebar-section-header-collapsable btn-flat"
|
||||
@action={{@toggleSectionDisplay}} >
|
||||
|
||||
{{yield}}
|
||||
</span>
|
||||
</DButton>
|
||||
{{else}}
|
||||
<span class="sidebar-section-header" title={{i18n "sidebar.toggle_section"}}>
|
||||
{{yield}}
|
||||
|
||||
@@ -202,7 +202,7 @@ acceptance("Sidebar - Plugin API", function (needs) {
|
||||
|
||||
assert.strictEqual(
|
||||
query(
|
||||
".sidebar-section-test-chat-channels .sidebar-section-header"
|
||||
".sidebar-section-test-chat-channels .sidebar-section-header-text"
|
||||
).textContent.trim(),
|
||||
"chat channels text",
|
||||
"displays header with correct text"
|
||||
@@ -381,7 +381,7 @@ acceptance("Sidebar - Plugin API", function (needs) {
|
||||
|
||||
assert.strictEqual(
|
||||
query(
|
||||
".sidebar-section-test-chat-channels .sidebar-section-header"
|
||||
".sidebar-section-test-chat-channels .sidebar-section-header-text"
|
||||
).textContent.trim(),
|
||||
"chat channels text",
|
||||
"displays header with correct text"
|
||||
|
||||
Reference in New Issue
Block a user