Project

General

Profile

1
import {AfterViewChecked, Component, ElementRef, OnInit, ViewChild} from '@angular/core';
2
import {faqs} from './faqs';
3
import {ActivatedRoute} from '@angular/router';
4
import {Title} from '@angular/platform-browser';
5
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
6

    
7
declare var UIkit: any;
8

    
9
@Component({
10
  selector: 'about',
11
  templateUrl: 'about.component.html',
12
  styleUrls: ['about.component.css'],
13
})
14
export class AboutComponent implements OnInit {
15
  @ViewChild('tabs') tabs: ElementRef;
16
  public architectureImage: string = "gray.png";
17
  public aggregationReadMore: boolean = false;
18
  public dedupClusteringReadMore: boolean = false;
19
  public dedupMatchingAndElectionReadMore: boolean = false;
20
  public enrichmentPropagationReadMore: boolean = false;
21
  public enrichmentMiningReadMore: boolean = false;
22

    
23
  public breadcrumbs: Breadcrumb[] = [
24
    {
25
      name: 'home',
26
      route: '/'
27
    },
28
    {
29
      name: 'about'
30
    }
31
  ];
32

    
33
  constructor(private title: Title,
34
              private route: ActivatedRoute) {
35
  }
36
  
37
  ngOnInit() {
38
    this.title.setTitle('OpenAIRE - Research Graph | About');
39
    this.route.fragment.subscribe(fragment => {
40
      setTimeout(() => {
41
        this.goTo(fragment);
42
      }, 100);
43
    });
44
  }
45
  
46
  goTo(id: string) {
47
    const yOffset = -100;
48
    const element = document.getElementById(id);
49
    if(element) {
50
      const y = element.getBoundingClientRect().top + window.pageYOffset + yOffset;
51
      window.scrollTo({top: y, behavior: 'smooth'});
52
    }
53
  }
54

    
55
  changeTab(index: number) {
56
    UIkit.switcher(this.tabs.nativeElement).show(index);
57
  }
58
}
(3-3/5)