commit b9fe4f96f90bf2ce18d8bad3ed9e6f6dd8da2915
parent 64ec970ff67e4feebbae0db995bd0b097e96a379
Author: MTRNord <mtrnord1@gmail.com>
Date: Sun, 18 Mar 2018 22:04:19 +0100
Actually I dont need a reload at all and a scroll
Diffstat:
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/app/tweet-list/tweet-list.component.html b/src/app/tweet-list/tweet-list.component.html
@@ -13,7 +13,7 @@
</a>
<!-- lightbox container hidden with CSS -->
- <a (click)="reload()" class="lightbox" #lightboxItem>
+ <a (click)="hide(lightboxItem)" class="lightbox" #lightboxItem>
<img *ngIf="item.image_urls && item.image_urls[0]" [src]="item.image_urls[0]">
</a>
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, ElementRef, Input, OnInit, QueryList} from '@angular/core';
+import {Component, Input, OnInit} from '@angular/core';
import * as Raven from 'raven-js';
import {ApiService, TweetsEntity} from '../api.service';
import {Observable} from 'rxjs/Observable';
@@ -38,15 +38,12 @@ export class TweetListComponent implements OnInit {
});
}
- reload() {
- window.location.reload();
+ hide(el) {
+ el.style.display = '';
}
goTo(el): void {
- console.log(el)
- console.log(typeof el)
el.style.display = 'block';
- el.scrollIntoView();
}
ngOnInit() {