From 0dde43796c9deb986989a66e8950e7bcb8b142eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de> Date: Wed, 15 Jan 2020 21:06:30 +0100 Subject: [PATCH] Hide sort option 'latest' in comment-list for iOS-/Mac-devices --- .../moderator-comment-list.component.html | 2 +- .../moderator-comment-list/moderator-comment-list.component.ts | 3 ++- .../components/shared/comment-list/comment-list.component.html | 2 +- .../components/shared/comment-list/comment-list.component.ts | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.html b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.html index 4ffc43b05..e4996e8de 100644 --- a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.html +++ b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.html @@ -40,7 +40,7 @@ </div> <mat-menu #sortMenu="matMenu" xPosition="before"> - <button mat-icon-button matTooltip="{{ 'comment-list.vote-desc' | translate }}" + <button mat-icon-button *ngIf="isApple === 'false'" matTooltip="{{ 'comment-list.vote-desc' | translate }}" (click)="sortComments(votedesc)"> <mat-icon [ngClass]="{votedesc: 'up'}[currentSort]">keyboard_arrow_up</mat-icon> </button> diff --git a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.ts b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.ts index 021d45f26..5a95e9ce1 100644 --- a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.ts +++ b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.ts @@ -11,7 +11,6 @@ import { Vote } from '../../../models/vote'; import { UserRole } from '../../../models/user-roles.enum'; import { Room } from '../../../models/room'; import { RoomService } from '../../../services/http/room.service'; -import { VoteService } from '../../../services/http/vote.service'; import { CorrectWrong } from '../../../models/correct-wrong.enum'; import { EventService } from '../../../services/util/event.service'; import { Router } from '@angular/router'; @@ -33,6 +32,7 @@ export class ModeratorCommentListComponent implements OnInit { filteredComments: Comment[]; userRole: UserRole; deviceType: string; + isApple: string; isLoading = true; voteasc = 'voteasc'; votedesc = 'votedesc'; @@ -79,6 +79,7 @@ export class ModeratorCommentListComponent implements OnInit { }); this.translateService.use(localStorage.getItem('currentLang')); this.deviceType = localStorage.getItem('deviceType'); + this.isApple = localStorage.getItem('isApple'); this.currentSort = this.votedesc; this.commentService.getRejectedComments(this.roomId) .subscribe(comments => { diff --git a/src/app/components/shared/comment-list/comment-list.component.html b/src/app/components/shared/comment-list/comment-list.component.html index bb79abf39..79b6abad0 100644 --- a/src/app/components/shared/comment-list/comment-list.component.html +++ b/src/app/components/shared/comment-list/comment-list.component.html @@ -69,7 +69,7 @@ <mat-menu #sortMenu="matMenu" xPosition="before"> - <button mat-menu-item matTooltip="{{ 'comment-list.time' | translate }}" + <button mat-menu-item *ngIf="isApple === 'false'" matTooltip="{{ 'comment-list.time' | translate }}" (click)="sortComments(time)" aria-labelledby="access_time"> <mat-icon [ngClass]="{time: 'unread-icon'}[currentSort]">access_time</mat-icon> <span>{{ 'comment-list.sort-list-time' | translate }}</span> diff --git a/src/app/components/shared/comment-list/comment-list.component.ts b/src/app/components/shared/comment-list/comment-list.component.ts index 0f8d3487e..e6e8307cf 100644 --- a/src/app/components/shared/comment-list/comment-list.component.ts +++ b/src/app/components/shared/comment-list/comment-list.component.ts @@ -37,6 +37,7 @@ export class CommentListComponent implements OnInit, OnDestroy { filteredComments: Comment[]; userRole: UserRole; deviceType: string; + isApple: string; isLoading = true; voteasc = 'voteasc'; votedesc = 'votedesc'; @@ -107,6 +108,7 @@ export class CommentListComponent implements OnInit, OnDestroy { this.subscribeCommentStream(); this.translateService.use(localStorage.getItem('currentLang')); this.deviceType = localStorage.getItem('deviceType'); + this.isApple = localStorage.getItem('isApple'); if (this.userRole === 0) { this.voteService.getByRoomIdAndUserID(this.roomId, userId).subscribe(votes => { for (const v of votes) { -- GitLab