Open wp on single click

pull/7882/head
Inga Mai 5 years ago
parent b657689491
commit 791c064957
  1. 15
      frontend/src/app/components/wp-card-view/event-handler/click-handler.ts

@ -3,12 +3,15 @@ import {CardEventHandler} from "core-components/wp-card-view/event-handler/card-
import {WorkPackageCardViewComponent} from "core-components/wp-card-view/wp-card-view.component";
import {WorkPackageViewSelectionService} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-selection.service";
import {WorkPackageViewFocusService} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-focus.service";
import {WorkPackageCardViewService} from "core-components/wp-card-view/services/wp-card-view.service";
import {StateService} from "@uirouter/core";
import {DeviceService} from "core-app/modules/common/browser/device.service";
export class CardClickHandler implements CardEventHandler {
// Injections
public deviceService:DeviceService = this.injector.get(DeviceService);
public $state:StateService = this.injector.get(StateService);
public wpTableSelection:WorkPackageViewSelectionService = this.injector.get(WorkPackageViewSelectionService);
public wpTableFocus:WorkPackageViewFocusService = this.injector.get(WorkPackageViewFocusService);
public wpCardView:WorkPackageCardViewService = this.injector.get(WorkPackageCardViewService);
@ -67,7 +70,15 @@ export class CardClickHandler implements CardEventHandler {
// not matter what other card are (de-)selected below.
// Thus save that card for the details view button.
this.wpTableFocus.updateFocus(wpId);
// open work package on mobile after first click
if (this.deviceService.isMobile) {
this.$state.go(
'work-packages.show',
{workPackageId: wpId}
);
}
return false;
}
}

Loading…
Cancel
Save