Skip to content

Commit 216e230

Browse files
committed
table-of-contents: avoid action helper
Let's avoid using the `action` helper and instead prefer to use the `on` and `fn` helpers together. These new helpers have more clearly delineated responsibilities, which should make the operations a little bit easier to understand.
1 parent 50ee371 commit 216e230

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/components/table-of-contents.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ol class='toc-level-0'>
22
<li class='toc-level-0'>
3-
<a {{action 'toggle' 'modules'}} href='#' data-test-toc-title='packages'>Packages</a>
3+
<a {{on 'click' (fn this.toggle 'modules')}} href='#' data-test-toc-title='packages'>Packages</a>
44
<ol class='toc-level-1 modules selected'>
55
{{#each @moduleIDs as |moduleID|}}
66

@@ -16,7 +16,7 @@
1616

1717
{{#if @isShowingNamespaces}}
1818
<li class='toc-level-0'>
19-
<a {{action 'toggle' 'namespaces'}} href='#' data-test-toc-title='namespaces'>Namespaces</a>
19+
<a {{on 'click' (fn this.toggle 'namespaces')}} href='#' data-test-toc-title='namespaces'>Namespaces</a>
2020
<ol class='toc-level-1 namespaces selected'>
2121
{{#each @namespaceIDs as |namespaceID|}}
2222
<li class='toc-level-1' data-test-namespace={{namespaceID}}>
@@ -28,7 +28,7 @@
2828
{{/if}}
2929

3030
<li class='toc-level-0'>
31-
<a {{action 'toggle' 'classes'}} href='#' data-test-toc-title='classes'>Classes</a>
31+
<a {{on 'click' (fn this.toggle 'classes')}} href='#' data-test-toc-title='classes'>Classes</a>
3232
<ol class='toc-level-1 classes selected'>
3333
{{#each @classesIDs as |classID|}}
3434
<li class='toc-level-1' data-test-class={{classID}}>

0 commit comments

Comments
 (0)