|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import {Component, HostListener, Input, OnInit} from '@angular/core';
|
|
|
|
|
import HostRecord from '../../structures/HostRecord';
|
|
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
|
|
|
import {LoadingController, PopoverController} from '@ionic/angular';
|
|
|
|
|
import {AlertController, LoadingController, PopoverController} from '@ionic/angular';
|
|
|
|
|
import {NodePickerComponent} from '../../components/editor/node-picker/node-picker.component';
|
|
|
|
|
import {HostOptionsComponent} from '../../components/editor/host-options/host-options.component';
|
|
|
|
|
import {EditorService} from '../../service/editor.service';
|
|
|
|
@ -21,6 +21,7 @@ export class EditorPage implements OnInit {
|
|
|
|
|
protected router: Router,
|
|
|
|
|
protected loader: LoadingController,
|
|
|
|
|
protected popover: PopoverController,
|
|
|
|
|
protected alerts: AlertController,
|
|
|
|
|
public readonly editorService: EditorService,
|
|
|
|
|
) {
|
|
|
|
|
this.route.params.subscribe(params => {
|
|
|
|
@ -63,7 +64,23 @@ export class EditorPage implements OnInit {
|
|
|
|
|
popover.onDidDismiss().then(result => {
|
|
|
|
|
const { event: dismissEvent , value } = result.data;
|
|
|
|
|
if ( value === 'delete_node' ) {
|
|
|
|
|
this.editorService.deleteNode(node.UUID);
|
|
|
|
|
this.alerts.create({
|
|
|
|
|
header: 'Delete node?',
|
|
|
|
|
message: 'Are you sure you want to delete this node? Its contents will be unrecoverable.',
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
text: 'Keep It',
|
|
|
|
|
role: 'cancel',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Delete It',
|
|
|
|
|
role: 'ok',
|
|
|
|
|
handler: () => {
|
|
|
|
|
this.editorService.deleteNode(node.UUID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
}).then(alert => alert.present());
|
|
|
|
|
} else if ( value === 'move_up' ) {
|
|
|
|
|
this.editorService.moveNode(node, 'up');
|
|
|
|
|
} else if ( value === 'move_down' ) {
|
|
|
|
|