Disable dragging of overview widgets on mobile devices

pull/7992/head
Inga Mai 5 years ago
parent 8ec67a1b7b
commit b943b19405
  1. 6
      frontend/src/app/modules/grids/grid/grid.component.html
  2. 8
      frontend/src/app/modules/grids/grid/grid.component.ts

@ -19,12 +19,14 @@
<div class="grid--area-content widget-box"
cdkDrag
(cdkDragStarted)="drag.start(area)"
(cdkDragDropped)="drag.drop()">
(cdkDragDropped)="drag.drop()"
[cdkDragDisabled]="isMobileDevice">
<span *ngIf="drag.isDraggable"
class="grid--area-drag-handle
icon
icon-drag-handle hidden-for-mobile"
icon-drag-handle"
[hidden]="isMobileDevice"
cdkDragHandle></span>
<ndc-dynamic [ndcDynamicComponent]="widgetComponent(area)"

@ -18,6 +18,7 @@ import {GridAddWidgetService} from "core-app/modules/grids/grid/add-widget.servi
import {GridRemoveWidgetService} from "core-app/modules/grids/grid/remove-widget.service";
import {WidgetWpGraphComponent} from "core-app/modules/grids/widgets/wp-graph/wp-graph.component";
import {GridWidgetArea} from "core-app/modules/grids/areas/grid-widget-area";
import {BrowserDetector} from "core-app/modules/common/browser/browser-detector.service";
export interface WidgetRegistration {
identifier:string;
@ -54,7 +55,8 @@ export class GridComponent implements OnDestroy, OnInit {
public resize:GridResizeService,
public layout:GridAreaService,
public add:GridAddWidgetService,
public remove:GridRemoveWidgetService) {
public remove:GridRemoveWidgetService,
readonly browserDetector:BrowserDetector) {
}
ngOnInit() {
@ -120,6 +122,10 @@ export class GridComponent implements OnDestroy, OnInit {
return this.layout.isEditable;
}
public get isMobileDevice() {
return this.browserDetector.isMobile;
}
private gridStyle(amount:number, itemStyle:string) {
let style = '';
for (let i = 0; i < amount; i++) {

Loading…
Cancel
Save