Landing: scroll to tab top when change page inside a tab
This commit is contained in:
parent
13ae37cb61
commit
9e7a6852cc
|
@ -607,6 +607,7 @@ export class ResultLandingComponent {
|
||||||
|
|
||||||
public updateRelatedPage($event) {
|
public updateRelatedPage($event) {
|
||||||
this.relatedPage = $event.value;
|
this.relatedPage = $event.value;
|
||||||
|
this.scrollToTabTop('all_related');
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateSimilarPage($event) {
|
public updateSimilarPage($event) {
|
||||||
|
@ -628,7 +629,14 @@ export class ResultLandingComponent {
|
||||||
public updateOpenCitationsPage($event) {
|
public updateOpenCitationsPage($event) {
|
||||||
this.openCitationsPage = $event.value;
|
this.openCitationsPage = $event.value;
|
||||||
}
|
}
|
||||||
|
scrollToTabTop(tabId:string){
|
||||||
|
setTimeout(() => {
|
||||||
|
window.scrollTo({
|
||||||
|
top: document.getElementById(tabId) ? document.getElementById(tabId).offsetTop - 250 : 250,
|
||||||
|
behavior: 'smooth'
|
||||||
|
});
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
public accessClass(accessMode: string): string {
|
public accessClass(accessMode: string): string {
|
||||||
if (accessMode.toLowerCase().indexOf('open') !== -1) {
|
if (accessMode.toLowerCase().indexOf('open') !== -1) {
|
||||||
return 'open';
|
return 'open';
|
||||||
|
|
Loading…
Reference in New Issue