mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-06-25 18:40:59 +00:00
Fix suggestions, move all sqlite databases to db
This commit is contained in:
parent
5a2e0fe656
commit
282737519c
5 changed files with 27 additions and 5 deletions
|
@ -88,6 +88,8 @@ document.addEventListener('DOMContentLoaded', function(){
|
|||
langsRequest.send();
|
||||
},
|
||||
updated: function(){
|
||||
if (this.isSuggesting) return;
|
||||
|
||||
M.FormSelect.init(this.$refs.sourceLangDropdown);
|
||||
M.FormSelect.init(this.$refs.targetLangDropdown);
|
||||
|
||||
|
@ -283,11 +285,14 @@ document.addEventListener('DOMContentLoaded', function(){
|
|||
this.savedTanslatedText = this.translatedText
|
||||
|
||||
this.isSuggesting = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.translatedTextarea.focus();
|
||||
});
|
||||
},
|
||||
closeSuggestTranslation: function(e) {
|
||||
if(this.isSuggesting) {
|
||||
e.preventDefault();
|
||||
this.translatedText = this.savedTanslatedText
|
||||
// this.translatedText = this.savedTanslatedText
|
||||
}
|
||||
|
||||
this.isSuggesting = false;
|
||||
|
@ -312,7 +317,7 @@ document.addEventListener('DOMContentLoaded', function(){
|
|||
try{
|
||||
var res = JSON.parse(this.response);
|
||||
if (res.success){
|
||||
M.toast({html: 'Thanks for your correction.'})
|
||||
M.toast({html: 'Thanks for your correction. Note the suggestion will not take effect right away.'})
|
||||
self.closeSuggestTranslation(e)
|
||||
}else{
|
||||
throw new Error(res.error || "Unknown error");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue