Skip to content

Commit 7a8817d

Browse files
committed
Update keyboard shortcuts
1 parent ebf597f commit 7a8817d

File tree

2 files changed

+4
-90
lines changed

2 files changed

+4
-90
lines changed

addon/components/docs-keyboard-shortcuts/template.hbs

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
</tr>
102102
<tr>
103103
<td>
104-
<code class='docs__keyboard-key'>l</code>
104+
<code class='docs__keyboard-key'>j</code>
105105
or
106106
<code class='docs__keyboard-key'>→</code>
107107
</td>
@@ -111,48 +111,14 @@
111111
</tr>
112112
<tr>
113113
<td>
114-
<code class='docs__keyboard-key'>h</code>
114+
<code class='docs__keyboard-key'>k</code>
115115
or
116116
<code class='docs__keyboard-key'>←</code>
117117
</td>
118118
<td>
119119
Navigate to previous page
120120
</td>
121121
</tr>
122-
<tr>
123-
<td>
124-
<code class='docs__keyboard-key'>j</code>
125-
</td>
126-
<td>
127-
Scroll current page down
128-
</td>
129-
</tr>
130-
<tr>
131-
<td>
132-
<code class='docs__keyboard-key'>ctrl</code>
133-
<code class='docs__keyboard-key'>j</code>
134-
</td>
135-
<td>
136-
Scroll current page halfway down
137-
</td>
138-
</tr>
139-
<tr>
140-
<td>
141-
<code class='docs__keyboard-key'>k</code>
142-
</td>
143-
<td>
144-
Scroll current page up
145-
</td>
146-
</tr>
147-
<tr>
148-
<td>
149-
<code class='docs__keyboard-key'>ctrl</code>
150-
<code class='docs__keyboard-key'>k</code>
151-
</td>
152-
<td>
153-
Scroll current page halfway up
154-
</td>
155-
</tr>
156122
</tbody>
157123
</table>
158124
</div>

addon/components/docs-viewer/component.js

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -27,70 +27,18 @@ export default Component.extend(EKMixin, {
2727
this.get('docsRoutes').resetState();
2828
},
2929

30-
nextPage: on(keyDown('KeyL'), keyDown('ArrowRight'), function() {
30+
nextPage: on(keyDown('KeyJ'), keyDown('ArrowRight'), function() {
3131
if (this.searchIsNotFocused() && this.get('docsRoutes.nextRoute')) {
3232
this.get('router').transitionTo(...this.get('docsRoutes.nextRoute'));
3333
}
3434
}),
3535

36-
previousPage: on(keyDown('KeyH'), keyDown('ArrowLeft'), function() {
36+
previousPage: on(keyDown('KeyK'), keyDown('ArrowLeft'), function() {
3737
if (this.searchIsNotFocused() && this.get('docsRoutes.previousRoute')) {
3838
this.get('router').transitionTo(...this.get('docsRoutes.previousRoute'));
3939
}
4040
}),
4141

42-
pageDown: on(keyDown('KeyJ'), function() {
43-
if (this.searchIsNotFocused()) {
44-
let $el = $("#docs-viewer__scroll-body");
45-
46-
$el.velocity('stop');
47-
$el.velocity('scroll', {
48-
offset: ($el.height() - 150),
49-
container: $el,
50-
duration: 225
51-
});
52-
}
53-
}),
54-
55-
halfPageDown: on(keyDown('ctrl+KeyJ'), function() {
56-
if (this.searchIsNotFocused()) {
57-
let $el = $("#docs-viewer__scroll-body");
58-
59-
$el.velocity('stop');
60-
$el.velocity('scroll', {
61-
offset: (($el.height() / 2) - 150),
62-
container: $el,
63-
duration: 225
64-
});
65-
}
66-
}),
67-
68-
pageUp: on(keyDown('KeyK'), function() {
69-
if (this.searchIsNotFocused()) {
70-
let $el = $("#docs-viewer__scroll-body");
71-
72-
$el.velocity('stop');
73-
$el.velocity('scroll', {
74-
offset: -($el.height() - 150),
75-
container: $el,
76-
duration: 225
77-
});
78-
}
79-
}),
80-
81-
halfPageUp: on(keyDown('ctrl+KeyK'), function() {
82-
if (this.searchIsNotFocused()) {
83-
let $el = $("#docs-viewer__scroll-body");
84-
85-
$el.velocity('stop');
86-
$el.velocity('scroll', {
87-
offset: -(($el.height() / 2) - 150),
88-
container: $el,
89-
duration: 225
90-
});
91-
}
92-
}),
93-
9442
searchIsNotFocused() {
9543
return !this.$('.docs-viewer-search__input').is(':focus');
9644
}

0 commit comments

Comments
 (0)