[all] function to check 'isRtl' flag

This commit is contained in:
Maxim Kadushkin 2022-09-12 22:51:29 +03:00
parent 7146701873
commit 15ce921714
2 changed files with 15 additions and 1 deletions

View file

@ -167,10 +167,15 @@ Common.Locale = new(function() {
} else require(polyfills, _requireLang); } else require(polyfills, _requireLang);
} else _requireLang(); } else _requireLang();
const _isCurrentRtl = function () {
return false;
};
return { return {
apply: _applyLocalization, apply: _applyLocalization,
get: _get, get: _get,
getCurrentLanguage: _getCurrentLanguage getCurrentLanguage: _getCurrentLanguage,
isCurrentLanguageRtl: _isCurrentRtl
}; };
})(); })();

View file

@ -1092,3 +1092,12 @@ Common.Utils.getKeyByValue = function(obj, value) {
} }
} }
}; };
Common.UI.isRTL = function () {
if ( window.isrtl == undefined ) {
window.isrtl = Common.localStorage.itemExists('ui-rtl') ?
Common.localStorage.getBool("ui-rtl") : Common.Locale.isCurrentLanguageRtl();
}
return window.isrtl;
};