|
|
@ -9,17 +9,17 @@ const switchDirection = async (direction) => { |
|
|
|
// eslint-disable-next-line no-param-reassign
|
|
|
|
// eslint-disable-next-line no-param-reassign
|
|
|
|
direction = 'ltr'; |
|
|
|
direction = 'ltr'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let updatedLink; |
|
|
|
let updatedLink; |
|
|
|
Array.from(document.getElementsByTagName('link')) |
|
|
|
[...document.querySelectorAll('link[rel=stylesheet]')].forEach((link) => { |
|
|
|
.filter((link) => link.rel === 'stylesheet') |
|
|
|
if (link.title === direction && link.disabled) { |
|
|
|
.forEach((link) => { |
|
|
|
link.disabled = false; |
|
|
|
if (link.title === direction && link.disabled) { |
|
|
|
updatedLink = link; |
|
|
|
link.disabled = false; |
|
|
|
} else if (link.title !== direction && !link.disabled) { |
|
|
|
updatedLink = link; |
|
|
|
link.disabled = true; |
|
|
|
} else if (link.title !== direction && !link.disabled) { |
|
|
|
} |
|
|
|
link.disabled = true; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (updatedLink) { |
|
|
|
if (updatedLink) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
updatedLink.onload = () => { |
|
|
|
updatedLink.onload = () => { |
|
|
|