mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-24 17:01:00 +00:00
Set selected attributes
This commit is contained in:
parent
cc16f7ecec
commit
dcaf125d8a
1 changed files with 14 additions and 2 deletions
|
@ -336,6 +336,18 @@
|
|||
this.inputText = this.inputText.substring(0, this.charactersLimit);
|
||||
}
|
||||
|
||||
// Update "selected" attribute (to overcome a vue.js limitation)
|
||||
// but properly display checkmarks on supported browsers
|
||||
for (var i = 0; i < this.$refs.sourceLangDropdown.children.length; i++){
|
||||
var el = this.$refs.sourceLangDropdown.children[i];
|
||||
if (el.value === this.sourceLang) el.setAttribute('selected', '');
|
||||
else el.removeAttribute('selected');
|
||||
}
|
||||
for (var i = 0; i < this.$refs.targetLangDropdown.children.length; i++){
|
||||
var el = this.$refs.targetLangDropdown.children[i];
|
||||
if (el.value === this.targetLang) el.setAttribute('selected', '');
|
||||
else el.removeAttribute('selected');
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
requestCode: function(){
|
||||
|
|
Loading…
Reference in a new issue