1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-08-20 13:21:25 +02:00

fix button state

This commit is contained in:
Sébastien Thuret 2021-10-08 19:12:56 +02:00
parent f5bc2bc3f5
commit 5dcb55cad9
No known key found for this signature in database
GPG Key ID: 4742E2D66933BB08

View File

@ -272,7 +272,8 @@
loadingTranslation: false,
inputText: "",
inputTextareaHeight: 250,
translatedText: "",
savedTanslatedText: "",
translatedText: "",
output: "",
charactersLimit: -1,
@ -392,7 +393,7 @@
return htmlRegex.test(this.inputText);
},
canSendSuggestion() {
return this.translatedText.trim() !== "" && this.translatedText !== this.inputText;
return this.translatedText.trim() !== "" && this.translatedText !== this.savedTanslatedText;
}
},
filters: {
@ -496,10 +497,13 @@
},
suggestTranslation: function(e) {
e.preventDefault();
this.savedTanslatedText = this.translatedText
this.isSuggesting = true;
},
closeSuggestTranslation: function(e) {
this.translatedText = this.savedTanslatedText
e.preventDefault();
this.isSuggesting = false;