|
|
|
@ -17,6 +17,15 @@ export class EditorPage implements OnInit {
|
|
|
|
|
// @ViewChildren('editorHosts') editorHosts;
|
|
|
|
|
// @ViewChild('titleBar') titleBar;
|
|
|
|
|
|
|
|
|
|
public typeIcons = {
|
|
|
|
|
branch: 'fa fa-folder',
|
|
|
|
|
node: 'fa fa-quote-left',
|
|
|
|
|
norm: 'fa fa-quote-left',
|
|
|
|
|
page: 'fa fa-sticky-note',
|
|
|
|
|
db: 'fa fa-database',
|
|
|
|
|
code: 'fa fa-code',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@Input() pageId: string;
|
|
|
|
|
public pageName = '';
|
|
|
|
|
|
|
|
|
@ -24,6 +33,7 @@ export class EditorPage implements OnInit {
|
|
|
|
|
protected route: ActivatedRoute,
|
|
|
|
|
protected router: Router,
|
|
|
|
|
protected loader: LoadingController,
|
|
|
|
|
protected popover: PopoverController,
|
|
|
|
|
public readonly editorService: EditorService,
|
|
|
|
|
) {
|
|
|
|
|
this.route.params.subscribe(params => {
|
|
|
|
@ -47,6 +57,31 @@ export class EditorPage implements OnInit {
|
|
|
|
|
this.editorService.save();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async onOptionsClick(event: MouseEvent, node: HostRecord) {
|
|
|
|
|
if ( !this.editorService.canEdit() ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const popover = await this.popover.create({
|
|
|
|
|
component: HostOptionsComponent,
|
|
|
|
|
event,
|
|
|
|
|
componentProps: {
|
|
|
|
|
editor: this,
|
|
|
|
|
index: this.editorService.immutableNodes.indexOf(node),
|
|
|
|
|
event,
|
|
|
|
|
hostRecord: node,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
popover.onDidDismiss().then(result => {
|
|
|
|
|
if ( result.data === 'delete_node' ) {
|
|
|
|
|
this.editorService.deleteNode(node.UUID);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await popover.present();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// buttonIsVisible(index) {
|
|
|
|
|
// return this.visibleButtons.includes(index);
|
|
|
|
|
// }
|
|
|
|
|