Commit 0448ef30 authored by 李维's avatar 李维

Bug fix

parent bc8e89a6
import { Component, ElementRef, EventEmitter, HostListener, Input, OnChanges, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'; import { Component, ElementRef, EventEmitter, HostListener, Input, OnChanges, OnDestroy, OnInit, Output, ViewChild, ChangeDetectorRef } from '@angular/core';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { debounceTime } from 'rxjs/operators'; import { debounceTime } from 'rxjs/operators';
import { EditorItem, HotZoneImageItem, Label, MySprite } from './Unit'; import { EditorItem, HotZoneImageItem, Label, MySprite } from './Unit';
...@@ -78,7 +78,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy { ...@@ -78,7 +78,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy {
hotZoneChanged = false; hotZoneChanged = false;
scale = 1; scale = 1;
constructor(private el: ElementRef) { constructor(private el: ElementRef, private changeDetectorRef: ChangeDetectorRef) {
} }
...@@ -360,6 +360,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy { ...@@ -360,6 +360,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy {
this.changeCurItem(item); this.changeCurItem(item);
} }
this.hotZoneChanged = true; this.hotZoneChanged = true;
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
return; return;
} }
...@@ -662,6 +664,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy { ...@@ -662,6 +664,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy {
} }
this.save.emit({ bgItem, hotZoneItemArr }); this.save.emit({ bgItem, hotZoneItemArr });
this.hotZoneChanged = false; this.hotZoneChanged = false;
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
} }
getURL(url: string) { getURL(url: string) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment