commit 5f61ffba2801ccc80f1c37660902d6a28170c5e0
parent 9fbbbad4e4fd73a2ecab9b3b39a46634f58d4732
Author: MTRNord <mtrnord1@gmail.com>
Date: Sun, 18 Mar 2018 17:36:32 +0100
Check if ScrollView helps
Diffstat:
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/app/tweet-list/tweet-list.component.html b/src/app/tweet-list/tweet-list.component.html
@@ -1,4 +1,4 @@
-<div class="grid">
+<div #container class="grid">
<article *ngFor="let item of data; let i = index">
<!--<a href="{{item.tweet_link}}">-->
<!--Retweet Badge-->
diff --git a/src/app/tweet-list/tweet-list.component.ts b/src/app/tweet-list/tweet-list.component.ts
@@ -1,4 +1,4 @@
-import {Component, Inject, Input, OnInit} from '@angular/core';
+import {Component, ElementRef, Inject, Input, OnInit, ViewChild} from '@angular/core';
import * as Raven from 'raven-js';
import {ApiService, TweetsEntity} from '../api.service';
import {Observable} from 'rxjs/Observable';
@@ -23,6 +23,9 @@ export class TweetListComponent implements OnInit {
@Input() uuid;
data: (TweetsEntity)[];
+ @ViewChild('container')
+ private container: ElementRef;
+
constructor(private apiService: ApiService, private toastr: ToastrService, private pageScrollService: PageScrollService, @Inject(DOCUMENT) private document: any) {
Raven.captureBreadcrumb({
message: 'Showing Paper',
@@ -35,7 +38,7 @@ export class TweetListComponent implements OnInit {
public goTo(anchor: string): void {
console.log(anchor);
- const pageScrollInstance: PageScrollInstance = PageScrollInstance.simpleInstance(this.document, anchor);
+ const pageScrollInstance: PageScrollInstance = PageScrollInstance.newInstance({document: this.document, scrollTarget: anchor, scrollingViews: [this.container.nativeElement]});
this.pageScrollService.start(pageScrollInstance);
}