Merge branch 'new-theme' of code-repo.d4science.org:MaDgIK/openaire-library into new-theme
This commit is contained in:
commit
8205f303a7
|
@ -89,125 +89,172 @@
|
|||
<div *ngIf="dataProviderInfo != null">
|
||||
|
||||
<!-- *ngIf="numberOfTabs > 0; else loadingBlock"-->
|
||||
<div class="main-tabs-div">
|
||||
<ng-template #summary_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div *ngIf="hasPrimaryInfo || (!aggregationStatusIsInitialized || hasAggregationStatusInfo)"
|
||||
class="uk-width-expand uk-padding uk-inline">
|
||||
<!-- Description -->
|
||||
<div *ngIf="dataProviderInfo.description" class="uk-margin-medium-bottom">
|
||||
<div class="uk-text-muted">Description</div>
|
||||
<div class="uk-text-justify uk-height-max-medium uk-overflow-auto">
|
||||
<span>{{dataProviderInfo.description.substring(0, showNumDescription)}}</span>
|
||||
<span *ngIf="showNumDescription == thresholdDescription &&
|
||||
<div class="main-tabs-div" uk-sticky="offset: 100; ">
|
||||
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" >
|
||||
|
||||
<my-tab
|
||||
[tabTitle]="'Summary'" [tabId]="'summary'" [active]="true">
|
||||
|
||||
</my-tab>
|
||||
<my-tab *ngIf="fetchProjects.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Projects'" [tabNumber]="fetchProjects.searchUtils.totalResults"
|
||||
[tabId]="'projects'" >
|
||||
</my-tab>
|
||||
<my-tab *ngIf="fetchDataproviders.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Content Providers'" [tabNumber]="fetchDataproviders.searchUtils.totalResults"
|
||||
[tabId]="'datasources'" >
|
||||
</my-tab>
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Related Content Providers'" [tabId]="'relatedDatasources'"
|
||||
>
|
||||
</my-tab>
|
||||
<my-tab *ngIf="fetchPublications.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Publications'" [tabNumber]="fetchPublications.searchUtils.totalResults"
|
||||
[tabId]="'publications'" >
|
||||
|
||||
</my-tab>
|
||||
<my-tab *ngIf="fetchDatasets.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Research Data'" [tabNumber]="fetchDatasets.searchUtils.totalResults"
|
||||
[tabId]="'datasets'" >
|
||||
</my-tab>
|
||||
<my-tab *ngIf="fetchSoftware.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Software'" [tabNumber]="fetchSoftware.searchUtils.totalResults"
|
||||
[tabId]="'software'">
|
||||
</my-tab>
|
||||
<my-tab *ngIf="fetchOrps.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults"
|
||||
[tabId]="'other'">
|
||||
|
||||
</my-tab>
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'" [active]="false"
|
||||
>
|
||||
</my-tab>
|
||||
</my-tabs>
|
||||
|
||||
|
||||
</div>
|
||||
<!--Summary-->
|
||||
<div #summary_tab>
|
||||
<div id="summary" class="uk-grid uk-margin-remove landing-section">
|
||||
<div *ngIf="hasPrimaryInfo || (!aggregationStatusIsInitialized || hasAggregationStatusInfo)"
|
||||
class="uk-width-expand uk-padding uk-inline">
|
||||
<!-- Description -->
|
||||
<div *ngIf="dataProviderInfo.description" class="uk-margin-medium-bottom">
|
||||
<div class="uk-text-muted">Description</div>
|
||||
<div class="uk-text-justify uk-height-max-medium uk-overflow-auto">
|
||||
<span>{{dataProviderInfo.description.substring(0, showNumDescription)}}</span>
|
||||
<span *ngIf="showNumDescription == thresholdDescription &&
|
||||
dataProviderInfo.description.length > thresholdDescription">...</span>
|
||||
</div>
|
||||
<div *ngIf="showNumDescription == thresholdDescription &&
|
||||
dataProviderInfo.description.length > thresholdDescription" class="uk-text-right">
|
||||
<a (click)="showNumDescription = dataProviderInfo.description.length;">
|
||||
Read more
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="dataProviderInfo.description && showNumDescription > thresholdDescription"
|
||||
class="uk-text-right">
|
||||
<a (click)="showNumDescription = thresholdDescription;">
|
||||
Read less
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="showNumDescription == thresholdDescription &&
|
||||
dataProviderInfo.description.length > thresholdDescription" class="uk-text-right">
|
||||
<a (click)="showNumDescription = dataProviderInfo.description.length;">
|
||||
Read more
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="dataProviderInfo.description && showNumDescription > thresholdDescription"
|
||||
class="uk-text-right">
|
||||
<a (click)="showNumDescription = thresholdDescription;">
|
||||
Read less
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul *ngIf="hasJournalInfo" class="uk-list uk-margin-medium-bottom uk-margin-remove-top">
|
||||
<showPublisher [journal]="dataProviderInfo.journal" [properties]="properties"></showPublisher>
|
||||
</ul>
|
||||
<ul *ngIf="hasJournalInfo" class="uk-list uk-margin-medium-bottom uk-margin-remove-top">
|
||||
<showPublisher [journal]="dataProviderInfo.journal" [properties]="properties"></showPublisher>
|
||||
</ul>
|
||||
|
||||
<div *ngIf="hasAggregationStatusInfo || dataProviderInfo.fundedContent"
|
||||
class="uk-margin-medium-bottom uk-animation-fade uk-animation-fast">
|
||||
<div *ngIf="hasAggregationStatusInfo || dataProviderInfo.fundedContent"
|
||||
class="uk-margin-medium-bottom uk-animation-fade uk-animation-fast">
|
||||
<span *ngIf="dataProviderInfo.aggregationStatus?.fulltexts && dataProviderInfo.aggregationStatus?.fulltexts != -1"
|
||||
class="uk-margin-right">
|
||||
<span class="uk-text-muted">Collected full-texts: </span>
|
||||
{{dataProviderInfo.aggregationStatus.fulltexts | number}}
|
||||
</span>
|
||||
<span *ngIf="dataProviderInfo.fundedContent && dataProviderInfo.fundedContent > 0"
|
||||
class="uk-display-inline-block">
|
||||
<span *ngIf="dataProviderInfo.fundedContent && dataProviderInfo.fundedContent > 0"
|
||||
class="uk-display-inline-block">
|
||||
<span class="uk-text-muted">Results with funding information: </span>
|
||||
{{dataProviderInfo.fundedContent | number}}
|
||||
{{dataProviderInfo.fundedContent | number}}
|
||||
</span>
|
||||
<!-- <span *ngIf="dataProviderInfo.aggregationStatus.lastUpdateDate"-->
|
||||
<!-- class="uk-display-inline-block">-->
|
||||
<!-- <span class="uk-text-muted">Latest data aggregation: </span>-->
|
||||
<!-- {{dataProviderInfo.aggregationStatus.lastUpdateDate | date}}-->
|
||||
<!-- </span>-->
|
||||
</div>
|
||||
<div *ngIf="!aggregationStatusIsInitialized || !dataProviderInfo.fundedContent"
|
||||
class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">
|
||||
<span class="loading-gif uk-align-center"></span>
|
||||
</div>
|
||||
<!-- <span *ngIf="dataProviderInfo.aggregationStatus.lastUpdateDate"-->
|
||||
<!-- class="uk-display-inline-block">-->
|
||||
<!-- <span class="uk-text-muted">Latest data aggregation: </span>-->
|
||||
<!-- {{dataProviderInfo.aggregationStatus.lastUpdateDate | date}}-->
|
||||
<!-- </span>-->
|
||||
</div>
|
||||
<div *ngIf="!aggregationStatusIsInitialized || !dataProviderInfo.fundedContent"
|
||||
class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">
|
||||
<span class="loading-gif uk-align-center"></span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"
|
||||
class="uk-margin-medium-bottom">
|
||||
<span class="uk-text-muted">Countries:</span>
|
||||
{{dataProviderInfo.countries.join(", ")}}
|
||||
</div>
|
||||
<div *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"
|
||||
class="uk-margin-medium-bottom">
|
||||
<span class="uk-text-muted">Countries:</span>
|
||||
{{dataProviderInfo.countries.join(", ")}}
|
||||
</div>
|
||||
|
||||
<!-- Subjects -->
|
||||
<div *ngIf="dataProviderInfo.subjects && dataProviderInfo.subjects.length > 0"
|
||||
class="uk-margin-medium-bottom uk-margin-bottom">
|
||||
<div class="uk-height-max-medium uk-overflow-auto">
|
||||
<div class="uk-text-muted">Subjects </div>
|
||||
<span *ngFor="let subject of dataProviderInfo.subjects.slice(0, showNumSubjects) let i=index">
|
||||
<!-- Subjects -->
|
||||
<div *ngIf="dataProviderInfo.subjects && dataProviderInfo.subjects.length > 0"
|
||||
class="uk-margin-medium-bottom uk-margin-bottom">
|
||||
<div class="uk-height-max-medium uk-overflow-auto">
|
||||
<div class="uk-text-muted">Subjects </div>
|
||||
<span *ngFor="let subject of dataProviderInfo.subjects.slice(0, showNumSubjects) let i=index">
|
||||
<span>{{subject}}</span>
|
||||
<span *ngIf="(i < dataProviderInfo.subjects.length-1)">, </span>
|
||||
</span>
|
||||
<span *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"> ... </span>
|
||||
</div>
|
||||
<div *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"
|
||||
class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumSubjects = dataProviderInfo.subjects.length;">
|
||||
View all {{dataProviderInfo.subjects.length | number}} subjects
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showNumSubjects > thresholdSubjects" class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumSubjects = thresholdSubjects;">View less subjects</a>
|
||||
</div>
|
||||
<span *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"> ... </span>
|
||||
</div>
|
||||
<div *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"
|
||||
class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumSubjects = dataProviderInfo.subjects.length;">
|
||||
View all {{dataProviderInfo.subjects.length | number}} subjects
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showNumSubjects > thresholdSubjects" class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumSubjects = thresholdSubjects;">View less subjects</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="hasSecondaryInfo"
|
||||
[class]="'uk-padding uk-inline ' + (hasPrimaryInfo?'uk-width-1-3@m right-column': 'uk-width-expand')">
|
||||
<div *ngIf="dataProviderInfo.oaiPmhURL || dataProviderInfo.openDoarId || dataProviderInfo.r3DataId"
|
||||
class="uk-margin-medium-bottom">
|
||||
<div *ngIf="dataProviderInfo.oaiPmhURL">
|
||||
<span class="uk-text-muted">OAI-PMH: </span>
|
||||
<a target="_blank" href="{{dataProviderInfo.oaiPmhURL}}">
|
||||
{{dataProviderInfo.oaiPmhURL}}
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="dataProviderInfo.openDoarId" class="uk-display-inline-block">
|
||||
<span class="uk-text-muted">Detailed information @ </span>
|
||||
<a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}">
|
||||
OpenDOAR
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</div>
|
||||
<span *ngIf="dataProviderInfo.r3DataId" class="uk-display-inline-block">
|
||||
<div *ngIf="hasSecondaryInfo"
|
||||
[class]="'uk-padding uk-inline ' + (hasPrimaryInfo?'uk-width-1-3@m right-column': 'uk-width-expand')">
|
||||
<div *ngIf="dataProviderInfo.oaiPmhURL || dataProviderInfo.openDoarId || dataProviderInfo.r3DataId"
|
||||
class="uk-margin-medium-bottom">
|
||||
<div *ngIf="dataProviderInfo.oaiPmhURL">
|
||||
<span class="uk-text-muted">OAI-PMH: </span>
|
||||
<a target="_blank" href="{{dataProviderInfo.oaiPmhURL}}">
|
||||
{{dataProviderInfo.oaiPmhURL}}
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="dataProviderInfo.openDoarId" class="uk-display-inline-block">
|
||||
<span class="uk-text-muted">Detailed information @ </span>
|
||||
<a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}">
|
||||
OpenDOAR
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</div>
|
||||
<span *ngIf="dataProviderInfo.r3DataId" class="uk-display-inline-block">
|
||||
<span class="uk-text-muted">Detailed information @ </span>
|
||||
<a target="_blank" href="{{properties.r3DataURL+dataProviderInfo.r3DataId}}">
|
||||
re3data.org
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<!-- Organizations -->
|
||||
<!-- <div class="uk-text-muted uk-text-small">Organizations</div>-->
|
||||
<!-- <div class="uk-height-max-medium uk-overflow-auto">-->
|
||||
<div *ngIf="dataProviderInfo.organizations && dataProviderInfo.organizations.length > 0"
|
||||
class="uk-margin-medium-bottom">
|
||||
<div class="uk-height-max-medium uk-overflow-auto">
|
||||
<span class="uk-text-muted">Organizations: </span>
|
||||
<span *ngFor="let organization of dataProviderInfo.organizations.slice(0, showNumOrganizations) let i=index"
|
||||
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||
[title]="organization.name">
|
||||
</div>
|
||||
<!-- Organizations -->
|
||||
<!-- <div class="uk-text-muted uk-text-small">Organizations</div>-->
|
||||
<!-- <div class="uk-height-max-medium uk-overflow-auto">-->
|
||||
<div *ngIf="dataProviderInfo.organizations && dataProviderInfo.organizations.length > 0"
|
||||
class="uk-margin-medium-bottom">
|
||||
<div class="uk-height-max-medium uk-overflow-auto">
|
||||
<span class="uk-text-muted">Organizations: </span>
|
||||
<span *ngFor="let organization of dataProviderInfo.organizations.slice(0, showNumOrganizations) let i=index"
|
||||
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||
[title]="organization.name">
|
||||
<a *ngIf="organization.id"
|
||||
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
|
||||
[routerLink]="properties.searchLinkToOrganization.split('?')[0]">
|
||||
|
@ -221,255 +268,142 @@
|
|||
</span>
|
||||
<span *ngIf="(i < dataProviderInfo.organizations.length-1)">, </span>
|
||||
</span>
|
||||
<span *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"> ... </span>
|
||||
</div>
|
||||
<div *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"
|
||||
class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumOrganizations = dataProviderInfo.organizations.length;">
|
||||
View all {{dataProviderInfo.organizations.length | number}} organizations
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showNumOrganizations > thresholdOrganizations" class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumOrganizations = thresholdOrganizations;">View less organizations</a>
|
||||
</div>
|
||||
<span *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"> ... </span>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="!hasPrimaryInfo && (aggregationStatusIsInitialized && !hasAggregationStatusInfo) && !hasSecondaryInfo" class="uk-width-expand uk-padding">
|
||||
<div class="uk-animation-fade uk-alert uk-alert-primary" role="alert">
|
||||
No summary information available
|
||||
<div *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"
|
||||
class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumOrganizations = dataProviderInfo.organizations.length;">
|
||||
View all {{dataProviderInfo.organizations.length | number}} organizations
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showNumOrganizations > thresholdOrganizations" class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumOrganizations = thresholdOrganizations;">View less organizations</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #projects_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchProjects" resultType="project"
|
||||
[params]="getParamsForSearchLink()"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedProjects"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #datasources_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
|
||||
[params]="getParamsForSearchLink()"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #relatedDatasources_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<relatedDatasourcesTab
|
||||
[dataproviderId]="datasourceId"
|
||||
[results]="dataProviderInfo.relatedDatasources"
|
||||
[loading]="loadingRelatedDatasources"
|
||||
[fetchResults]="fetchAggregatorsResults"
|
||||
[collectedFromName]="dataProviderInfo.title.name"
|
||||
[properties]=properties
|
||||
[modal]="relatedDatasourcesModal">
|
||||
</relatedDatasourcesTab>
|
||||
<div *ngIf="!hasPrimaryInfo && (aggregationStatusIsInitialized && !hasAggregationStatusInfo) && !hasSecondaryInfo" class="uk-width-expand uk-padding">
|
||||
<div class="uk-animation-fade uk-alert uk-alert-primary" role="alert">
|
||||
No summary information available
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #publications_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchPublications" resultType="publication"
|
||||
[params]="getParamsForSearchLink('publications')"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</div>
|
||||
<!--Projects-->
|
||||
<ng-container *ngIf="fetchProjects.searchUtils.totalResults > 0">
|
||||
<div id="projects" class="uk-grid uk-margin-remove landing-section">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchProjects" resultType="project"
|
||||
[params]="getParamsForSearchLink()"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedProjects"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #datasets_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchDatasets" resultType="dataset"
|
||||
[params]="getParamsForSearchLink('datasets')"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</ng-container>
|
||||
<!--Content Providers-->
|
||||
<ng-container *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
|
||||
<div id="datasources" class="uk-grid uk-margin-remove landing-section">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
|
||||
[params]="getParamsForSearchLink()"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #software_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchSoftware" resultType="software"
|
||||
[params]="getParamsForSearchLink('software')"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</ng-container>
|
||||
<!--Related Content Providers-->
|
||||
<ng-container *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)">
|
||||
<div id="relatedDatasources" class="uk-grid uk-margin-remove landing-section">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<relatedDatasourcesTab
|
||||
[dataproviderId]="datasourceId"
|
||||
[results]="dataProviderInfo.relatedDatasources"
|
||||
[loading]="loadingRelatedDatasources"
|
||||
[fetchResults]="fetchAggregatorsResults"
|
||||
[collectedFromName]="dataProviderInfo.title.name"
|
||||
[properties]=properties
|
||||
[modal]="relatedDatasourcesModal">
|
||||
</relatedDatasourcesTab>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #other_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchOrps" resultType="other"
|
||||
[params]="getParamsForSearchLink('other')"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</ng-container>
|
||||
<!--Publications-->
|
||||
<ng-container *ngIf="fetchPublications.searchUtils.totalResults > 0">
|
||||
<div id="publications" class="uk-grid uk-margin-remove landing-section">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchPublications" resultType="publication"
|
||||
[params]="getParamsForSearchLink('publications')"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #statistics_tab>
|
||||
<div class="">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status,
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</ng-container>
|
||||
<!--Research Data-->
|
||||
<ng-container *ngIf="fetchDatasets.searchUtils.totalResults > 0">
|
||||
<div id="datasets" class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchDatasets" resultType="dataset"
|
||||
[params]="getParamsForSearchLink('datasets')"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</ng-container>
|
||||
<!--Software-->
|
||||
<ng-container *ngIf="fetchSoftware.searchUtils.totalResults > 0">
|
||||
<div id="software" class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchSoftware" resultType="software"
|
||||
[params]="getParamsForSearchLink('software')"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</ng-container>
|
||||
<!--Other-->
|
||||
<ng-container *ngIf="fetchOrps.searchUtils.totalResults > 0">
|
||||
<div id="other" class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<search-tab [fetch]="fetchOrps" resultType="other"
|
||||
[params]="getParamsForSearchLink('other')"
|
||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||
[properties]="properties">
|
||||
</search-tab>
|
||||
</div>
|
||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||
</div>
|
||||
</ng-container>
|
||||
<!--Statistics-->
|
||||
<ng-container *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)">
|
||||
|
||||
<div id="statistics" class="uk-width-expand uk-padding">
|
||||
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status,
|
||||
fetchSoftware.searchUtils.status, fetchOrps.searchUtils.status]"
|
||||
[type]="'statistics'" tab_error_class=true></errorMessages>
|
||||
[type]="'statistics'" tab_error_class=true></errorMessages>
|
||||
|
||||
<div
|
||||
*ngIf="statsClicked &&
|
||||
<div
|
||||
*ngIf="statsClicked &&
|
||||
(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE
|
||||
|| fetchSoftware.searchUtils.status == errorCodes.DONE || fetchOrps.searchUtils.status == errorCodes.DONE)">
|
||||
<statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets"
|
||||
[fetchSoftware]="fetchSoftware" [fetchOther]="fetchOrps"
|
||||
[datasourceId]="datasourceId">
|
||||
</statisticsTab>
|
||||
</div>
|
||||
<statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets"
|
||||
[fetchSoftware]="fetchSoftware" [fetchOther]="fetchOrps"
|
||||
[datasourceId]="datasourceId">
|
||||
</statisticsTab>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<!-- [class]="numberOfTabs > 2 ? 'uk-visible@m' : ''"-->
|
||||
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)">
|
||||
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
|
||||
<!-- [class]="(firstTab === 'summary')?'uk-active':''"-->
|
||||
<my-tab
|
||||
[tabTitle]="'Summary'" [tabId]="'summary'" class="uk-active">
|
||||
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'projects')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchProjects.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Projects'" [tabNumber]="fetchProjects.searchUtils.totalResults"
|
||||
[tabId]="'projects'" >
|
||||
<ng-container *ngTemplateOutlet="projects_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'datasources')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchDataproviders.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Content Providers'" [tabNumber]="fetchDataproviders.searchUtils.totalResults"
|
||||
[tabId]="'datasources'" >
|
||||
<ng-container *ngTemplateOutlet="datasources_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'relatedDatasources')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Related Content Providers'" [tabId]="'relatedDatasources'"
|
||||
>
|
||||
<ng-container *ngTemplateOutlet="relatedDatasources_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'publications')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchPublications.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Publications'" [tabNumber]="fetchPublications.searchUtils.totalResults"
|
||||
[tabId]="'publications'" >
|
||||
<ng-container *ngTemplateOutlet="publications_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'datasets')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchDatasets.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Research Data'" [tabNumber]="fetchDatasets.searchUtils.totalResults"
|
||||
[tabId]="'datasets'" >
|
||||
<ng-container *ngTemplateOutlet="datasets_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'software')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchSoftware.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Software'" [tabNumber]="fetchSoftware.searchUtils.totalResults"
|
||||
[tabId]="'software'">
|
||||
<ng-container *ngTemplateOutlet="software_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'other')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchOrps.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults"
|
||||
[tabId]="'other'">
|
||||
<ng-container *ngTemplateOutlet="other_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'statistics')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
|
||||
>
|
||||
<ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
|
||||
</my-tab>
|
||||
</my-tabs>
|
||||
|
||||
<!-- <div *ngIf="numberOfTabs() > 2">TEST!!!</div>-->
|
||||
|
||||
<!-- *ngIf="numberOfTabs > 2"-->
|
||||
<my-small-tabs (selectedActiveTab)="onSelectActiveTab($event)">
|
||||
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
|
||||
<!-- [class]="(firstTab === 'summary')?'uk-active':''"-->
|
||||
<my-tab
|
||||
[tabTitle]="'Summary'" [tabId]="'summary'" class="uk-active">
|
||||
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'projects')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchProjects.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Projects'" [tabNumber]="fetchProjects.searchUtils.totalResults"
|
||||
[tabId]="'projects'" >
|
||||
<ng-container *ngTemplateOutlet="projects_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'datasources')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchDataproviders.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Content Providers'" [tabNumber]="fetchDataproviders.searchUtils.totalResults"
|
||||
[tabId]="'datasources'" >
|
||||
<ng-container *ngTemplateOutlet="datasources_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'relatedDatasources')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Related Content Providers'" [tabId]="'relatedDatasources'"
|
||||
>
|
||||
<ng-container *ngTemplateOutlet="relatedDatasources_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'publications')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchPublications.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Publications'" [tabNumber]="fetchPublications.searchUtils.totalResults"
|
||||
[tabId]="'publications'" >
|
||||
<ng-container *ngTemplateOutlet="publications_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'datasets')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchDatasets.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Research Data'" [tabNumber]="fetchDatasets.searchUtils.totalResults"
|
||||
[tabId]="'datasets'" >
|
||||
<ng-container *ngTemplateOutlet="datasets_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'software')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchSoftware.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Software'" [tabNumber]="fetchSoftware.searchUtils.totalResults"
|
||||
[tabId]="'software'">
|
||||
<ng-container *ngTemplateOutlet="software_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'other')?'uk-active':''"-->
|
||||
<my-tab *ngIf="fetchOrps.searchUtils.totalResults > 0"
|
||||
[tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults"
|
||||
[tabId]="'other'">
|
||||
<ng-container *ngTemplateOutlet="other_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(firstTab === 'statistics')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
|
||||
>
|
||||
<ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
|
||||
</my-tab>
|
||||
</my-small-tabs>
|
||||
</div>
|
||||
|
||||
</ng-container>
|
||||
<!-- <ng-template #loadingBlock>-->
|
||||
<!-- <div *ngIf="!tabsAreInitialized" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">-->
|
||||
<!-- <span class="loading-gif uk-align-center" ></span>-->
|
||||
|
|
|
@ -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') {
|
||||
|
|
|
@ -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 ('disabled') disabled: boolean = false;
|
||||
}
|
||||
|
|
|
@ -2,43 +2,147 @@
|
|||
* 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: `
|
||||
<ul class="uk-tab" [ngClass]="customClass" uk-tab="connect: .tabs-content">
|
||||
<!-- [class.uk-active]="selected === tab.tabId"-->
|
||||
<li *ngFor="let tab of tabs.toArray(); let i=index" [ngClass]="tab.customClass" (click)="selectTab(tab)">
|
||||
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center" [ngClass]="tab.tabIcon ? 'uk-flex-column' : ''">
|
||||
<icon *ngIf="tab.tabIcon" [svg]="tab.tabIcon.svg" [ratio]="tab.tabIcon.ratio?tab.tabIcon.ratio:1" class="uk-margin-small-bottom"
|
||||
[ngClass]="(selected === tab.tabId)?tab.tabIcon.active:null"></icon>
|
||||
<div>{{tab.title}}</div>
|
||||
<div *ngIf="tab.num" class="number">{{tab.num | number}}</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="uk-switcher tabs-content">
|
||||
<ng-content></ng-content>
|
||||
template: `
|
||||
<div class="uk-grid uk-margin-remove-left">
|
||||
|
||||
<div class="uk-margin-medium-right uk-padding-small uk-width-expand" >
|
||||
<div class=" uk-width-1-1" uk-slider="finite: true">
|
||||
<div class="uk-position-relative " >
|
||||
<div class="uk-slider-container ">
|
||||
<ul class=" uk-slider-items " style="flex-wrap: nowrap !important;" >
|
||||
<ng-container *ngFor="let tab of tabs.toArray(); let i=index">
|
||||
<ng-container *ngIf="!tab.customClass">
|
||||
<li [ngClass]="tab.customClass" (click)="selectTab(tab)" >
|
||||
<ul class="uk-tab">
|
||||
<li [class.uk-active]="tab.active" [class.uk-disabled]="tab.disabled">
|
||||
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center" [ngClass]="tab.tabIcon ? 'uk-flex-column' : ''">
|
||||
<icon *ngIf="tab.tabIcon" [svg]="tab.tabIcon.svg" [ratio]="tab.tabIcon.ratio?tab.tabIcon.ratio:1" class="uk-margin-small-bottom"
|
||||
[ngClass]="(selected === tab.tabId)?tab.tabIcon.active:null"></icon>
|
||||
<div>{{tab.title}}</div>
|
||||
<div *ngIf="tab.num && !tab.disabled" class="">({{tab.num | number}})</div>
|
||||
<div *ngIf="tab.disabled" class="">(-)</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="">
|
||||
<a class="uk-position-center-left-out" uk-slider-item="previous"><span uk-icon="chevron-left"></span></a>
|
||||
<a class="uk-position-center-right-out" uk-slider-item="next"><span uk-icon="chevron-right"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ng-container *ngFor="let tab of tabs.toArray(); let i=index">
|
||||
<ng-container *ngIf="tab.customClass">
|
||||
<div class="uk-width-small uk-padding-small">
|
||||
<ul class="uk-tab">
|
||||
<li [ngClass]="tab.customClass" (click)="selectTab(tab)" [class.uk-active]="tab.active" >
|
||||
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center" [ngClass]="tab.tabIcon ? 'uk-flex-column' : ''">
|
||||
<icon *ngIf="tab.tabIcon" [svg]="tab.tabIcon.svg" [ratio]="tab.tabIcon.ratio?tab.tabIcon.ratio:1" class="uk-margin-small-bottom"
|
||||
[ngClass]="(selected === tab.tabId)?tab.tabIcon.active:null"></icon>
|
||||
<div>{{tab.title}}</div>
|
||||
<div *ngIf="tab.num" class="number">{{tab.num | number}}</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
||||
`
|
||||
})
|
||||
export class TabsComponent implements AfterContentInit {
|
||||
@Input()
|
||||
|
||||
public customClass: string;
|
||||
@ContentChildren(TabComponent) tabs: QueryList<TabComponent>;
|
||||
@Output() public selectedActiveTab: EventEmitter<any> = 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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue