Skip to content

Commit db828db

Browse files
authored
Merge pull request #827 from geneukum/minor-table-of-contents-tweaks
Follow-up items from updating table of contents component to glimmer
2 parents 4dde8ab + b48fdde commit db828db

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

app/components/table-of-contents.hbs

Lines changed: 4 additions & 4 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}}>
@@ -39,6 +39,6 @@
3939
</li>
4040
</ol>
4141
<label class='toc-private-toggle'>
42-
<Input @type='checkbox' @checked={{@showPrivateClasses}} class='private-deprecated-toggle' />
42+
<input type='checkbox' checked={{@showPrivateClasses}} onchange={{@togglePrivateClasses}} class='private-deprecated-toggle' />
4343
Show Private / Deprecated
4444
</label>

app/controllers/project-version.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable ember/no-computed-properties-in-native-classes */
2-
import { computed } from '@ember/object';
2+
import { action, computed, set } from '@ember/object';
33
import { inject as service } from '@ember/service';
44
import { readOnly, alias } from '@ember/object/computed';
55
import Controller from '@ember/controller';
@@ -121,4 +121,9 @@ export default class ProjectVersionController extends Controller {
121121

122122
@readOnly('model.project.id')
123123
activeProject;
124+
125+
@action
126+
togglePrivateClasses() {
127+
set(this, 'showPrivateClasses', !this.showPrivateClasses);
128+
}
124129
}

app/templates/project-version.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
@moduleIDs={{this.shownModuleIDs}}
3535
@namespaceIDs={{this.shownNamespaceIDs}}
3636
@showPrivateClasses={{this.showPrivateClasses}}
37+
@togglePrivateClasses={{this.togglePrivateClasses}}
3738
@isShowingNamespaces={{version-lt this.selectedProjectVersion.compactVersion "2.16"}}
3839
/>
3940
</aside>

0 commit comments

Comments
 (0)