[Trunk | Library]: resultLanding.component: Load <citeThis> component, only if button to open modal is clicked (this will load javascript for cite this when needed) - improve performance.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58951 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-06-17 10:32:32 +00:00
parent 0c60a35955
commit 9338c43a23
2 changed files with 5 additions and 2 deletions

View File

@ -578,6 +578,6 @@
</modal-alert>
<modal-alert #citeModal [classTitle]="'landing-modal-header uk-padding-small'"
[classBody]="'uk-padding-remove landing-modal'">
<citeThis *ngIf="resultLandingInfo" [result]="resultLandingInfo" [id]="id" [type]="title.toLowerCase()"></citeThis>
<citeThis *ngIf="resultLandingInfo && citeThisClicked" [result]="resultLandingInfo" [id]="id" [type]="title.toLowerCase()"></citeThis>
</modal-alert>

View File

@ -50,7 +50,9 @@ export class ResultLandingComponent {
public thresholdDescription: number = 670;
public showNumDescription: number = 670;
public citeThisClicked: boolean;
// Metrics tab variables
public metricsClicked: boolean;
public hasAltMetrics: boolean = false;
@ -562,6 +564,7 @@ export class ResultLandingComponent {
}
public openCiteModal() {
this.citeThisClicked = true;
this.citeModal.cancelButton = false;
this.citeModal.okButton = false;
this.citeModal.alertTitle = "Cite this " + this.getTypeName() + " to";