Allow sorting while editing macro action (#107)

Closes #106
This commit is contained in:
Mikko Lakomaa
2016-09-20 18:54:16 +03:00
committed by József Farkas
parent 3e85cf45a6
commit 85502bccec
2 changed files with 1 additions and 10 deletions

View File

@@ -16,10 +16,9 @@
[macroAction]="macroAction"
[editable]="true"
[deletable]="true"
[moveable]="dragEnabled"
[moveable]="true"
(save)="onSaveAction($event, index)"
(edit)="onEditAction(macroActionIndex)"
(cancel)="onCancelEditAction()"
(delete)="onDeleteAction(macroActionIndex)"></macro-item>
</div>
<div class="list-group add-new__action-container">

View File

@@ -24,7 +24,6 @@ export class MacroComponent implements OnInit, OnDestroy {
private routeSubscription: Subscription;
private hasChanges: boolean = false;
private dragEnabled: boolean;
constructor(
private uhkConfigurationService: UhkConfigurationService,
@@ -44,7 +43,6 @@ export class MacroComponent implements OnInit, OnDestroy {
this.routeSubscription = this.route.params.subscribe((params: { id: string }) => {
const id: number = Number(params.id);
this.macro = this.getMacro(id);
this.dragEnabled = true;
this.hasChanges = false;
});
}
@@ -90,15 +88,9 @@ export class MacroComponent implements OnInit, OnDestroy {
onEditAction(index: number) {
// Hide other editors when clicking edit button of a macro action
this.hideOtherActionEditors(index);
this.dragEnabled = false;
}
onCancelEditAction() {
this.dragEnabled = true;
}
onSaveAction(macroAction: MacroAction, index: number) {
this.dragEnabled = true;
this.hasChanges = true;
this.macro.macroActions.elements[index] = macroAction;
}