Redirect to specific URL of first macro

This commit is contained in:
NejcZdovc
2016-11-17 09:09:35 +01:00
committed by József Farkas
parent 646cb64a8a
commit 02db20e6c3
8 changed files with 15 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
<template [ngIf]="keymap$ | async">
<keymap-header [keymap]="keymap$ | async" (deleted)="onKeymapDelete($event)"></keymap-header>
<svg-keyboard-wrap [keymap]="keymap$ | async" [deleted]="keymapDeleted"></svg-keyboard-wrap>
<keymap-header [keymap]="keymap$ | async"></keymap-header>
<svg-keyboard-wrap [keymap]="keymap$ | async"></svg-keyboard-wrap>
</template>
<div *ngIf="!(keymap$ | async)" class="not-found">

View File

@@ -15,13 +15,12 @@ import { AppState } from '../../../store';
import { getKeymap } from '../../../store/reducers/keymap';
@Component({
selector: 'keymap',
selector: 'keymap-edit',
template: require('./keymap-edit.component.html'),
styles: [require('./keymap-edit.component.scss')]
})
export class KeymapComponent {
export class KeymapEditComponent {
private keymap$: Observable<Keymap>;
private keymapDeleted: boolean = false;
constructor(
private store: Store<AppState>,
@@ -36,8 +35,4 @@ export class KeymapComponent {
this.keymap$ = keymapConnectable;
keymapConnectable.connect();
}
onKeymapDelete() {
this.keymapDeleted = true;
}
}

View File

@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Component, Input } from '@angular/core';
import { Store } from '@ngrx/store';
@@ -14,7 +14,6 @@ import { KeymapActions } from '../../../store/actions';
})
export class KeymapHeaderComponent {
@Input() keymap: Keymap;
@Output() deleted: EventEmitter<boolean> = new EventEmitter();
constructor(private store: Store<AppState>) { }
@@ -25,7 +24,6 @@ export class KeymapHeaderComponent {
}
removeKeymap() {
this.deleted.emit(false);
this.store.dispatch(KeymapActions.removeKeymap(this.keymap.abbreviation));
}

View File

@@ -1,7 +1,7 @@
import { Routes } from '@angular/router';
import { KeymapAddComponent } from './add/keymap-add.component';
import { KeymapComponent } from './edit/keymap-edit.component';
import { KeymapEditComponent } from './edit/keymap-edit.component';
export const keymapRoutes: Routes = [
{
@@ -11,7 +11,7 @@ export const keymapRoutes: Routes = [
},
{
path: 'keymap',
component: KeymapComponent
component: KeymapEditComponent
},
{
path: 'keymap/add',
@@ -19,6 +19,6 @@ export const keymapRoutes: Routes = [
},
{
path: 'keymap/:abbr',
component: KeymapComponent
component: KeymapEditComponent
}
];

View File

@@ -91,7 +91,6 @@ export class SvgKeyboardWrapComponent implements OnChanges {
@Input() keymap: Keymap;
@Input() popoverEnabled: boolean = true;
@Input() tooltipEnabled: boolean = false;
@Input() deleted: boolean = false;
private popoverShown: boolean;
private keyEditConfig: { keyActions: KeyAction[], keyId: number };