Cleaned up element dir detection funciton

This commit is contained in:
Hadi Charara 2022-07-08 12:43:15 -04:00
parent d719ee6a07
commit 76b0e8c01c

View file

@ -68,13 +68,10 @@ import { currentSettings as userSettings } from './settings/userSettings';
}
export function getElementIsRTL(element) {
let elementIsRTL = false;
if (window.getComputedStyle) { // all browsers
elementIsRTL = window.getComputedStyle(element, null).getPropertyValue('direction') == 'rtl';
} else {
elementIsRTL = element.currentStyle.direction == 'rtl'; // IE5-8
return window.getComputedStyle(element, null).getPropertyValue('direction') == 'rtl';
}
return elementIsRTL;
return element.currentStyle.direction == 'rtl';
}
export function updateCurrentCulture() {