Browse Source

UI: Add select content in widget

pull/4732/head
Vladyslav Prykhodko 5 years ago
parent
commit
9bb4ae8a5d
  1. 2
      ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html
  2. 8
      ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts
  3. 8
      ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts
  4. 8
      ui-ngx/src/app/modules/home/components/widget/widget.component.scss
  5. 1
      ui-ngx/src/app/modules/home/components/widget/widget.component.ts

2
ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html

@ -63,7 +63,7 @@
</mat-menu>
<div [ngClass]="dashboardClass" id="gridster-background" style="height: auto; min-height: 100%; display: inline;">
<gridster #gridster id="gridster-child" [options]="gridsterOpts">
<gridster-item [item]="widget" class="tb-noselect" *ngFor="let widget of dashboardWidgets">
<gridster-item [item]="widget" [ngClass]="{'tb-noselect': isEdit}" *ngFor="let widget of dashboardWidgets">
<tb-widget-container
[widget]="widget"
[dashboardWidgets]="dashboardWidgets"

8
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts

@ -697,12 +697,12 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
}
public onRowClick($event: Event, alarm: AlarmDataInfo) {
if ($event) {
$event.stopPropagation();
}
this.alarmsDatasource.toggleCurrentAlarm(alarm);
const descriptors = this.ctx.actionsApi.getActionDescriptors('rowClick');
if (descriptors.length) {
if ($event) {
$event.stopPropagation();
}
this.alarmsDatasource.toggleCurrentAlarm(alarm);
let entityId;
let entityName;
if (alarm && alarm.originator) {

8
ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts

@ -639,13 +639,13 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
}
public onRowClick($event: Event, entity: EntityData, isDouble?: boolean) {
if ($event) {
$event.stopPropagation();
}
this.entityDatasource.toggleCurrentEntity(entity);
const actionSourceId = isDouble ? 'rowDoubleClick' : 'rowClick';
const descriptors = this.ctx.actionsApi.getActionDescriptors(actionSourceId);
if (descriptors.length) {
if ($event) {
$event.stopPropagation();
}
this.entityDatasource.toggleCurrentEntity(entity);
let entityId;
let entityName;
let entityLabel;

8
ui-ngx/src/app/modules/home/components/widget/widget.component.scss

@ -59,5 +59,13 @@
#widget-container {
min-height: 0;
min-width: 0;
canvas {
user-select: none;
&::selection, &::-moz-selection {
background-color: transparent;
}
}
}
}

1
ui-ngx/src/app/modules/home/components/widget/widget.component.ts

@ -759,7 +759,6 @@ export class WidgetComponent extends PageComponent implements OnInit, AfterViewI
this.dynamicWidgetComponent = this.dynamicWidgetComponentRef.instance;
this.widgetContext.$container = $(this.dynamicWidgetComponentRef.location.nativeElement);
this.widgetContext.$container.css('display', 'block');
this.widgetContext.$container.css('user-select', 'none');
this.widgetContext.$container.attr('id', 'container');
if (this.widgetSizeDetected) {
this.widgetContext.$container.css('height', this.widgetContext.height + 'px');

Loading…
Cancel
Save