diff --git a/frontend/app/angular4-modules.ts b/frontend/app/angular4-modules.ts index f34535821e..2e7d93b195 100644 --- a/frontend/app/angular4-modules.ts +++ b/frontend/app/angular4-modules.ts @@ -50,7 +50,7 @@ import {WorkPackageTableSortByService} from 'core-components/wp-fast-table/state import {WorkPackageTableTimelineService} from 'core-components/wp-fast-table/state/wp-table-timeline.service'; import {WorkPackageInlineCreateComponent,} from 'core-components/wp-inline-create/wp-inline-create.component'; import {KeepTabService} from 'core-components/wp-single-view-tabs/keep-tab/keep-tab.service'; -import {WpResizerDirectiveUpgraded} from 'core-components/wp-resizer/wp-resizer.directive'; +import {WpResizerDirective} from 'core-components/wp-resizer/wp-resizer.component'; import {SortHeaderDirective} from 'core-components/wp-table/sort-header/sort-header.directive'; import {WorkPackageTablePaginationComponent} from 'core-components/wp-table/table-pagination/wp-table-pagination.component'; import {WorkPackageTimelineTableController} from 'core-components/wp-table/timeline/container/wp-timeline-container.directive'; @@ -328,7 +328,7 @@ import {UploadProgressComponent} from 'core-components/common/notifications/uplo WorkPackageDetailsViewButtonComponent, WorkPackageTimelineButtonComponent, WorkPackageZenModeButtonComponent, - WpResizerDirectiveUpgraded, + WpResizerDirective, WpCustomActionComponent, WpCustomActionsComponent, WorkPackageTableSumsRowController, diff --git a/frontend/app/components/wp-resizer/wp-resizer.directive.ts b/frontend/app/components/wp-resizer/wp-resizer.component.ts similarity index 79% rename from frontend/app/components/wp-resizer/wp-resizer.directive.ts rename to frontend/app/components/wp-resizer/wp-resizer.component.ts index f4a8f6793a..30cf7c93e1 100644 --- a/frontend/app/components/wp-resizer/wp-resizer.directive.ts +++ b/frontend/app/components/wp-resizer/wp-resizer.component.ts @@ -1,5 +1,3 @@ -import {Directive, ElementRef, Injector, Input} from '@angular/core'; -import {UpgradeComponent} from '@angular/upgrade/static'; //-- copyright // OpenProject is a project management system. // Copyright (C) 2012-2015 the OpenProject Foundation (OPF) @@ -27,23 +25,31 @@ import {UpgradeComponent} from '@angular/upgrade/static'; // // See doc/COPYRIGHT.rdoc for more details. //++ -import {openprojectModule} from '../../angular-modules'; -export class WorkPackageResizerController { +import {Component, ElementRef, HostListener, Injector, Input, OnDestroy, OnInit} from '@angular/core'; + +@Component({ + selector: 'wp-resizer', + template: `
` +}) + +export class WpResizerDirective implements OnInit, OnDestroy { + @Input() elementClass:string; + @Input() resizeEvent:string; + @Input() localStorageKey:string; + private resizingElement:HTMLElement; private elementFlex:number; private oldPosition:number; private mouseMoveHandler:any; - public resizeEvent:string; - public elementClass:string; - public localStorageKey:string; + private element:HTMLElement; public moving:boolean = false; - constructor(public $element:ng.IAugmentedJQuery) { + constructor(private elementRef:ElementRef) { } - $onInit() { + ngOnInit() { // Get element this.resizingElement =