context menu is modified

This commit is contained in:
병준 박 2019-10-15 16:39:58 +09:00
parent 48088d71d7
commit fc770168c7
5 changed files with 55 additions and 41 deletions

View File

@ -1,11 +1,23 @@
<div>
<div>
<ucap-organization-tenant-search [companyList]="companyList$ | async" [companyCode]="companyCode"
(keyDownEnter)="onKeyDownEnterOrganizationTenantSearch($event)"></ucap-organization-tenant-search>
<button mat-icon-button [matMenuTriggerFor]="groupMenu" aria-label="group menu">
<ucap-organization-tenant-search
[companyList]="companyList$ | async"
[companyCode]="companyCode"
(keyDownEnter)="onKeyDownEnterOrganizationTenantSearch($event)"
></ucap-organization-tenant-search>
<button
mat-icon-button
[matMenuTriggerFor]="groupMenu"
aria-label="group menu"
>
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #groupMenu="matMenu" xPosition="after" yPosition="below" [overlapTrigger]="false">
<mat-menu
#groupMenu="matMenu"
xPosition="after"
yPosition="below"
[overlapTrigger]="false"
>
<button mat-menu-item (click)="onClickGroupMenu('GROUP_NEW')">
<mat-icon>group_add</mat-icon>
<span>새 그룹 추가</span>
@ -29,18 +41,31 @@
</mat-menu>
</div>
<div>
<ucap-group-expansion-panel #groupExpansionPanel [groupBuddyList]="groupBuddyList$ | async"
[favoritBuddyList]="favoritBuddyList$ | async" (more)="onMoreGroup($event)">
<ucap-profile-user-list-item *ucapGroupExpansionPanelItem="let userInfo" [userInfo]="userInfo"
[presence]="getStatusBulkInfo(userInfo) | async" [sessionVerinfo]="sessionVerinfo"
(click)="onSelectBuddy(userInfo)" (contextMenu)="onContextMenuProfile($event)">
<ucap-group-expansion-panel
#groupExpansionPanel
[groupBuddyList]="groupBuddyList$ | async"
[favoritBuddyList]="favoritBuddyList$ | async"
(more)="onMoreGroup($event)"
>
<ucap-profile-user-list-item
*ucapGroupExpansionPanelItem="let userInfo"
[userInfo]="userInfo"
[presence]="getStatusBulkInfo(userInfo) | async"
[sessionVerinfo]="sessionVerinfo"
(click)="onSelectBuddy(userInfo)"
(contextmenu)="onContextMenuProfile($event, userInfo)"
>
</ucap-profile-user-list-item>
</ucap-group-expansion-panel>
</div>
</div>
<div style="visibility: hidden; position: fixed" [style.left]="profileContextMenuPosition.x"
[style.top]="profileContextMenuPosition.y" [matMenuTriggerFor]="profileContextMenu"></div>
<div
style="visibility: hidden; position: fixed"
[style.left]="profileContextMenuPosition.x"
[style.top]="profileContextMenuPosition.y"
[matMenuTriggerFor]="profileContextMenu"
></div>
<mat-menu #profileContextMenu="matMenu" [overlapTrigger]="false">
<ng-template matMenuContent let-item="userInfo">
<button mat-menu-item>Action 1</button>
@ -48,8 +73,12 @@
</ng-template>
</mat-menu>
<div style="visibility: hidden; position: fixed" [style.left]="groupContextMenuPosition.x"
[style.top]="groupContextMenuPosition.y" [matMenuTriggerFor]="groupContextMenu"></div>
<div
style="visibility: hidden; position: fixed"
[style.left]="groupContextMenuPosition.x"
[style.top]="groupContextMenuPosition.y"
[matMenuTriggerFor]="groupContextMenu"
></div>
<mat-menu #groupContextMenu="matMenu" [overlapTrigger]="false">
<ng-template matMenuContent let-item="group">
<button mat-menu-item>그룹 대화하기</button>

View File

@ -206,14 +206,17 @@ export class GroupComponent implements OnInit {
);
}
onContextMenuProfile(params: {
event: MouseEvent;
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
}) {
this.profileContextMenuPosition.x = params.event.clientX + 'px';
this.profileContextMenuPosition.y = params.event.clientY + 'px';
onContextMenuProfile(
event: MouseEvent,
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN
) {
event.preventDefault();
event.stopPropagation();
this.profileContextMenuPosition.x = event.clientX + 'px';
this.profileContextMenuPosition.y = event.clientY + 'px';
const profileContextMenuTrigger = this.menuTriggerList.toArray()[1];
profileContextMenuTrigger.menuData = { userInfo: params.userInfo };
profileContextMenuTrigger.menuData = { userInfo };
profileContextMenuTrigger.openMenu();
}

View File

@ -44,7 +44,6 @@ export class MessagesComponent implements OnInit {
save = new EventEmitter<{ fileInfo: FileInfo; type: string }>();
@ViewChildren(MatMenuTrigger) menuTriggerList: QueryList<MatMenuTrigger>;
@ViewChild('messageContextMenu', { static: true })
messageContextMenu: MatMenu;
messageContextMenuPosition = { x: '0px', y: '0px' };
@ -157,6 +156,8 @@ export class MessagesComponent implements OnInit {
}
onContextMenuMessage(event: MouseEvent, eventType: EventType, message: Info) {
event.preventDefault();
this.messageContextMenuPosition.x = event.clientX + 'px';
this.messageContextMenuPosition.y = event.clientY + 'px';
const messageContextMenuTrigger = this.menuTriggerList.toArray()[0];

View File

@ -1,9 +1,5 @@
<!--체크박스 보여줄때는 <div class="list-item checkbox" matRipple> 클래스에 checkbox만 추가-->
<div
class="list-item"
matRipple
(contextmenu)="onContextMenu($event, userInfo)"
>
<div class="list-item" matRipple>
<!--pcOn , pcOut pcOff , pcOther-->
<span
class="presence"

View File

@ -46,12 +46,6 @@ export class UserListItemComponent implements OnInit, OnDestroy {
@Input()
sessionVerinfo: VersionInfo2Response;
@Output()
contextMenu = new EventEmitter<{
event: MouseEvent;
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
}>();
userPresence: StatusBulkInfo | StatusInfo;
PresenceType = PresenceType;
@ -112,13 +106,4 @@ export class UserListItemComponent implements OnInit, OnDestroy {
return rtnClass;
}
onContextMenu(
event: MouseEvent,
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN
) {
event.preventDefault();
event.stopPropagation();
this.contextMenu.emit({ event, userInfo });
}
}