[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
This commit is contained in:
k.triantafyllou 2019-04-15 07:47:36 +00:00
parent bb3a22be2b
commit 259dc565ff
1 changed files with 10 additions and 2 deletions

View File

@ -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'");
}