From 76b0e8c01c099edce3166815e23a9a09532e3268 Mon Sep 17 00:00:00 2001 From: Hadi Charara Date: Fri, 8 Jul 2022 12:43:15 -0400 Subject: [PATCH] Cleaned up element dir detection funciton --- src/scripts/globalize.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/scripts/globalize.js b/src/scripts/globalize.js index f7da47d8e8..01e622f00f 100644 --- a/src/scripts/globalize.js +++ b/src/scripts/globalize.js @@ -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() {