Skip to content
Snippets Groups Projects
Commit eb7a1321 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

improve context menu actions

parent 78c9844f
No related branches found
No related tags found
No related merge requests found
......@@ -6,11 +6,11 @@
[style.top]="contextMenuPosition.y"></span>
<mat-menu #menu="matMenu">
<div style="text-align: center;font-size: 10px;opacity: 0.5;margin-top:-15px;">
<ng-container *ngIf="!contextMode || (contextMode && this.selectedRes.length > 0)">
<div style="text-align: center;font-size: 10px;opacity: 0.5;margin-top:-15px;padding:5px;">
<ng-container *ngIf="!contextMode || (contextMode && this.selectedRes.length > 1)">
{{selectedRes.length}} {{lang.selectedElements}}
</ng-container>
<ng-container *ngIf="contextMode && this.selectedRes.length == 0">
<ng-container *ngIf="contextMode && this.selectedRes.length == 1">
{{this.contextMenuTitle}}
</ng-container>
</div>
......
......@@ -72,11 +72,11 @@
<!-- Primary Info Line -->
<div class="resultRow newRow" [class.resultRow-mobile]="mobileMode">
<div *ngIf="!mobileMode" class="checkThis">
<mat-checkbox color="primary" [checked]="row.checked" (change)="toggleRes($event,row.res_id)"
<mat-checkbox color="primary" [checked]="row.checked" (change)="toggleRes($event,row)"
(click)="$event.stopPropagation();"></mat-checkbox>
</div>
<div class="resultCol" [class]="data.cssClasses.join(' ')" *ngFor="let data of displayedMainData"
(click)="launchEvent();" style="cursor: pointer;">
style="cursor: pointer;">
<span *ngIf="data.value == 'alt_identifier'">
<mat-icon [ngStyle]="{'color': row.priorityColor}" color="primary" class="{{row.statusImage.charAt(0)}}{{row.statusImage.charAt(1)}} {{row.statusImage}} {{row.statusImage.charAt(0)}}{{row.statusImage.charAt(1)}}-2x"
title="{{row.statusLabel}}" style="cursor: crosshair;" (click)="$event.stopPropagation();filterThis(row.statusLabel)"></mat-icon><br />
......
......@@ -327,14 +327,16 @@ export class BasketListComponent implements OnInit {
return data;
}
toggleRes(e: any, resId: any) {
toggleRes(e: any, row: any) {
if (e.checked) {
if (this.selectedRes.indexOf(resId) === -1) {
this.selectedRes.push(resId);
if (this.selectedRes.indexOf(row.res_id) === -1) {
this.selectedRes.push(row.res_id);
row.checked = true;
}
} else {
let index = this.selectedRes.indexOf(resId);
let index = this.selectedRes.indexOf(row.res_id);
this.selectedRes.splice(index, 1);
row.checked = false;
}
}
......@@ -353,7 +355,11 @@ export class BasketListComponent implements OnInit {
}
open({ x, y }: MouseEvent, row: any) {
let thisSelect = { checked : true };
let thisDeselect = { checked : false };
row.checked = true;
this.toggleAllRes(thisDeselect);
this.toggleRes(thisSelect, row);
this.actionsList.open(x, y, row)
// prevents default
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment