Skip to content

Commit

Permalink
[PE SSE mobile] Refactoring lock rtl options
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyEzhin committed Apr 25, 2024
1 parent aea3758 commit 980f950
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion apps/common/mobile/utils/htmlutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function isLocalStorageAvailable() {
if(isLocalStorageAvailable()) {
let modeDirection = localStorage.getItem('mobile-mode-direction');

if( !modeDirection && Common.Locale.isCurrentLangRtl ) {
if(!modeDirection && Common.Locale.isCurrentLangRtl) {
localStorage.setItem('mobile-mode-direction', 'rtl');
modeDirection = 'rtl';
}
Expand Down
9 changes: 4 additions & 5 deletions apps/presentationeditor/mobile/src/index_dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<!-- built styles file will be auto injected -->
</head>
<body>
<script>
window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
</script>
<% if ( htmlWebpackPlugin.options.skeleton.htmlscript ) { %>
<script>
window.asceditor = 'slide';
Expand Down Expand Up @@ -76,13 +79,9 @@
return urlParams;
}

window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
let params = getUrlParams(),
lang = (params["lang"] || window.Common.Locale.defaultLang).split(/[\-\_]/)[0];

let params = getUrlParams();
window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"];
window.Common.Locale.currentLang = lang;
</script>

<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const PageApplicationSettings = props => {

// set mode
const appOptions = props.storeAppOptions;
const currentLang = appOptions.lang;
const isRtlLang = currentLang && /^(ar)$/i.test(currentLang);
const storeThemes = props.storeThemes;
const colorTheme = storeThemes.colorTheme;
const themes = storeThemes.themes;
Expand All @@ -29,7 +27,6 @@ const PageApplicationSettings = props => {
const _isEdit = appOptions.isEdit;
// const _isShowMacros = (!appOptions.isDisconnected && appOptions.customization) ? appOptions.customization.macros !== false : true;


return (
<Page>
<Navbar title={_t.textApplicationSettings} backLink={_t.textBack} />
Expand Down Expand Up @@ -68,7 +65,7 @@ const PageApplicationSettings = props => {
setMacrosSettings: props.setMacrosSettings
}}></ListItem>
</List>
{isRtlLang &&
{Common.Locale.isCurrentLangRtl &&
<>
<List>
<ListItem>
Expand Down
9 changes: 4 additions & 5 deletions apps/spreadsheeteditor/mobile/src/index_dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<!-- built styles file will be auto injected -->
</head>
<body>
<script>
window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
</script>
<% if ( htmlWebpackPlugin.options.skeleton.htmlscript ) { %>
<script>
window.asceditor = 'cell';
Expand Down Expand Up @@ -76,13 +79,9 @@
return urlParams;
}

window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
let params = getUrlParams(),
lang = (params["lang"] || window.Common.Locale.defaultLang).split(/[\-\_]/)[0];

let params = getUrlParams()
window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"];
window.Common.Locale.currentLang = lang;
</script>

<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ const PageApplicationSettings = props => {
// set mode
const appOptions = props.storeAppOptions;
const storeThemes = props.storeThemes;
const currentLang = appOptions.lang;
const isRtlLang = currentLang && /^(ar)$/i.test(currentLang);
const colorTheme = storeThemes.colorTheme;
const themes = storeThemes.themes;
const isConfigSelectTheme = storeThemes.isConfigSelectTheme;
Expand Down Expand Up @@ -111,7 +109,7 @@ const PageApplicationSettings = props => {
onChangeMacrosSettings: props.onChangeMacrosSettings
}}></ListItem>
</List>
{isRtlLang &&
{Common.Locale.isCurrentLangRtl &&
<>
<List>
<ListItem>
Expand Down

0 comments on commit 980f950

Please sign in to comment.