MOBILE-4565 a11y: Dynamic context menu
parent
a471bf24cc
commit
b71fb0ae05
|
@ -24,16 +24,26 @@
|
|||
[content]="'addon.messages.info' | translate" (action)="viewInfo()" iconAction="fas-circle-info" />
|
||||
<core-context-menu-item [hidden]="isSelf || !showInfo || !isGroup" [priority]="1000"
|
||||
[content]="'addon.messages.groupinfo' | translate" (action)="viewInfo()" iconAction="fas-circle-info" />
|
||||
<core-context-menu-item [hidden]="!groupMessagingEnabled || !conversation" [priority]="800" (action)="changeFavourite($event)"
|
||||
[closeOnClick]="false" [content]="(conversation && conversation.isfavourite ? 'addon.messages.removefromfavourites' :
|
||||
'addon.messages.addtofavourites') | translate" [iconAction]="favouriteIcon" [iconSlash]="favouriteIconSlash" />
|
||||
|
||||
<core-context-menu-item [hidden]="!groupMessagingEnabled || !conversation || conversation.isfavourite" [priority]="800"
|
||||
(action)="changeFavourite($event)" [closeOnClick]="false" [content]="'addon.messages.addtofavourites' | translate"
|
||||
[iconAction]="favouriteIcon" />
|
||||
<core-context-menu-item [hidden]="!groupMessagingEnabled || !conversation || !conversation.isfavourite" [priority]="800"
|
||||
(action)="changeFavourite($event)" [closeOnClick]="false" [content]="'addon.messages.removefromfavourites' | translate"
|
||||
[iconAction]="favouriteIcon" [iconSlash]="true" />
|
||||
|
||||
<core-context-menu-item [hidden]="isSelf || !otherMember || otherMember.isblocked" [priority]="700"
|
||||
[content]="'addon.messages.blockuser' | translate" (action)="blockUser()" [iconAction]="blockIcon" />
|
||||
<core-context-menu-item [hidden]="isSelf || !otherMember || !otherMember.isblocked" [priority]="700"
|
||||
[content]="'addon.messages.unblockuser' | translate" (action)="unblockUser()" [iconAction]="blockIcon" />
|
||||
<core-context-menu-item [hidden]="isSelf || !muteEnabled || !conversation" [priority]="600" (action)="changeMute($event)"
|
||||
[closeOnClick]="false" [content]="(conversation && conversation.ismuted ? 'addon.messages.unmuteconversation' :
|
||||
'addon.messages.muteconversation') | translate" [iconAction]="muteIcon" />
|
||||
|
||||
<core-context-menu-item [hidden]="isSelf || !muteEnabled || !conversation || conversation.ismuted" [priority]="600"
|
||||
(action)="changeMute($event)" [closeOnClick]="false" [content]="'addon.messages.muteconversation' | translate"
|
||||
[iconAction]="muteIcon" />
|
||||
<core-context-menu-item [hidden]="isSelf || !muteEnabled || !conversation || !conversation.ismuted" [priority]="600"
|
||||
(action)="changeMute($event)" [closeOnClick]="false" [content]="'addon.messages.unmuteconversation' | translate"
|
||||
[iconAction]="muteIcon" />
|
||||
|
||||
<core-context-menu-item [hidden]="!canDelete || !messages || !messages.length" [priority]="400"
|
||||
[content]="'addon.messages.showdeletemessages' | translate" iconAction="toggle" [(toggle)]="showDelete" />
|
||||
<core-context-menu-item [hidden]="!groupMessagingEnabled || !conversationId || isGroup || !messages || !messages.length"
|
||||
|
|
|
@ -97,7 +97,6 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
|||
blockIcon = 'fas-user-lock';
|
||||
addRemoveIcon = 'fas-user-plus';
|
||||
muteIcon = 'fas-bell-slash';
|
||||
favouriteIconSlash = false;
|
||||
muteEnabled = false;
|
||||
otherMember?: AddonMessagesConversationMember; // Other member information (individual conversations only).
|
||||
footerType: 'message' | 'blocked' | 'requiresContact' | 'requestSent' | 'requestReceived' | 'unable' = 'unable';
|
||||
|
@ -594,7 +593,6 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
|||
this.conversationImage = this.conversation.imageurl;
|
||||
this.isGroup = this.conversation.type == AddonMessagesProvider.MESSAGE_CONVERSATION_TYPE_GROUP;
|
||||
this.favouriteIcon = 'fas-star';
|
||||
this.favouriteIconSlash = this.conversation.isfavourite;
|
||||
this.muteIcon = this.conversation.ismuted ? 'fas-bell' : 'fas-bell-slash';
|
||||
if (!this.isGroup) {
|
||||
this.userId = this.conversation.userid;
|
||||
|
@ -1307,7 +1305,6 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
|||
CoreDomUtils.showErrorModalDefault(error, 'Error changing favourite state.');
|
||||
} finally {
|
||||
this.favouriteIcon = 'fas-star';
|
||||
this.favouriteIconSlash = this.conversation.isfavourite;
|
||||
done && done();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue