On window blur, immediately hide keyboard hints (#14529)

* On window blur, immediately hide keyboard hints

* De-param
This commit is contained in:
Phil Renaud 2022-09-12 15:10:43 -04:00 committed by GitHub
parent a381ecaa09
commit add8383c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,4 @@
import { set } from '@ember/object';
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
@ -8,6 +9,13 @@ export default class KeyboardShortcutsModalComponent extends Component {
@service keyboard;
@service config;
constructor() {
super(...arguments);
window.addEventListener('blur', () => {
set(this, 'keyboard.displayHints', false);
});
}
escapeCommand = {
label: 'Hide Keyboard Shortcuts',
pattern: ['Escape'],

View File

@ -94,7 +94,6 @@
// Global keyboard hint style
// .display-hints {
[data-shortcut] {
background: lighten($nomad-green, 25%);
border: 1px solid $nomad-green-dark;
@ -113,7 +112,6 @@
z-index: $z-tooltip;
}
}
// }
@keyframes slideIn {
from {

View File

@ -38,7 +38,7 @@
@source={{p.list}}
@sortProperty={{this.sortProperty}}
@sortDescending={{this.sortDescending}}
@class="with-foot {{if this.keyboard.displayHints "display-hints"}}" as |t|
@class="with-foot" as |t|
>
<t.head>
<t.sort-by @prop="name">