This commit is contained in:
Nicolas Constant 2019-07-03 20:08:05 -04:00
parent a2e0789a9c
commit 90157c1ee7
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 7 additions and 8 deletions

View File

@ -27,11 +27,10 @@
<fa-icon [icon]="faWindowCloseRegular"></fa-icon>
</a>
<a href class="action-bar__link action-bar__link--more" (click)="onContextMenu($event, item)" title="More"
[contextMenu]="basicMenu" [contextMenuSubject]="item">
<fa-icon [icon]="faEllipsisH" [contextMenu]="basicMenu" [contextMenuSubject]="item"></fa-icon>
<a href class="action-bar__link action-bar__link--more" (click)="onContextMenu($event)" title="More">
<fa-icon [icon]="faEllipsisH"></fa-icon>
</a>
<context-menu #basicMenu>
<context-menu #contextMenu>
<ng-template contextMenuItem (execute)="expandStatus()">
Expand status
</ng-template>

View File

@ -28,7 +28,7 @@ export class ActionBarComponent implements OnInit, OnDestroy {
faEllipsisH = faEllipsisH;
faLock = faLock;
@ViewChild(ContextMenuComponent) public basicMenu: ContextMenuComponent;
@ViewChild(ContextMenuComponent) public contextMenu: ContextMenuComponent;
public items = [
{ name: 'John', otherProperty: 'Foo' },
{ name: 'Joe', otherProperty: 'Bar' }
@ -241,12 +241,12 @@ export class ActionBarComponent implements OnInit, OnDestroy {
return false;
}
public onContextMenu($event: MouseEvent, item: any): void {
public onContextMenu($event: MouseEvent): void {
this.contextMenuService.show.next({
// Optional - if unspecified, all context menu components will open
contextMenu: this.basicMenu,
contextMenu: this.contextMenu,
event: $event,
item: item,
item: null
});
$event.preventDefault();
$event.stopPropagation();