fix(dashboard): fix temperature chart for IE

This commit is contained in:
KostyaDanovsky 2017-09-20 13:04:14 +03:00
parent a0fbdf3636
commit ada2666ea4
4 changed files with 18 additions and 7 deletions

View file

@ -1,3 +1,5 @@
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsAQMAAABDsxw2AAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAACJJREFUaN7twTEBAAAAwiD7pzbFPmAAAAAAAAAAAAAAAGQOLbQAAU3zwM4AAAAASUVORK5CYII=">
<div class="svg-container">
<svg #svgRoot xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
[attr.viewBox]="styles.viewBox" preserveAspectRatio="xMinYMin meet" (mousedown)="mouseDown($event)">

View file

@ -2,11 +2,18 @@
@import '~@nebular/theme/styles/global/bootstrap/hero-buttons';
@include nb-install-component() {
display: flex;
position: relative;
img {
width: 100%;
height: auto;
visibility: hidden;
}
.svg-container {
position: relative;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 2;

View file

@ -1,6 +1,5 @@
import {
Component, HostListener, ViewChild, ElementRef, Input, Output, EventEmitter, AfterViewInit, OnChanges,
ChangeDetectorRef,
} from '@angular/core';
const VIEW_BOX_SIZE = 300;
@ -76,14 +75,16 @@ export class TemperatureDraggerComponent implements AfterViewInit, OnChanges {
private isMouseDown = false;
private init = false;
constructor(private changeDetectorRef: ChangeDetectorRef) {
constructor() {
this.oldValue = this.value;
}
ngAfterViewInit(): void {
this.invalidate();
this.init = true;
this.changeDetectorRef.detectChanges();
// IE fix
setTimeout(() => {
this.invalidate();
this.init = true;
});
}
ngOnChanges(): void {

View file

@ -25,6 +25,7 @@
.slider-container {
display: flex;
flex: 1;
-ms-flex: 1 1 auto;
justify-content: center;
align-items: center;
}