add feed indication

This commit is contained in:
chsakell
2016-12-06 16:36:04 +02:00
parent b947ed635f
commit 694cb912e8
3 changed files with 14 additions and 6 deletions

View File

@@ -6,11 +6,15 @@ import { Directive, ElementRef, HostListener, Input, Renderer } from '@angular/c
export class HighlightDirective {
constructor(private el: ElementRef, private renderer: Renderer) {
let self = this;
self.renderer.setElementClass(this.el.nativeElement, 'feed-highlight', true);
setTimeout(function() {
self.renderer.setElementClass(self.el.nativeElement,'feed-highlight-light', true);
}, 1000);
}
self.renderer.setElementClass(this.el.nativeElement, 'feed-highlight', true);
let horn = document.getElementById('horn');
horn.className += ' orange';
setTimeout(function () {
self.renderer.setElementClass(self.el.nativeElement, 'feed-highlight-light', true);
document.getElementById("horn").className = document.getElementById("horn").className.replace(/(?:^|\s)orange(?!\S)/g, '')
}, 1000);
}
private highlight(color: string) {
this.renderer.setElementStyle(this.el.nativeElement, 'backgroundColor', color);