[Explore | Trunk]: Add smooth scroll

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@60943 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2021-04-21 12:28:02 +00:00
parent 3e03b3a617
commit 1198ff93fe
5 changed files with 41 additions and 48 deletions

View File

@ -1,5 +1,5 @@
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {PreloadAllModules, RouterModule, Routes} from '@angular/router';
import {OpenaireErrorPageComponent} from './error/errorPage.component';
import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component";
@ -116,7 +116,11 @@ const routes: Routes = [
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes, {
preloadingStrategy: PreloadAllModules,
onSameUrlNavigation: "reload",
relativeLinkResolution: 'corrected'
})],
exports: [RouterModule]
})
export class AppRoutingModule {

View File

@ -13,6 +13,7 @@ import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component
import {Subscriber} from "rxjs";
import {Meta} from "@angular/platform-browser";
import {properties} from "../environments/environment";
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
@Component({
//changeDetection: ChangeDetectionStrategy.Default,
@ -43,9 +44,7 @@ import {properties} from "../environments/environment";
</span></a>
</cookie-law>
<bottom *ngIf="isClient && properties" [properties]="properties"></bottom>
`
})
export class AppComponent {
isClient: boolean = false;
@ -59,7 +58,7 @@ export class AppComponent {
subscriptions = [];
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
private router: Router, private userManagementService: UserManagementService,
private router: Router, private userManagementService: UserManagementService, private smoothScroll: SmoothScroll,
private configurationService: ConfigurationService, private _meta: Meta) {
this.userMenuItems.push(new MenuItem("", "My profile", "", "", false, [], [], {}));
this.userMenuItems.push(new MenuItem("", "My ORCID links", "", "/my-orcid-links", false, [], [""], {}));
@ -106,6 +105,7 @@ export class AppComponent {
});
this.configurationService.clearSubscriptions();
this.userManagementService.clearSubscriptions();
this.smoothScroll.clearSubscriptions();
}
buildMenu() {

View File

@ -46,19 +46,16 @@
<title>Search OpenAIRE</title>
</head>
<body class="" style="">
<body>
<div class="uk-offcanvas-content uk-height-viewport">
<app-root></app-root>
</div>
<script type="text/javascript" >
function loadAltmetrics(e,t,n){
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e);
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png")
};
</script>
</div>
</body>
<script type="text/javascript" >
function loadAltmetrics(e,t,n){
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e);
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png")
}
</script>
<script src="https://unpkg.com/smoothscroll-polyfill@0.4.3/dist/smoothscroll.min.js"></script>
</html>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="en" dir="ltr" vocab="http://schema.org/">
<head>
<head>
<link rel="search"
type="application/opensearchdescription+xml"
title="OpenAIRE Explore"
@ -42,23 +42,18 @@
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<title>Search OpenAIRE</title>
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<app-root></app-root>
</div>
<script type="text/javascript" >
function loadAltmetrics(e,t,n){
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e);
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png")
};
</script>
</body>
</head>
<body>
<div class="uk-offcanvas-content uk-height-viewport">
<app-root></app-root>
</div>
</body>
<script type="text/javascript" >
function loadAltmetrics(e,t,n){
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e);
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png")
}
</script>
<script src="https://unpkg.com/smoothscroll-polyfill@0.4.3/dist/smoothscroll.min.js"></script>
</html>

View File

@ -49,19 +49,16 @@
<title>Search OpenAIRE</title>
</head>
<body class="" style="">
<body>
<div class="uk-offcanvas-content uk-height-viewport">
<app-root></app-root>
</div>
<script type="text/javascript" >
function loadAltmetrics(e,t,n){
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e);
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png")
};
</script>
</div>
</body>
<script type="text/javascript" >
function loadAltmetrics(e,t,n){
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e);
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png")
}
</script>
<script src="https://unpkg.com/smoothscroll-polyfill@0.4.3/dist/smoothscroll.min.js"></script>
</html>