mirror of
https://github.com/chsakell/aspnet-core-signalr-angular.git
synced 2025-12-22 09:17:47 +00:00
fix highlight directive
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="chat-table">
|
||||
<table class="table table-striped">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="feed-table">
|
||||
<table class="table table-striped">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
|
||||
@@ -5,17 +5,14 @@ import { Directive, ElementRef, HostListener, Input, Renderer } from '@angular/c
|
||||
})
|
||||
export class HighlightDirective {
|
||||
constructor(private el: ElementRef, private renderer: Renderer) {
|
||||
this.renderer.setElementClass(this.el.nativeElement, 'feed-highlight', true);
|
||||
let self = this;
|
||||
self.renderer.setElementClass(this.el.nativeElement, 'feed-highlight', true);
|
||||
setTimeout(function() {
|
||||
console.log('removing..');
|
||||
self.renderer.setElementClass(self.el.nativeElement,'feed-highlight-light', true);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
@HostListener('mouseenter') onMouseEnter() {
|
||||
this.highlight('white');
|
||||
}
|
||||
|
||||
@HostListener('mouseleave') onMouseLeave() {
|
||||
this.highlight(null);
|
||||
}
|
||||
|
||||
private highlight(color: string) {
|
||||
this.renderer.setElementStyle(this.el.nativeElement, 'backgroundColor', color);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,16 @@ th, td {
|
||||
}
|
||||
|
||||
.feed-highlight {
|
||||
background-color: #eee;
|
||||
background-color: #a94442;
|
||||
-webkit-transition: background-color 2000ms linear;
|
||||
-moz-transition: background-color 2000ms linear;
|
||||
-o-transition: background-color 2000ms linear;
|
||||
-ms-transition: background-color 2000ms linear;
|
||||
transition: background-color 2000ms linear;
|
||||
}
|
||||
|
||||
.feed-highlight-light {
|
||||
background-color: white;
|
||||
-webkit-transition: background-color 2000ms linear;
|
||||
-moz-transition: background-color 2000ms linear;
|
||||
-o-transition: background-color 2000ms linear;
|
||||
|
||||
Reference in New Issue
Block a user