#3 Fixed issue with sub and dub detection

This commit is contained in:
Serraniel 2020-08-06 21:18:34 +02:00
parent 3a09d5a2c9
commit 8fb9fdfcca
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

View file

@ -32,7 +32,9 @@ function updateLanguageDisplay(node) {
subCols.forEach(element => {
let langAttr = element.attributes['ng-hide'].value;
let lang = langAttr.substring(langAttr.indexOf(langPrefix) + langPrefix.length, langAttr.indexOf(subSuffix));
subs[lang] = element.ariaHidden;
if (element.ariaHidden) {
subs.push(lang);
}
});
// find dubs
@ -41,7 +43,7 @@ function updateLanguageDisplay(node) {
let langAttr = element.attributes['ng-hide'].value;
let lang = langAttr.substring(langAttr.indexOf(langPrefix) + langPrefix.length, langAttr.indexOf(dubSuffix));
if (element.ariaHidden) {
subs.push(lang);
dubs.push(lang);
}
});
@ -76,7 +78,7 @@ function updateLanguageDisplay(node) {
dubDiv.appendChild(dubIconDiv);
let japIcon = document.createElement('i');
japIcon.classList.add('flag flag-jp');
japIcon.classList.add('flag', 'flag-jp');
dubDiv.appendChild(japIcon);
colDiv.appendChild(dubDiv);