Fixed lint issues

pull/6354/head
Inga Mai 7 years ago
parent f7804e6bab
commit b584623743
  1. 9
      frontend/app/components/main-menu/main-menu-toggle.component.ts
  2. 11
      frontend/app/components/resizer/main-menu-resizer.component.ts

@ -32,6 +32,7 @@ import {MainMenuToggleService} from './main-menu-toggle.service';
import {distinctUntilChanged, map, take} from 'rxjs/operators';
import {Subscription} from 'rxjs/Subscription';
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
import {untilComponentDestroyed} from 'ng2-rx-componentdestroyed';
import {downgradeComponent} from '@angular/upgrade/static';
import {opUiComponentsModule} from '../../angular-modules';
@ -56,7 +57,7 @@ import {opUiComponentsModule} from '../../angular-modules';
* collapsed boolean setzen, label im resizer und hamburger icon setzen
*
*/
export class MainMenuToggleComponent implements OnInit {
export class MainMenuToggleComponent implements OnInit, OnDestroy {
localStorageKey:string = "openProject-mainMenuWidth";
toggleTitle:string = "";
@ -73,12 +74,16 @@ export class MainMenuToggleComponent implements OnInit {
this.subscription = this.toggleService.all$
.pipe(
distinctUntilChanged()
distinctUntilChanged(),
untilComponentDestroyed(this)
)
.subscribe( setToggleTitle => {
this.toggleTitle = setToggleTitle;
});
}
ngOnDestroy() {
}
}
opUiComponentsModule.directive(

@ -26,11 +26,12 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
import {Component, ElementRef, HostListener, Injector, Input, OnInit} from '@angular/core';
import {Component, ElementRef, HostListener, Injector, Input, OnInit, OnDestroy} from '@angular/core';
import {MainMenuToggleService} from '../main-menu/main-menu-toggle.service';
import {distinctUntilChanged, map, take} from 'rxjs/operators';
import {Subscription} from 'rxjs/Subscription';
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
import {untilComponentDestroyed} from 'ng2-rx-componentdestroyed';
import {downgradeComponent} from '@angular/upgrade/static';
import {opUiComponentsModule} from '../../angular-modules';
@ -49,7 +50,7 @@ import {opUiComponentsModule} from '../../angular-modules';
`
})
export class MainMenuResizerComponent implements OnInit {
export class MainMenuResizerComponent implements OnInit, OnDestroy {
private resizeEvent:string;
private localStorageKey:string;
private toggleTitle:string;
@ -72,7 +73,8 @@ export class MainMenuResizerComponent implements OnInit {
ngOnInit() {
this.subscription = this.toggleService.all$
.pipe(
distinctUntilChanged()
distinctUntilChanged(),
untilComponentDestroyed(this)
)
.subscribe(setToggleTitle => {
this.toggleTitle = setToggleTitle;
@ -82,6 +84,9 @@ export class MainMenuResizerComponent implements OnInit {
this.localStorageKey = "openProject-mainMenuWidth";
}
ngOnDestroy() {
}
@HostListener('mousedown', ['$event'])
private handleMouseDown(e:MouseEvent) {
// ignore event if it is a click on the collapse/expand handle

Loading…
Cancel
Save