forked from mirrors/LibreTranslate
fix button state
This commit is contained in:
parent
f5bc2bc3f5
commit
5dcb55cad9
1 changed files with 6 additions and 2 deletions
|
@ -272,7 +272,8 @@
|
||||||
loadingTranslation: false,
|
loadingTranslation: false,
|
||||||
inputText: "",
|
inputText: "",
|
||||||
inputTextareaHeight: 250,
|
inputTextareaHeight: 250,
|
||||||
translatedText: "",
|
savedTanslatedText: "",
|
||||||
|
translatedText: "",
|
||||||
output: "",
|
output: "",
|
||||||
charactersLimit: -1,
|
charactersLimit: -1,
|
||||||
|
|
||||||
|
@ -392,7 +393,7 @@
|
||||||
return htmlRegex.test(this.inputText);
|
return htmlRegex.test(this.inputText);
|
||||||
},
|
},
|
||||||
canSendSuggestion() {
|
canSendSuggestion() {
|
||||||
return this.translatedText.trim() !== "" && this.translatedText !== this.inputText;
|
return this.translatedText.trim() !== "" && this.translatedText !== this.savedTanslatedText;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
@ -496,10 +497,13 @@
|
||||||
},
|
},
|
||||||
suggestTranslation: function(e) {
|
suggestTranslation: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
this.savedTanslatedText = this.translatedText
|
||||||
|
|
||||||
this.isSuggesting = true;
|
this.isSuggesting = true;
|
||||||
},
|
},
|
||||||
closeSuggestTranslation: function(e) {
|
closeSuggestTranslation: function(e) {
|
||||||
|
this.translatedText = this.savedTanslatedText
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
this.isSuggesting = false;
|
this.isSuggesting = false;
|
||||||
|
|
Loading…
Reference in a new issue