scrolling actions from footer are now working

This commit is contained in:
Nicolas Constant 2018-09-12 00:03:36 -04:00
parent c31f4479c0
commit afe9578deb
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
3 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<div class="main-display flexcroll">
<div class="main-display__stream-column" *ngFor="let s of streams">
<app-stream [stream]="s"></app-stream>
<app-stream [stream]="s" #stream></app-stream>
</div>
</div>

View File

@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy } from "@angular/core";
import { Component, OnInit, OnDestroy, ViewChild, QueryList, ViewChildren, ElementRef } from "@angular/core";
import { Stream } from "../../models/stream.models";
import { Observable, Subscription } from "rxjs";
@ -49,8 +49,17 @@ export class StreamsMainDisplayComponent implements OnInit, OnDestroy {
this.columnSelectedSub.unsubscribe();
}
@ViewChildren('stream', { read: ElementRef }) public streamsElementRef: QueryList<ElementRef>;;
private focusOnColumn(columnIndex: number): void {
console.warn(`col selected: ${columnIndex}`);
if (columnIndex > -1) {
console.warn(this.streamsElementRef);
setTimeout(() => {
this.streamsElementRef.toArray()[columnIndex].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'end', inline: 'start' });
});
}
}
}

View File

@ -6,7 +6,7 @@ import { AccountWrapper } from '../models/account.models';
export class NavigationService {
openColumnEditorSubject = new BehaviorSubject<AccountWrapper>(null);
columnSelectedSubject = new BehaviorSubject<number>(null);
columnSelectedSubject = new BehaviorSubject<number>(-1);
constructor() { }