bugfix (anchor routing)

master
Boris Voropaev 2024-05-27 10:05:54 +03:00
parent a0e1257a40
commit 010e44deb3
6 changed files with 17 additions and 45 deletions

View File

@ -14,10 +14,10 @@
</div> </div>
<div class="row anchor-menu"> <div class="row anchor-menu">
<a (click)="anchorRouting('about')" class="anchor-menu-item">О продукте</a> <a href="automatization#about" (click)="anchorRouting('about')" class="anchor-menu-item">О продукте</a>
<a (click)="anchorRouting('advantage')" class="anchor-menu-item">Преимущества</a> <a href="automatization#advantage" (click)="anchorRouting('advantage')" class="anchor-menu-item">Преимущества</a>
<a (click)="anchorRouting('solutions')" class="anchor-menu-item">Решения</a> <a href="automatization#solutions" (click)="anchorRouting('solutions')" class="anchor-menu-item">Решения</a>
<a (click)="anchorRouting('reply')" class="anchor-menu-item">Обратная связь</a> <a href="automatization#reply"(click)="anchorRouting('reply')" class="anchor-menu-item">Обратная связь</a>
</div> </div>
<span id="about"></span> <span id="about"></span>

View File

@ -16,20 +16,10 @@ import { ImgCaruselComponent } from '../img-carusel/img-carusel.component';
export class AutomatizationComponent { export class AutomatizationComponent {
constructor( constructor(
private router:Router, private seo:SEOService private router:Router, private seo:SEOService
){} ){}
anchor?:string; anchorRouting(anchor:string){
this.router.navigate([`/automatization`],{ fragment: anchor })
anchorRouting(anchor:string){
if(anchor==this.anchor){
this.router.navigate([`/automatization`]).then(
()=>this.router.navigate([`/automatization`], { fragment: anchor })
)
}else{
this.anchor = anchor;
console.log(anchor)
this.router.navigateByUrl(`/automatization#${anchor}`)
}
} }
images = [ images = [

View File

@ -14,9 +14,9 @@
</div> </div>
<div class="row anchor-menu"> <div class="row anchor-menu">
<a (click)="anchorRouting('about')" class="anchor-menu-item">О продукте</a> <a href="development#about" (click)="anchorRouting('about')" class="anchor-menu-item">О продукте</a>
<a (click)="anchorRouting('advantage')" class="anchor-menu-item">Преимущества</a> <a href="development#advantage" (click)="anchorRouting('advantage')" class="anchor-menu-item">Преимущества</a>
<a (click)="anchorRouting('reply')" class="anchor-menu-item">Обратная связь</a> <a href="development#reply" (click)="anchorRouting('reply')" class="anchor-menu-item">Обратная связь</a>
</div> </div>
<a id="about"></a> <a id="about"></a>

View File

@ -23,18 +23,9 @@ export class DevelopmentComponent {
this.seo.updateDescription('Разработка ПО любой сложности под любые задачи. Помогаем автоматизировать бизнес-процессы, избавляем от рутинных задач, находим новые решения.'); this.seo.updateDescription('Разработка ПО любой сложности под любые задачи. Помогаем автоматизировать бизнес-процессы, избавляем от рутинных задач, находим новые решения.');
this.seo.updateImage('assets/img/development.jpg') this.seo.updateImage('assets/img/development.jpg')
} }
anchor?:string;
anchorRouting(anchor:string){ anchorRouting(anchor:string){
if(anchor==this.anchor){ this.router.navigate([`/development`],{ fragment: anchor })
this.router.navigate([`/development`]).then(
()=>this.router.navigate([`/development`], { fragment: anchor })
)
}else{
this.anchor = anchor;
this.router.navigate([`/development`], { fragment: anchor })
}
} }
images = [ images = [

View File

@ -14,10 +14,10 @@
</div> </div>
<div class="row anchor-menu"> <div class="row anchor-menu">
<a (click)="anchorRouting('about')" class="anchor-menu-item">О продукте</a> <a href="sites#about" (click)="anchorRouting('about')" class="anchor-menu-item">О продукте</a>
<a (click)="anchorRouting('advantage')" class="anchor-menu-item">Особенности</a> <a href="sites#advantage" (click)="anchorRouting('advantage')" class="anchor-menu-item">Особенности</a>
<a (click)="anchorRouting('function')" class="anchor-menu-item">Функционал</a> <a href="sites#function" (click)="anchorRouting('function')" class="anchor-menu-item">Функционал</a>
<a (click)="anchorRouting('reply')" class="anchor-menu-item">Обратная связь</a> <a href="sites#reply" (click)="anchorRouting('reply')" class="anchor-menu-item">Обратная связь</a>
</div> </div>
<a id="about"></a> <a id="about"></a>

View File

@ -18,17 +18,8 @@ export class SitesComponent {
private router:Router, private seo:SEOService private router:Router, private seo:SEOService
){}; ){};
anchor?:string;
anchorRouting(anchor:string){ anchorRouting(anchor:string){
if(anchor==this.anchor){ this.router.navigate([`/sites`],{ fragment: anchor })
this.router.navigate([`/sites`]).then(
()=>this.router.navigate([`/sites`], { fragment: anchor })
)
}else{
this.anchor = anchor;
this.router.navigate([`/sites`], { fragment: anchor })
}
} }
images = [ images = [