From 259dc565fff970b74721b31e3a9981328031ba1f Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 15 Apr 2019 07:47:36 +0000 Subject: [PATCH] [Trunk|Library]: Add at search page hasPrefix parameter with default value true git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55343 d315682c-612b-4755-9ff5-7f18f6832af3 --- searchPages/searchUtils/searchPage.component.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/searchPages/searchUtils/searchPage.component.ts b/searchPages/searchUtils/searchPage.component.ts index 58d5d739..1d47fc81 100644 --- a/searchPages/searchUtils/searchPage.component.ts +++ b/searchPages/searchUtils/searchPage.component.ts @@ -51,6 +51,7 @@ export class SearchPageComponent { @Input() mapTooltipType: string ="content providers"; @Input() newQueryButton: boolean = true; @Input() lastIndex: boolean = true; + @Input() hasPrefix: boolean = true; //@Input() sortBy: string = ""; @ViewChild (ModalLoading) loading : ModalLoading ; public fieldIdsMap;//: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }}; @@ -117,12 +118,19 @@ export class SearchPageComponent { this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content:description},"property='og:description'"); } + updateTitle(title:string) { - var _prefix ="OpenAIRE | "; - var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); + let _title: string; + if(this.hasPrefix == true) { + let _prefix ="OpenAIRE | "; + _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); + } else { + _title = ((title.length > 50) ? title.substring(0, 50) : title); + } this._title.setTitle(_title); this._meta.updateTag({content:_title},"property='og:title'"); } + updateUrl(url:string) { this._meta.updateTag({content:url},"property='og:url'"); }