mirror of
https://github.com/chsakell/aspnet-core-signalr-angular.git
synced 2025-12-22 17:27:48 +00:00
add feed indication
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user