|
|
@ -9,10 +9,9 @@ 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') |
|
|
|
|
|
|
|
.forEach((link) => { |
|
|
|
|
|
|
|
if (link.title === direction && link.disabled) { |
|
|
|
if (link.title === direction && link.disabled) { |
|
|
|
link.disabled = false; |
|
|
|
link.disabled = false; |
|
|
|
updatedLink = link; |
|
|
|
updatedLink = link; |
|
|
@ -20,6 +19,7 @@ const switchDirection = async (direction) => { |
|
|
|
link.disabled = true; |
|
|
|
link.disabled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (updatedLink) { |
|
|
|
if (updatedLink) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
updatedLink.onload = () => { |
|
|
|
updatedLink.onload = () => { |
|
|
|