[Library | Trunk]: Remove scroll to top from pages initiliazation
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60926 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
9e96ecddc6
commit
1e785e4fd9
|
@ -158,7 +158,6 @@ export class ShowOptions {
|
||||||
this.basketShowLinksTo = false;
|
this.basketShowLinksTo = false;
|
||||||
this.basketShowSources = true;
|
this.basketShowSources = true;
|
||||||
HelperFunctions.scroll();
|
HelperFunctions.scroll();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showLinkTo() {
|
showLinkTo() {
|
||||||
|
|
|
@ -5,7 +5,7 @@ export class ConnectHelper {
|
||||||
|
|
||||||
public static getCommunityFromDomain(domain: string): string{
|
public static getCommunityFromDomain(domain: string): string{
|
||||||
if(properties.environment == "development") {
|
if(properties.environment == "development") {
|
||||||
domain = "beta.enermaps.openaire.eu"; //for testing
|
domain = "beta.egi.openaire.eu"; //for testing
|
||||||
}
|
}
|
||||||
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
|
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
|
||||||
if (domain.indexOf('openaire.eu') === -1) {
|
if (domain.indexOf('openaire.eu') === -1) {
|
||||||
|
|
|
@ -161,8 +161,6 @@ export class DataProviderComponent {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
HelperFunctions.scroll();
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,6 @@ import {properties} from "../../../../environments/environment";
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div *ngIf="showNum == threshold && availableOn && availableOn.length > 5">...</div>-->
|
|
||||||
<div *ngIf="showNum == threshold && availableOn && availableOn.length > 5" class="uk-margin-bottom">
|
<div *ngIf="showNum == threshold && availableOn && availableOn.length > 5" class="uk-margin-bottom">
|
||||||
<a (click)="showNum = availableOn.length;" class="uk-flex uk-flex-middle uk-flex-center">
|
<a (click)="showNum = availableOn.length;" class="uk-flex uk-flex-middle uk-flex-center">
|
||||||
<span>View more</span>
|
<span>View more</span>
|
||||||
|
@ -70,15 +69,6 @@ import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
export class AvailableOnComponent {
|
export class AvailableOnComponent {
|
||||||
@Input() availableOn: HostedByCollectedFrom[];
|
@Input() availableOn: HostedByCollectedFrom[];
|
||||||
// {
|
|
||||||
// "downloadName": string, "downloadUrl": string[],
|
|
||||||
// "collectedName": string, "collectedId": string,
|
|
||||||
// "accessMode": string[], "bestAccessMode": string,
|
|
||||||
// "type": string, "year": string, icon: string
|
|
||||||
// }[];
|
|
||||||
// public open = 'assets/common-assets/unlock.svg';
|
|
||||||
// public closed = 'assets/common-assets/lock.svg';
|
|
||||||
// public unknown = 'assets/common-assets/question.svg';
|
|
||||||
public threshold: number = 4;
|
public threshold: number = 4;
|
||||||
public showNum: number = 4;
|
public showNum: number = 4;
|
||||||
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
|
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
|
||||||
|
@ -86,22 +76,7 @@ export class AvailableOnComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {}
|
||||||
// this.availableOn.forEach(available => {
|
|
||||||
// if (available.bestAccessMode) {
|
|
||||||
// if (available.bestAccessMode.toLowerCase().indexOf('open') !== -1) {
|
|
||||||
// available.icon = this.open;
|
|
||||||
// } else if (available.bestAccessMode.toLowerCase().indexOf('not available') !== -1) {
|
|
||||||
// available.icon = this.unknown;
|
|
||||||
// } else {
|
|
||||||
// available.icon = this.closed;
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// available.icon = this.unknown;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
|
|
||||||
public removeUnknown(value: string): string {
|
public removeUnknown(value: string): string {
|
||||||
if (value.toLowerCase() === 'unknown') {
|
if (value.toLowerCase() === 'unknown') {
|
||||||
|
@ -109,8 +84,4 @@ export class AvailableOnComponent {
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public scroll() {
|
|
||||||
HelperFunctions.scroll();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
import {Component, Input} from '@angular/core';
|
|
||||||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
|
||||||
|
|
||||||
// NOT USED
|
|
||||||
@Component({
|
|
||||||
selector: 'publishedIn',
|
|
||||||
template: `
|
|
||||||
<dl [class]="'uk-description-list-line' + ((publishedIn && publishedIn.size > threshold) ? ' uk-margin-remove-bottom' : '')">
|
|
||||||
<dt class="title">Published in</dt>
|
|
||||||
<dd class="line" *ngFor="let key of getKeys(publishedIn) let i=index">
|
|
||||||
<div *ngIf="i<5 || showAll" class="{{publishedIn.get(key)['bestAccessMode']}}">
|
|
||||||
<span [class]="publishedIn.get(key)['url'].length > 0 ? 'custom-external custom-icon' : ''">
|
|
||||||
<span *ngIf="publishedIn.get(key)['url'].length > 1">
|
|
||||||
{{key}}
|
|
||||||
<span *ngFor="let url of publishedIn.get(key)['url']; let i=index">
|
|
||||||
<a href="{{url}}" target="_blank"
|
|
||||||
[attr.uk-tooltip]="publishedIn.get(key)['accessMode'][i] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
|
||||||
[title]="publishedIn.get(key)['accessMode'][i]">
|
|
||||||
[{{i+1}}]
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<a *ngIf="publishedIn.get(key)['url'].length == 1"
|
|
||||||
href="{{publishedIn.get(key)['url']}}"
|
|
||||||
target="_blank"
|
|
||||||
[attr.uk-tooltip]="publishedIn.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
|
||||||
[title]="publishedIn.get(key)['bestAccessMode']">
|
|
||||||
{{key}}
|
|
||||||
</a>
|
|
||||||
<span *ngIf="publishedIn.get(key)['url'].length == 0"
|
|
||||||
[attr.uk-tooltip]="publishedIn.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
|
||||||
[title]="publishedIn.get(key)['bestAccessMode']">
|
|
||||||
{{key}}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</dd>
|
|
||||||
<dd *ngIf="showAll" class="uk-text-right uk-margin-bottom">
|
|
||||||
<a class="uk-text-muted" (click)="showAll = !showAll; scroll()">
|
|
||||||
View less
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
<!-- <dd *ngIf="!showAll && publishedIn.size > 5">...</dd>-->
|
|
||||||
<dd *ngIf="!showAll && publishedIn.size > 5" class="uk-text-right uk-margin-bottom">
|
|
||||||
<a class="uk-text-muted" (click)="showAll = !showAll;">
|
|
||||||
View more
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
`
|
|
||||||
})
|
|
||||||
|
|
||||||
// NOT USED
|
|
||||||
export class PublishedInComponent {
|
|
||||||
public threshold: number = 5;
|
|
||||||
public showNum: number = 5;
|
|
||||||
|
|
||||||
//key is name
|
|
||||||
@Input() publishedIn: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>;
|
|
||||||
|
|
||||||
public showAll: boolean = false;
|
|
||||||
|
|
||||||
constructor () {}
|
|
||||||
|
|
||||||
ngOnInit() {}
|
|
||||||
|
|
||||||
public scroll() {
|
|
||||||
HelperFunctions.scroll();
|
|
||||||
}
|
|
||||||
public getKeys( map) {
|
|
||||||
return Array.from(map.keys());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,7 +7,6 @@ import {PagingModule} from '../../utils/paging.module';
|
||||||
import {ShowIdentifiersComponent} from './showIdentifiers.component';
|
import {ShowIdentifiersComponent} from './showIdentifiers.component';
|
||||||
import {ShowSubjectsComponent} from './showSubjects.component';
|
import {ShowSubjectsComponent} from './showSubjects.component';
|
||||||
import {FundedByComponent} from './fundedBy.component';
|
import {FundedByComponent} from './fundedBy.component';
|
||||||
import {PublishedInComponent} from './publishedIn.component';
|
|
||||||
import {AvailableOnComponent} from './availableOn.component';
|
import {AvailableOnComponent} from './availableOn.component';
|
||||||
import {TabTableComponent} from './tabTable.component';
|
import {TabTableComponent} from './tabTable.component';
|
||||||
import {ShowPublisherComponent} from "./showPublisher.component";
|
import {ShowPublisherComponent} from "./showPublisher.component";
|
||||||
|
@ -21,14 +20,14 @@ import {RelatedToComponent} from "./relatedTo.component";
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
ShowIdentifiersComponent,ShowSubjectsComponent,
|
ShowIdentifiersComponent,ShowSubjectsComponent,
|
||||||
FundedByComponent,PublishedInComponent,AvailableOnComponent,TabTableComponent,
|
FundedByComponent,AvailableOnComponent,TabTableComponent,
|
||||||
RelatedToComponent
|
RelatedToComponent
|
||||||
],
|
],
|
||||||
providers:[
|
providers:[
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
ShowIdentifiersComponent, ShowSubjectsComponent,
|
ShowIdentifiersComponent, ShowSubjectsComponent,
|
||||||
FundedByComponent, PublishedInComponent, AvailableOnComponent, TabTableComponent, ShowPublisherComponent,
|
FundedByComponent,AvailableOnComponent, TabTableComponent, ShowPublisherComponent,
|
||||||
RelatedToComponent
|
RelatedToComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
|
@ -156,13 +156,8 @@ export class OrganizationComponent {
|
||||||
"page_type": "organization"
|
"page_type": "organization"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//this.warningMessage = "No valid organization id";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HelperFunctions.scroll();
|
|
||||||
|
|
||||||
this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))';
|
this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))';
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.downloadURLAPI = this.properties.csvAPIURL;
|
this.downloadURLAPI = this.properties.csvAPIURL;
|
||||||
|
|
|
@ -189,7 +189,6 @@ export class ProjectComponent {
|
||||||
this.downloadURLAPI = this.properties.csvAPIURL;
|
this.downloadURLAPI = this.properties.csvAPIURL;
|
||||||
|
|
||||||
this.createClipboard();
|
this.createClipboard();
|
||||||
HelperFunctions.scroll();
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ export class ReloadComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
HelperFunctions.scroll();
|
|
||||||
let URL = Session.getReloadUrl();
|
let URL = Session.getReloadUrl();
|
||||||
if (URL && URL["path"] && URL["path"] != "") {
|
if (URL && URL["path"] && URL["path"] != "") {
|
||||||
let url: string = URL["path"];
|
let url: string = URL["path"];
|
||||||
|
|
|
@ -114,10 +114,6 @@ export class ShowAuthorsComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public scroll() {
|
|
||||||
HelperFunctions.scroll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public onClick() {
|
public onClick() {
|
||||||
if (this.modal) {
|
if (this.modal) {
|
||||||
this.modal.cancel();
|
this.modal.cancel();
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
import {Directive, ElementRef, Input, OnInit, Renderer2} from "@angular/core";
|
||||||
|
|
||||||
|
@Directive({
|
||||||
|
selector: '[svg-background]',
|
||||||
|
})
|
||||||
|
export class SvgBackgroundDirective implements OnInit{
|
||||||
|
@Input()
|
||||||
|
private color: string;
|
||||||
|
@Input()
|
||||||
|
private svg: string;
|
||||||
|
@Input()
|
||||||
|
private svgColor: string;
|
||||||
|
@Input()
|
||||||
|
private position: string = null;
|
||||||
|
private readonly element: any;
|
||||||
|
|
||||||
|
constructor(private elementRef: ElementRef,
|
||||||
|
private renderer: Renderer2,) {
|
||||||
|
this.element = this.elementRef.nativeElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
let svg = this.encodeSvg();
|
||||||
|
if(this.position && svg) {
|
||||||
|
this.renderer.setStyle(this.element, 'background', "url(" + svg + ") " + (this.color?this.color + " ":"") + "no-repeat " + this.position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private encodeSvg(): string {
|
||||||
|
if(this.svg && this.svgColor) {
|
||||||
|
return 'data:image/svg+xml,' + encodeURIComponent(this.svg.replace('{{color}}', this.svgColor));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
import {NgModule} from "@angular/core";
|
||||||
|
import {CommonModule} from "@angular/common";
|
||||||
|
import {SvgBackgroundDirective} from "./svg-background.directive";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [CommonModule],
|
||||||
|
declarations: [SvgBackgroundDirective],
|
||||||
|
exports: [SvgBackgroundDirective]
|
||||||
|
})
|
||||||
|
export class SvgBackgroundModule {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
export const search = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 532"><defs><style>.cls-1{isolation:isolate;}.cls-2{fill:{{color}};mix-blend-mode:multiply;}</style></defs><title>Asset 3</title><g class="cls-1"><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-2" d="M0,431s362,109,841,62,632,68,1159-9V0H0Z"/><path class="cls-2" d="M0,514s1401,71,2000-69V0H0Z"/></g></g></g></svg>'
|
Loading…
Reference in New Issue