Merge pull request #4434 from MaximilianKrambach/stopProopagation

fix click events in user + mediafile views
This commit is contained in:
Emanuel Schütze 2019-02-28 16:18:10 +01:00 committed by GitHub
commit 8c68e93596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -107,6 +107,7 @@
<div
*ngIf="getFileSettings(file).length > 0"
[matMenuTriggerFor]="singleFileMenu"
(click)="$event.stopPropagation()"
[matMenuTriggerData]="{ file: file }"
[matTooltip]="formatIndicatorTooltip(file)"
>
@ -123,6 +124,7 @@
<button
mat-icon-button
[matMenuTriggerFor]="singleFileMenu"
(click)="$event.stopPropagation()"
[matMenuTriggerData]="{ file: file }"
[disabled]="isMultiSelect"
>

View File

@ -81,7 +81,7 @@
<div *ngIf="user.is_active">
<mat-checkbox
class="checkboxPresent"
(click)="setPresent(user)"
(click)="setPresent(user, $event)"
[checked]="user.is_present"
[disabled]="isMultiSelect"
>

View File

@ -394,8 +394,10 @@ export class UserListComponent extends ListViewBaseComponent<ViewUser, User> imp
* Sets the user present
*
* @param viewUser the viewUser Object
* @param event the mouse event (to prevent propagaton to row triggers)
*/
public async setPresent(viewUser: ViewUser): Promise<void> {
public async setPresent(viewUser: ViewUser, event: MouseEvent): Promise<void> {
event.stopPropagation();
viewUser.user.is_present = !viewUser.user.is_present;
await this.repo.update(viewUser.user, viewUser);
}