mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-01 23:10:47 +00:00
Activating text editing in ngZone.runOutsideAngular to avoid 'refreshing effect'
This commit is contained in:
parent
e11281ddf6
commit
d8a8af306e
@ -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 { DrawingsEventSource } from '../../events/drawings-event-source';
|
||||||
import { TextAddedDataEvent, TextEditedDataEvent } from '../../events/event-source';
|
import { TextAddedDataEvent, TextEditedDataEvent } from '../../events/event-source';
|
||||||
import { ToolsService } from '../../../services/tools.service';
|
import { ToolsService } from '../../../services/tools.service';
|
||||||
@ -55,7 +55,8 @@ export class TextEditorComponent implements OnInit, OnDestroy {
|
|||||||
private linksDataSource: LinksDataSource,
|
private linksDataSource: LinksDataSource,
|
||||||
private nodesDataSource: NodesDataSource,
|
private nodesDataSource: NodesDataSource,
|
||||||
private selectionManager: SelectionManager,
|
private selectionManager: SelectionManager,
|
||||||
private fontFixer: FontFixer
|
private fontFixer: FontFixer,
|
||||||
|
private ngZone: NgZone
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -63,8 +64,8 @@ export class TextEditorComponent implements OnInit, OnDestroy {
|
|||||||
isActive ? this.activateTextAdding() : this.deactivateTextAdding();
|
isActive ? this.activateTextAdding() : this.deactivateTextAdding();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.activateTextEditingForDrawings();
|
this.ngZone.runOutsideAngular(this.activateTextEditingForDrawings.bind(this));
|
||||||
this.activateTextEditingForNodeLabels();
|
this.ngZone.runOutsideAngular(this.activateTextEditingForNodeLabels.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
activateTextAdding() {
|
activateTextAdding() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user