diff --git a/projects/app/_modules/objects/form/slider/slider-form.component.ts b/projects/app/_modules/objects/form/slider/slider-form.component.ts index e1c12a2..3411ca1 100644 --- a/projects/app/_modules/objects/form/slider/slider-form.component.ts +++ b/projects/app/_modules/objects/form/slider/slider-form.component.ts @@ -2,7 +2,6 @@ import {Component} from '@angular/core'; import {ActivatedRoute, Router} from "@angular/router"; import {FormControl, FormGroup} from "@angular/forms"; import {FormsService, ListsService} from "@app/_services"; -import {WindowScrollingService} from "@app/_services/window-scrolling.service"; import { PagesService } from '@app/_services/pages.service'; @@ -32,7 +31,6 @@ export class SliderFormComponent { private formsService: FormsService, private listsService: ListsService, private pagesService: PagesService, - private windowScrollingService: WindowScrollingService ) { } @@ -57,7 +55,6 @@ export class SliderFormComponent { this.initFormGroup(JSON.parse(this.route.snapshot.queryParamMap.get('extraProps'))); this.formParams = JSON.parse(this.route.snapshot.queryParamMap.get('formParams')) || {}; this.fetch(); - this.windowScrollingService.disable(); } fetch() { @@ -146,7 +143,7 @@ export class SliderFormComponent { } close() { - this.windowScrollingService.enable(); this.router.navigate([{outlets: {slider: null}}]).then(); } + } diff --git a/projects/app/_modules/viget/slider/slider.component.ts b/projects/app/_modules/viget/slider/slider.component.ts index 3990bbf..508b8f5 100644 --- a/projects/app/_modules/viget/slider/slider.component.ts +++ b/projects/app/_modules/viget/slider/slider.component.ts @@ -1,5 +1,6 @@ import { AfterViewInit, Component, Input, OnInit } from '@angular/core'; import { Router } from '@angular/router'; +import { WindowScrollingService } from '@app/_services/window-scrolling.service'; @Component({ selector: 'slider', @@ -9,19 +10,25 @@ import { Router } from '@angular/router'; export class SliderComponent implements OnInit { @Input() width: 'string'; @Input() side: 'left'|'right' ='right'; + css:any; constructor( + private windowScrollingService: WindowScrollingService, private router:Router ){} ngOnInit(){ + this.windowScrollingService.disable(); this.css = { 'left-side': this.side=='left', 'right-side': this.side=='right' } } + ngOnDestroy(){ + this.windowScrollingService.enable(); + } close() {