Skip to content

Commit 0cf20ff

Browse files
MinThaMiekategengler
authored andcommitted
Make styling work, remove ember-anchor + updateAnchor implementation
1 parent b8933f6 commit 0cf20ff

File tree

8 files changed

+42
-93
lines changed

8 files changed

+42
-93
lines changed

app/components/class-field-description.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{! template-lint-disable no-invalid-interactive }}
22
<section class='{{@type}}'>
3-
<h3 data-anchor='{{@field.name}}'>
3+
<h3 id='{{@field.name}}'>
44
<span class='{{@type}}-name'>{{@field.name}}</span>
55
{{#if @field.params}}
66
<span class='args'>
@@ -17,7 +17,7 @@
1717
<span class='access'>deprecated</span>
1818
{{/if}}
1919
{{!-- TODO: Fix this link for a11y --}}
20-
<a class='class-field-description--link' data-test-anchor="{{@field.name}}" {{on 'click' (fn this.updateAnchor @field.name)}} {{!-- template-lint-disable link-href-attributes --}}>
20+
<a class='class-field-description--link' href="#{{@field.name}}" role='link'>
2121
{{svg-jar 'link' width='20px' height='20px'}}
2222
</a>
2323
</h3>
@@ -78,4 +78,4 @@
7878
{{/if}}
7979
</dl>
8080
<MarkdownToHtml @markdown={{@field.description}} />
81-
</section>
81+
</section>
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { inject as service } from '@ember/service';
22
import Component from '@glimmer/component';
3-
import { action } from '@ember/object';
43

54
export default class ClassFieldDescription extends Component {
65
@service
@@ -12,15 +11,4 @@ export default class ClassFieldDescription extends Component {
1211
this.args.field.class
1312
);
1413
}
15-
16-
/**
17-
* Callback for updating the anchor with the field name that was clicked by a user.
18-
*
19-
* @method updateAnchor
20-
* @method fieldName String The name representing the field that was clicked.
21-
*/
22-
@action
23-
updateAnchor(fieldName) {
24-
this.args.updateAnchor?.(fieldName);
25-
}
2614
}

app/components/ember-anchor.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/styles/app.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ dd {
137137
color: var(--color-gray-600);
138138
}
139139

140+
.on-this-page-wrapper .access-checkbox-list {
141+
display: flex;
142+
flex-direction: column;
143+
}
144+
145+
.on-this-page-wrapper .api-index-filter {
146+
margin-top: var(--spacing-2)
147+
}
148+
149+
.on-this-page-wrapper ul {
150+
margin-top: 0;
151+
}
152+
140153
.whoops {
141154
display: flex;
142155
justify-content: center;

app/templates/class-index.hbs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
<ApiIndexFilter @model={{this.model}} @filterData={{this.filterData}} as |filteredModel|>
22
<ApiIndex @itemData={{filteredModel}} @classNames="api__index__content" as |sectionData|>
33
{{#each sectionData.sections as |section|}}
4-
<h3 class="api-index-section-title">{{section.title}}</h3>
54
{{#if section.items}}
5+
<h3 class="api-index-section-title">{{section.title}}</h3>
66
<ul class="{{section.class}}">
77
{{#each section.items as |item|}}
88
<li data-test-item={{item.name}}>
9-
<LinkTo
10-
@route="{{this.parentName}}{{section.routeSuffix}}"
11-
@models={{array
12-
@model.project.id
13-
@model.projectVersion.compactVersion
14-
@model.name item.name
15-
}}
16-
@query={{hash anchor=item.name}}
9+
<a
10+
href="#{{item.name}}"
1711
>
1812
{{item.name}}
19-
</LinkTo>
13+
</a>
2014
</li>
2115
{{/each}}
2216
</ul>
23-
{{else}}
24-
<p>No documented items</p>
2517
{{/if}}
2618
{{/each}}
2719
</ApiIndex>

app/templates/project-version.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@isShowingNamespaces={{version-lt this.selectedProjectVersion.compactVersion "2.16"}}
3030
/>
3131
</EsSidebar>
32-
<section class="content">
32+
<section class="content-wrapper">
3333
{{outlet}}
3434
</section>
3535
</div>

app/templates/project-version/classes/class.hbs

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,31 +71,26 @@
7171
<ImportExample @item={{@model.name}} @package={{this.module}} />
7272
{{/if}}
7373
<p class="description"><MarkdownToHtml @markdown={{@model.description}} /></p>
74-
75-
{{#if (or @model.methods @model.properties @model.events)}}
74+
<hr>
75+
{{#if @model.methods}}
76+
<h2>Methods</h2>
77+
<Methods @model={{@model}} @filterData={{this.filterData}}/>
78+
{{/if}}
79+
{{#if @model.properties}}
80+
<h2>Properties</h2>
81+
<Properties @model={{@model}} @filterData={{this.filterData}}/>
82+
{{/if}}
83+
{{#if @model.events}}
84+
<h2>Events</h2>
85+
<Events @model={{@model}} @filterData={{this.filterData}}/>
86+
{{/if}}
87+
</article>
88+
<div class="on-this-page-wrapper">
89+
<div class="on-this-page-wrapper-header">On this page</div>
90+
<hr>
91+
{{#if (or @model.methods @model.properties @model.events)}}
7692
<div class="tabbed-layout">
77-
<nav class="tabbed-layout__menu">
78-
<LinkTo @route={{concat this.parentName ".index" }} @models={{array @model.project.id @model.projectVersion.compactVersion @model.name}} @query={{hash anchor=undefined}} class="tabbed-layout__menu__item" @activeClass="tabbed-layout__menu__item_selected" @current-when={{concat this.parentName ".index"}} data-test-tab="index">
79-
<span>Index</span>
80-
</LinkTo>
81-
{{#if @model.methods}}
82-
<LinkTo @route={{concat this.parentName ".methods" }} @models={{array @model.project.id @model.projectVersion.compactVersion @model.name}} @query={{hash anchor=undefined}} class="tabbed-layout__menu__item" @activeClass="tabbed-layout__menu__item_selected" @current-when={{concat this.parentName ".methods"}} data-test-tab="methods">
83-
<span>Methods</span>
84-
</LinkTo>
85-
{{/if}}
86-
{{#if @model.properties}}
87-
<LinkTo @route={{concat this.parentName ".properties" }} @models={{array @model.project.id @model.projectVersion.compactVersion @model.name}} @query={{hash anchor=undefined}} class="tabbed-layout__menu__item" @activeClass="tabbed-layout__menu__item_selected" @current-when={{concat this.parentName ".properties"}} data-test-tab="properties">
88-
<span>Properties</span>
89-
</LinkTo>
90-
{{/if}}
91-
{{#if @model.events}}
92-
<LinkTo @route={{concat this.parentName ".events" }} @models={{array @model.project.id @model.projectVersion.compactVersion @model.name}} @query={{hash anchor=undefined}} class="tabbed-layout__menu__item" @activeClass="tabbed-layout__menu__item_selected" @current-when={{concat this.parentName ".events"}} data-test-tab="events">
93-
<span>Events</span>
94-
</LinkTo>
95-
{{/if}}
96-
</nav>
97-
<section>
98-
Show:
93+
<section class="access-checkbox-list">
9994
<label class="access-checkbox">
10095
<input id="inherited-toggle"
10196
data-test-checkbox="inherited"
@@ -130,8 +125,7 @@
130125
</label>
131126
</section>
132127
<hr>
133-
{{outlet}}
134128
</div>
129+
{{outlet}}
135130
{{/if}}
136-
137-
</article>
131+
</div>

app/utils/get-offset.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)