From 00e64ee83da38d7d137d921f65b2d46142adaaae Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 30 Nov 2023 07:28:46 +0100 Subject: [PATCH] Removed duplicate function --- Frontend/src/components/xml/XmlInputFieldComponent.vue | 9 ++------- .../src/components/xml/XmlTabbedInputComponent.vue | 10 ++-------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Frontend/src/components/xml/XmlInputFieldComponent.vue b/Frontend/src/components/xml/XmlInputFieldComponent.vue index 42703b7..a613568 100644 --- a/Frontend/src/components/xml/XmlInputFieldComponent.vue +++ b/Frontend/src/components/xml/XmlInputFieldComponent.vue @@ -19,11 +19,6 @@ function sendValue() { emit('update', data.value) } -function sendNewValue(newValue : string) { - data.value = newValue - emit('update', data.value) -} - function updateData(newData: string) { data.value = newData inputFile.value.value = '' @@ -46,7 +41,7 @@ function readFile(file : any) { reader.onloadend = () => { var result = reader.result?.toString() if (typeof result == "string") - sendNewValue(result) + updateData(result) } reader.readAsText(file.target.files[0]) @@ -68,6 +63,6 @@ function readFile(file : any) { - + \ No newline at end of file diff --git a/Frontend/src/components/xml/XmlTabbedInputComponent.vue b/Frontend/src/components/xml/XmlTabbedInputComponent.vue index daabb14..7da2527 100644 --- a/Frontend/src/components/xml/XmlTabbedInputComponent.vue +++ b/Frontend/src/components/xml/XmlTabbedInputComponent.vue @@ -33,12 +33,6 @@ function sendValue() { emit('update', tabs.value); } -function sendNewValue(newValue : string) { - data.value = newValue; - tabs.value.at(findIndexWithID(activeTabId.value))!.data = newValue; - emit('update', tabs.value); -} - function updateData(newData: string) { data.value = newData; tabs.value.at(findIndexWithID(activeTabId.value))!.data = newData; @@ -62,7 +56,7 @@ function readFile(file : any) { reader.onloadend = () => { var result = reader.result!.toString(); console.log(result); - sendNewValue(result); + updateData(result); } reader.readAsText(file.target.files[0]); @@ -144,6 +138,6 @@ function findIndexWithID(id : number) : number { - + \ No newline at end of file