mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-20 03:36:46 +00:00
Merge pull request #696 from GNS3/Activating-text-editing-in-ngZone.runOutsideAngular-to-avoid-'refreshing-effect'
Activating text editing in ngZone.runOutsideAngular to avoid 'refresh effect'
This commit is contained in:
commit
7ddc75b2ff
@ -1,4 +1,4 @@
|
||||
import { Component, ViewChild, ElementRef, OnInit, Input, EventEmitter, OnDestroy, Renderer2 } from '@angular/core';
|
||||
import { Component, ViewChild, ElementRef, OnInit, Input, EventEmitter, OnDestroy, Renderer2, NgZone } from '@angular/core';
|
||||
import { DrawingsEventSource } from '../../events/drawings-event-source';
|
||||
import { TextAddedDataEvent, TextEditedDataEvent } from '../../events/event-source';
|
||||
import { ToolsService } from '../../../services/tools.service';
|
||||
@ -55,7 +55,8 @@ export class TextEditorComponent implements OnInit, OnDestroy {
|
||||
private linksDataSource: LinksDataSource,
|
||||
private nodesDataSource: NodesDataSource,
|
||||
private selectionManager: SelectionManager,
|
||||
private fontFixer: FontFixer
|
||||
private fontFixer: FontFixer,
|
||||
private ngZone: NgZone
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@ -63,8 +64,8 @@ export class TextEditorComponent implements OnInit, OnDestroy {
|
||||
isActive ? this.activateTextAdding() : this.deactivateTextAdding();
|
||||
});
|
||||
|
||||
this.activateTextEditingForDrawings();
|
||||
this.activateTextEditingForNodeLabels();
|
||||
this.ngZone.runOutsideAngular(this.activateTextEditingForDrawings.bind(this));
|
||||
this.ngZone.runOutsideAngular(this.activateTextEditingForNodeLabels.bind(this));
|
||||
}
|
||||
|
||||
activateTextAdding() {
|
||||
|
Loading…
Reference in New Issue
Block a user