Add ability to reposition nodes and insert before/after
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
<ion-list>
|
||||
<ion-item *ngFor="let menuItem of menuItems; let i = index" button (click)="onSelect(menuItems[i].value)">
|
||||
<ion-icon slot="start" [name]="menuItems[i].icon"></ion-icon>
|
||||
<ion-item *ngFor="let menuItem of menuItems; let i = index" button (click)="onSelect($event, menuItems[i].value)">
|
||||
<i *ngIf="menuItems[i].icon" class="fa" slot="start" [ngClass]="menuItems[i].icon"></i>
|
||||
<div *ngIf="menuItems[i].icons" slot="start">
|
||||
<i *ngFor="let icon of menuItems[i].icons" class="fa" slot="start" [ngClass]="icon" style="margin-right: 5px;"></i>
|
||||
</div>
|
||||
<ion-label>{{ menuItems[i].name }}</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
@@ -14,13 +14,33 @@ export class HostOptionsComponent implements OnInit {
|
||||
@Input() event: Event;
|
||||
@Input() hostRecord: HostRecord;
|
||||
|
||||
public menuItems: Array<{name: string, icon: string, value: string, type?: string}> = [];
|
||||
protected possibleMenuItems: Array<{name: string, icon: string, value: string, type?: string}> = [
|
||||
public menuItems: Array<{name: string, icon?: string, icons?: string[], value: string, type?: string}> = [];
|
||||
protected possibleMenuItems: Array<{name: string, icon?: string, icons?: string[], value: string, type?: string}> = [
|
||||
{
|
||||
name: 'Move Up',
|
||||
icons: ['fa-chevron-up'],
|
||||
value: 'move_up',
|
||||
},
|
||||
{
|
||||
name: 'Add Node Before',
|
||||
icons: ['fa-plus'],
|
||||
value: 'add_before',
|
||||
},
|
||||
{
|
||||
name: 'Delete Node',
|
||||
icon: 'trash',
|
||||
icon: 'fa-trash',
|
||||
value: 'delete_node',
|
||||
},
|
||||
{
|
||||
name: 'Add Node After',
|
||||
icons: ['fa-plus'],
|
||||
value: 'add_after',
|
||||
},
|
||||
{
|
||||
name: 'Move Down',
|
||||
icons: ['fa-chevron-down'],
|
||||
value: 'move_down',
|
||||
},
|
||||
];
|
||||
|
||||
constructor(
|
||||
@@ -37,7 +57,7 @@ export class HostOptionsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async onSelect(value) {
|
||||
await this.popover.dismiss(value);
|
||||
async onSelect(event: MouseEvent, value) {
|
||||
await this.popover.dismiss({event, value});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user