Update angular to 4.0.0

This commit is contained in:
J??zsef Farkas
2017-02-25 15:11:11 +01:00
committed by József Farkas
parent d45551c4fd
commit f6744b737a
11 changed files with 41 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
<template [ngIf]="keymap$ | async">
<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>
</template>
</ng-template>
<div *ngIf="!(keymap$ | async)" class="not-found">
Sorry, there is no keymap with this abbreviation.

View File

@@ -1,4 +1,4 @@
<template [ngIf]="macro">
<ng-template [ngIf]="macro">
<macro-header
[macro]="macro"
[isNew]="isNew"
@@ -10,7 +10,7 @@
(delete)="deleteAction($event.macroId, $event.index, $event.action)"
(reorder)="reorderAction($event.macroId, $event.oldIndex, $event.newIndex)"
></macro-list>
</template>
</ng-template>
<div *ngIf="!macro" class="not-found">
There is no macro with id {{ route.params.select('id') | async }}.

View File

@@ -1,7 +1,7 @@
<template [ngIf]="keymapOptions.length === 0">
<ng-template [ngIf]="keymapOptions.length === 0">
<span> No keymaps are available to choose from. Create a keymap first! </span>
</template>
<template [ngIf]="keymapOptions.length > 0">
</ng-template>
<ng-template [ngIf]="keymapOptions.length > 0">
<div>
<b>Switch to keymap:</b>
<select2
@@ -19,4 +19,4 @@
[moduleConfig]="selectedKeymap.layers[0].modules">
</svg-keyboard>
</div>
</template>
</ng-template>

View File

@@ -1,4 +1,4 @@
<template [ngIf]="!isNotBase">
<ng-template [ngIf]="!isNotBase">
<select (change)="toggleChanged($event.target.value)">
<option *ngFor="let item of toggleData" [value]="item.id" [selected]="toggle === item.id">
{{ item.text }}
@@ -11,10 +11,10 @@
</option>
</select>
<span [ngSwitch]="toggle">
<template [ngSwitchCase]="true">layer by pressing this key.</template>
<template ngSwitchDefault>layer by holding this key.</template>
<ng-template [ngSwitchCase]="true">layer by pressing this key.</ng-template>
<ng-template ngSwitchDefault>layer by holding this key.</ng-template>
</span>
</template>
<template [ngIf]="isNotBase">
</ng-template>
<ng-template [ngIf]="isNotBase">
<span> Layer switching is only possible from the base layer. </span>
</template>
</ng-template>

View File

@@ -1,7 +1,7 @@
<template [ngIf]="macroOptions.length === 0">
<ng-template [ngIf]="macroOptions.length === 0">
<span> No macros are available to choose from. Create a macro first! </span>
</template>
<template [ngIf]="macroOptions.length > 0">
</ng-template>
<ng-template [ngIf]="macroOptions.length > 0">
<div class="macro-selector">
<b> Play macro: </b>
<select2 [data]="macroOptions" [value]="macroOptions[selectedMacroIndex].id" (valueChanged)="onChange($event)" [width]="'100%'"></select2>
@@ -13,4 +13,4 @@
</macro-item>
</div>
</div>
</template>
</ng-template>

View File

@@ -3,10 +3,10 @@
(click)="start()"
>
<i class="fa fa-circle"></i>
<template [ngIf]="!record">
<ng-template [ngIf]="!record">
Capture keystroke
</template>
<template [ngIf]="record">
</ng-template>
<ng-template [ngIf]="record">
Capturing ...
</template>
</ng-template>
</button>

View File

@@ -4,7 +4,7 @@
[attr.height]="height" [attr.width]="width"
[attr.fill]="fill"
/>
<template [ngIf]="recording">
<ng-template [ngIf]="recording">
<svg:circle
[@recording]="recordAnimation"
(@recording.done)="onRecordingAnimationDone()"
@@ -13,8 +13,8 @@
[attr.r]="10"
[attr.fill]="'#c00'"
></svg:circle>
</template>
<template [ngIf]="!recording">
</ng-template>
<ng-template [ngIf]="!recording">
<svg:g [ngSwitch]="labelType"
[attr.font-size]="19"
[attr.font-family]="'Helvetica'"
@@ -62,4 +62,4 @@
<svg:g svg-mouse-key [mouseAction]="labelSource"></svg:g>
</svg>
</svg:g>
</template>
</ng-template>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -1,4 +1,4 @@
<template ngIf="layers">
<ng-template [ngIf]="layers">
<layers [class.disabled]="popoverShown" (select)="selectLayer($event.index)" [current]="currentLayer"></layers>
<keyboard-slider [layers]="layers"
[currentLayer]="currentLayer"
@@ -22,4 +22,4 @@
</p>
</div>
</div>
</template>
</ng-template>

View File

@@ -119,7 +119,8 @@ export class SvgKeyboardWrapComponent implements OnInit, OnChanges {
if (keymapChanges) {
this.popoverShown = false;
this.layers = this.keymap.layers;
if (keymapChanges.previousValue.abbreviation !== keymapChanges.currentValue.abbreviation) {
if (keymapChanges.isFirstChange() ||
keymapChanges.previousValue.abbreviation !== keymapChanges.currentValue.abbreviation) {
this.currentLayer = 0;
this.keybindAnimationEnabled = keymapChanges.isFirstChange();
} else {