-
-
-
-
Description
-
- {{dataProviderInfo.description.substring(0, showNumDescription)}}
-
+
+
+
+
+
+ 0"
+ [tabTitle]="'Projects'" [tabNumber]="fetchProjects.searchUtils.totalResults"
+ [tabId]="'projects'" >
+
+ 0"
+ [tabTitle]="'Content Providers'" [tabNumber]="fetchDataproviders.searchUtils.totalResults"
+ [tabId]="'datasources'" >
+
+ 0 || fetchDatasets.searchUtils.totalResults > 0
+ || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
+ [tabTitle]="'Related Content Providers'" [tabId]="'relatedDatasources'"
+ >
+
+ 0"
+ [tabTitle]="'Publications'" [tabNumber]="fetchPublications.searchUtils.totalResults"
+ [tabId]="'publications'" >
+
+
+ 0"
+ [tabTitle]="'Research Data'" [tabNumber]="fetchDatasets.searchUtils.totalResults"
+ [tabId]="'datasets'" >
+
+ 0"
+ [tabTitle]="'Software'" [tabNumber]="fetchSoftware.searchUtils.totalResults"
+ [tabId]="'software'">
+
+
+
+
+ 0 || fetchDatasets.searchUtils.totalResults > 0
+ || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
+ [tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'" [active]="false"
+ >
+
+
+
+
+
+
+
+
+
+
+
-
+
+ Description
+
+ {{dataProviderInfo.description.substring(0, showNumDescription)}}
+ thresholdDescription">...
-
- thresholdDescription" class="uk-text-right">
-
- Read more
-
-
- thresholdDescription"
- class="uk-text-right">
-
- Read less
-
-
thresholdDescription" class="uk-text-right">
+
+ Read more
+
+
+ thresholdDescription"
+ class="uk-text-right">
+
+ Read less
+
+
+ -
-
-
+
+
+
Collected full-texts:
{{dataProviderInfo.aggregationStatus.fulltexts | number}}
- 0"
- class="uk-display-inline-block">
+ 0"
+ class="uk-display-inline-block">
Results with funding information:
- {{dataProviderInfo.fundedContent | number}}
+ {{dataProviderInfo.fundedContent | number}}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- 0"
- class="uk-margin-medium-bottom">
- Countries:
- {{dataProviderInfo.countries.join(", ")}}
-
+ 0"
+ class="uk-margin-medium-bottom">
+ Countries:
+ {{dataProviderInfo.countries.join(", ")}}
+
-
- 0"
- class="uk-margin-medium-bottom uk-margin-bottom">
-
-
-
+ Subjects
-
+
+ 0"
+ class="uk-margin-medium-bottom uk-margin-bottom">
+
+
+
- Subjects
+
{{subject}}
,
- thresholdSubjects"> ...
- thresholdSubjects"
- class="uk-width-1-1 uk-text-right">
-
- View all {{dataProviderInfo.subjects.length | number}} subjects
-
-
- thresholdSubjects" class="uk-width-1-1 uk-text-right">
- View less subjects
-
+ thresholdSubjects"> ...
+ thresholdSubjects"
+ class="uk-width-1-1 uk-text-right">
+
+ View all {{dataProviderInfo.subjects.length | number}} subjects
+
+
+ thresholdSubjects" class="uk-width-1-1 uk-text-right">
+ View less subjects
-
-
- OAI-PMH:
-
- {{dataProviderInfo.oaiPmhURL}}
-
-
-
-
- Detailed information @
-
- OpenDOAR
-
-
-
-
+
+
-
-
-
-
-
+
-
-
-
-
+ OAI-PMH:
+
+ {{dataProviderInfo.oaiPmhURL}}
+
+
+
+
+ Detailed information @
+
+ OpenDOAR
+
+
+
+
Detailed information @
re3data.org
- 0"
- class="uk-margin-medium-bottom">
-
-
- Organizations:
-
+
+
+
+
+ 0"
+ class="uk-margin-medium-bottom">
+
-
- thresholdOrganizations"
- class="uk-width-1-1 uk-text-right">
-
- View all {{dataProviderInfo.organizations.length | number}} organizations
-
-
- thresholdOrganizations" class="uk-width-1-1 uk-text-right">
- View less organizations
-
+ thresholdOrganizations"> ...
-
-
-
- No summary information available
+
thresholdOrganizations"
+ class="uk-width-1-1 uk-text-right">
+
+ View all {{dataProviderInfo.organizations.length | number}} organizations
+
+
+ thresholdOrganizations" class="uk-width-1-1 uk-text-right">
+ View less organizations
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0">
+
-
-
+
-
+
+
+
-
-
+ No summary information available
-
+
-
-
-
-
+
+
- 0">
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
- 0 || fetchDatasets.searchUtils.totalResults > 0
+ || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)">
+
diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts
index 4a7c9112..0c24acf1 100644
--- a/landingPages/dataProvider/dataProvider.component.ts
+++ b/landingPages/dataProvider/dataProvider.component.ts
@@ -26,6 +26,7 @@ import {ResultPreview} from "../../utils/result-preview/result-preview";
import {IndexInfoService} from "../../utils/indexInfo.service";
import {properties} from "../../../../environments/environment";
import {Subscriber} from "rxjs";
+import {TabComponent} from "../../utils/tabs/tab.component";
@Component({
@@ -596,7 +597,7 @@ export class DataProviderComponent {
}
public onSelectActiveTab(activeTabId) {
- if (this.activeTab != "activaTabId") { // tab really changed
+ if (this.activeTab != activeTabId) { // tab really changed
if (activeTabId == 'summary') {
this.activeTab = 'summary';
} else if (activeTabId == 'publications') {
diff --git a/utils/tabs/tab.component.ts b/utils/tabs/tab.component.ts
index 36920025..aa2f6981 100644
--- a/utils/tabs/tab.component.ts
+++ b/utils/tabs/tab.component.ts
@@ -27,4 +27,6 @@ export class TabComponent {
@Input('customClass') customClass:string = "";
@Input('tabId') tabId: string;
@Input('tabIcon') tabIcon: TabIcon;
+ @Input ('active') active: boolean = false;
+ // @Input ('loaded') loaded: boolean = false;
}
diff --git a/utils/tabs/tabs.component.ts b/utils/tabs/tabs.component.ts
index e0512329..9e735926 100644
--- a/utils/tabs/tabs.component.ts
+++ b/utils/tabs/tabs.component.ts
@@ -2,43 +2,146 @@
* The main component that renders single TabComponent
* instances.
*/
-import {AfterContentInit, Component, ContentChildren, EventEmitter, Input, Output, QueryList,} from '@angular/core';
+import {
+ AfterContentInit,
+ Component,
+ ContentChildren,
+ EventEmitter,
+ HostListener,
+ Output,
+ QueryList,
+} from '@angular/core';
import {TabComponent} from './tab.component';
@Component({
selector: 'my-tabs',
- template: `
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
- 0">
+
-
-
-
-
-
-
-
-
-
- 0"
- [tabTitle]="'Projects'" [tabNumber]="fetchProjects.searchUtils.totalResults"
- [tabId]="'projects'" >
-
-
-
- 0"
- [tabTitle]="'Content Providers'" [tabNumber]="fetchDataproviders.searchUtils.totalResults"
- [tabId]="'datasources'" >
-
-
-
- 0 || fetchDatasets.searchUtils.totalResults > 0
- || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
- [tabTitle]="'Related Content Providers'" [tabId]="'relatedDatasources'"
- >
-
-
-
- 0"
- [tabTitle]="'Publications'" [tabNumber]="fetchPublications.searchUtils.totalResults"
- [tabId]="'publications'" >
-
-
-
- 0"
- [tabTitle]="'Research Data'" [tabNumber]="fetchDatasets.searchUtils.totalResults"
- [tabId]="'datasets'" >
-
-
-
- 0"
- [tabTitle]="'Software'" [tabNumber]="fetchSoftware.searchUtils.totalResults"
- [tabId]="'software'">
-
-
-
- 0"
- [tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults"
- [tabId]="'other'">
-
-
-
- 0 || fetchDatasets.searchUtils.totalResults > 0
- || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
- [tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0"
- [tabTitle]="'Projects'" [tabNumber]="fetchProjects.searchUtils.totalResults"
- [tabId]="'projects'" >
-
-
-
- 0"
- [tabTitle]="'Content Providers'" [tabNumber]="fetchDataproviders.searchUtils.totalResults"
- [tabId]="'datasources'" >
-
-
-
- 0 || fetchDatasets.searchUtils.totalResults > 0
- || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
- [tabTitle]="'Related Content Providers'" [tabId]="'relatedDatasources'"
- >
-
-
-
- 0"
- [tabTitle]="'Publications'" [tabNumber]="fetchPublications.searchUtils.totalResults"
- [tabId]="'publications'" >
-
-
-
- 0"
- [tabTitle]="'Research Data'" [tabNumber]="fetchDatasets.searchUtils.totalResults"
- [tabId]="'datasets'" >
-
-
-
- 0"
- [tabTitle]="'Software'" [tabNumber]="fetchSoftware.searchUtils.totalResults"
- [tabId]="'software'">
-
-
-
- 0"
- [tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults"
- [tabId]="'other'">
-
-
-
- 0 || fetchDatasets.searchUtils.totalResults > 0
- || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
- [tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
- >
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
- 0">
+
+
+ 0">
+
+
+ 0">
+
+
+ 0 || fetchDatasets.searchUtils.totalResults > 0
+ || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)">
+
+
-
+
+
-
-
-
+
+
+
-
-->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [type]="'statistics'" tab_error_class=true>
-
+
-
-
-
+
-
+ template: `
+ ;
@Output() public selectedActiveTab: EventEmitter = new EventEmitter();
public selected: string;
-
+ disableScroll = false;
+ @HostListener("window:scroll", [])
+ onWindowScroll() {
+ this.scroll();
+ }
ngAfterContentInit() {
if(this.tabs.length > 0) {
this.selected = this.tabs.get(0).tabId;
}
}
- selectTab(tab: TabComponent){
+ selectTab(tab: TabComponent, scroll=true){
+ console.log("Select tab ",tab.tabId);
+ this.unSelectTab(this.selected, tab.tabId);
+ tab.active = true;
this.selected = tab.tabId;
this.selectedActiveTab.emit(tab.tabId);
+ if(scroll) {
+ this.disableScroll = true;
+ setTimeout(() => {
+ window.scrollTo({
+ top: document.getElementById(tab.tabId) ? document.getElementById(tab.tabId).offsetTop - 180 : 250,
+ behavior: 'smooth'
+ });
+ setTimeout(() => {
+ this.disableScroll = false;
+ }, 600);
+ console.log(window.scrollY, tab.tabId, document.getElementById(tab.tabId))
+ }, 200);
+ }
+ }
+ scroll(){
+ if(this.disableScroll){
+ return;
+ }
+ // console.log(window.scrollY)
+ let currentTabView = null;
+ let windowInnerHeight = window && window.innerHeight ? window.innerHeight : 300;
+ // console.log("find CT", windowInnerHeight)
+ for (let tab of this.tabs) {
+
+ let distanceFromCurrentViewTop = document.getElementById(tab.tabId) ? document.getElementById(tab.tabId).getBoundingClientRect().top : null;
+ // console.log(pos, distanceFromCurrentViewTop, windowInnerHeight/2);
+ if (distanceFromCurrentViewTop != null && distanceFromCurrentViewTop <= windowInnerHeight / 2) {
+ currentTabView = tab;
+
+ } else if (distanceFromCurrentViewTop != null && distanceFromCurrentViewTop > windowInnerHeight) {
+ break;
+ }
+ }
+ // console.log("current currentTabView", currentTabView.tabId)
+ if (currentTabView && this.selected != currentTabView.tabId) {
+ this.selectTab(currentTabView, false);
+ this.disableScroll =true;
+ setTimeout(() => {
+ this.disableScroll = false;
+ }, 600);
+ }
+ }
+ unSelectTab(oldTabId, newTabId){
+ for (let tab of this.tabs) {
+ if(tab.tabId == oldTabId){
+ tab.active = false;
+ break;
+ }
+ }
+ this.selected = newTabId;
}
}
+
+
+
`
})
export class TabsComponent implements AfterContentInit {
- @Input()
+
public customClass: string;
@ContentChildren(TabComponent) tabs: QueryList
+
+
+
+
+
+
+
+
+
+ -
+
- + + + +
+
-
+
-
+
+
+ {{tab.title}} {{tab.active}}+{{tab.num | number}}+ +
+