fix: uncheck 'Remap on all keyboard' and 'Remap on all layer' checkbox by default (#754)

* fix: uncheck 'Remap on all keyboard' and 'Remap on all layer' checkbox by default

* fix: popover checkbox checked state
This commit is contained in:
Róbert Kiss
2018-08-21 20:41:54 +02:00
committed by László Monda
parent b5cff2fa93
commit 475ec71983
6 changed files with 22 additions and 12 deletions

View File

@@ -81,14 +81,14 @@
<label>
<input type="checkbox"
name="remapOnAllKeymap"
[(ngModel)]="remapOnAllKeymap"> Remap on all keymaps
[(ngModel)]="remapInfo.remapOnAllKeymap"> Remap on all keymaps
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox"
name="remapOnAllLayer"
[(ngModel)]="remapOnAllLayer"> Remap on all layers
[(ngModel)]="remapInfo.remapOnAllLayer"> Remap on all layers
</label>
</div>
<div class="d-inline-block">

View File

@@ -32,6 +32,7 @@ import { Tab } from './tab';
import { AppState } from '../../store';
import { getKeymaps } from '../../store/reducers/user-configuration';
import { KeyActionRemap } from '../../models/key-action-remap';
import { RemapInfo } from '../../models/remap-info';
enum TabName {
Keypress,
@@ -84,8 +85,7 @@ export class PopoverComponent implements OnChanges {
@Input() wrapPosition: any;
@Input() visible: boolean;
@Input() allowLayerDoubleTap: boolean;
@Input() remapOnAllKeymap: boolean;
@Input() remapOnAllLayer: boolean;
@Input() remapInfo: RemapInfo;
@Output() cancel = new EventEmitter<any>();
@Output() remap = new EventEmitter<KeyActionRemap>();
@@ -160,8 +160,8 @@ export class PopoverComponent implements OnChanges {
if (this.keyActionValid) {
try {
this.remap.emit({
remapOnAllKeymap: this.remapOnAllKeymap,
remapOnAllLayer: this.remapOnAllLayer,
remapOnAllKeymap: this.remapInfo.remapOnAllKeymap,
remapOnAllLayer: this.remapInfo.remapOnAllLayer,
action: this.selectedTab.toKeyAction()
});
} catch (e) {