mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-12 13:33:16 +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 { 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