mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 16:58:47 +01:00
Fix RTL observer not working
This commit is contained in:
parent
78ca5bbc0b
commit
ff29e93b4f
1 changed files with 3 additions and 2 deletions
|
@ -4,12 +4,13 @@ let IS_RTL = false;
|
|||
const observer = new MutationObserver((mutations) => {
|
||||
mutations.forEach((mutation) => {
|
||||
if (mutation.type === 'attributes') {
|
||||
const { value } = mutation.target;
|
||||
if (value === 'rtl') {
|
||||
const { dir } = mutation.target;
|
||||
if (dir === 'rtl') {
|
||||
IS_RTL = true;
|
||||
} else {
|
||||
IS_RTL = false;
|
||||
}
|
||||
console.log({ IS_RTL });
|
||||
// Fire custom event 'dirchange' on document
|
||||
// document.dispatchEvent(new Event('dirchange'));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue