scrollService fix

master
Boris Voropaev 2023-11-07 10:46:21 +03:00
parent 164200532c
commit 7be11672a5
2 changed files with 8 additions and 4 deletions

View File

@ -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();
}
}

View File

@ -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() {