Skip to content

Commit 6a7aa4a

Browse files
authored
Update GTranslator.php
1 parent 6b1a9f7 commit 6a7aa4a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/GTranslator.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -620,12 +620,8 @@ public function addScript(){
620620
Init:function(){
621621
GTranslator.GoogleScript();
622622
if(null!=GTranslator.Current()){
623-
var formObj = document.getElementsByClassName('php-language-select');
624-
for(let i = 0, len = formObj.length; i < len; i++){
625-
if(formObj[i].value == GTranslator.Current()){
626-
formObj.options[i].selected = true;
627-
}
628-
}
623+
var selectElement = document.getElementsByClassName('php-language-select')[0];
624+
selectElement.value = GTranslator.Current();
629625
}
630626
}
631627
};";

0 commit comments

Comments
 (0)