Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private resetDiagramRenaming(): void {
// Remove all used event listeners.
document.removeEventListener('click', this.onRenameDiagramClickEvent);
document.removeEventListener('keyup', this.onRenameDiagramKeyupEvent);
// Reset input field.
this.diagramRenamingState.currentDiagramInputValue = '';
this.renameDiagramInput.value = '';
// Hide input field.
this.currentlyRenamingDiagram = null;
ValidationRules.off(this.diagramRenamingState);
}
private resetDiagramCreation(): void {
// Remove all used event listeners.
document.removeEventListener('click', this.onCreateNewDiagramClickEvent);
document.removeEventListener('keyup', this.onCreateNewDiagramKeyupEvent);
// Reset input field.
this.diagramCreationState.currentDiagramInputValue = '';
this.createNewDiagramInput.value = '';
// Hide input field.
this.diagramCreationState.isCreateDiagramInputShown = false;
ValidationRules.off(this.diagramCreationState);
}
private _resetDiagramCreation(solution: IViewModelSolution): void {
// Remove all used event listeners.
solution.documentEventHandlers.forEach((eventHandler: (event: any) => any, eventName: string): void => {
document.removeEventListener(eventName, eventHandler);
});
solution.documentEventHandlers = new Map();
// Reset input field.
solution.currentDiagramInputValue = '';
solution.createNewDiagramInput.value = '';
// Hide input field.
solution.isCreateDiagramInputShown = false;
ValidationRules.off(solution);
}