Keyboard split/merge animation (#311)

This commit is contained in:
József Farkas
2017-06-17 21:19:44 +02:00
committed by László Monda
parent ecd495b7c2
commit 609fcb9a4a
8 changed files with 49 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
<ng-template [ngIf]="keymap$ | async">
<keymap-header [keymap]="keymap$ | async" [deletable]="deletable$ | async" (downloadClick)="downloadKeymap()"></keymap-header>
<svg-keyboard-wrap [keymap]="keymap$ | async"></svg-keyboard-wrap>
<svg-keyboard-wrap [keymap]="keymap$ | async" [halvesSplit]="keyboardSplit"></svg-keyboard-wrap>
</ng-template>
<div *ngIf="!(keymap$ | async)" class="not-found">
Sorry, there is no keymap with this abbreviation.
</div>
</div>

View File

@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, HostListener } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import '@ngrx/core/add/operator/select';
@@ -27,6 +27,8 @@ import { getKeymap, getKeymaps, getUserConfiguration } from '../../../store/redu
})
export class KeymapEditComponent {
keyboardSplit: boolean;
protected keymap$: Observable<Keymap>;
private deletable$: Observable<boolean>;
@@ -61,6 +63,11 @@ export class KeymapEditComponent {
});
}
@HostListener('window:keydown.alt.s', ['$event'])
toggleKeyboardSplit() {
this.keyboardSplit = !this.keyboardSplit;
}
private toExportableJSON(keymap: Keymap): Observable<any> {
return this.store
.let(getUserConfiguration())