Skip to content

Commit

Permalink
[desktop] hide rtl option for desktop app
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadushkin committed Nov 30, 2023
1 parent a5f1c3b commit 2727a4a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
6 changes: 6 additions & 0 deletions apps/common/main/lib/util/desktopinit.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ if ( window.AscDesktopEditor ) {
// window.desktop.themes = map_themes;
}
}

if ( window.RendererProcessVariable.rtl != undefined ) {
window.native = {
rtl: window.RendererProcessVariable.rtl == "yes" || window.RendererProcessVariable.rtl == "true"
};
}
}

window.desktop.execCommand('webapps:entry', (window.features && JSON.stringify(window.features)) || '');
Expand Down
12 changes: 11 additions & 1 deletion apps/common/main/lib/util/htmlutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ if (!lang) {
lang = lang ? lang[1] : '';
}
lang && (lang = lang.split(/[\-\_]/)[0].toLowerCase());
if ( checkLocalStorage && localStorage.getItem("ui-rtl") === '1' || (!checkLocalStorage || localStorage.getItem("ui-rtl") === null) && lang==='ar') {

let ui_rtl = false;
if ( window.native && window.native.rtl !== undefined ) {
ui_rtl = window.native.rtl;
} else {
if ( checkLocalStorage && localStorage.getItem("ui-rtl") !== null )
ui_rtl = localStorage.getItem("ui-rtl") === '1';
else ui_rtl = lang === 'ar';
}

if ( ui_rtl ) {
document.body.setAttribute('dir', 'rtl');
document.body.classList.add('rtl');
}
Expand Down
2 changes: 1 addition & 1 deletion apps/documenteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ define([
this.appOptions.canFeatureComparison = true;
this.appOptions.canFeatureContentControl = true;
this.appOptions.canFeatureForms = !!this.api.asc_isSupportFeature("forms");
this.appOptions.uiRtl = true;
this.appOptions.uiRtl = !Common.Controllers.Desktop.isActive();
this.appOptions.disableNetworkFunctionality = !!(window["AscDesktopEditor"] && window["AscDesktopEditor"]["isSupportNetworkFunctionality"] && false === window["AscDesktopEditor"]["isSupportNetworkFunctionality"]());
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));

Expand Down
2 changes: 1 addition & 1 deletion apps/pdfeditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ define([
this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage;
this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings;
this.appOptions.compatibleFeatures = true;
this.appOptions.uiRtl = true;
this.appOptions.uiRtl = !Common.Controllers.Desktop.isActive();

this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));

Expand Down
2 changes: 1 addition & 1 deletion apps/presentationeditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ define([
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings;
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
this.appOptions.uiRtl = true;
this.appOptions.uiRtl = !Common.Controllers.Desktop.isActive();

this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this));

Expand Down
2 changes: 1 addition & 1 deletion apps/spreadsheeteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ define([
this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink;
this.appOptions.canFeaturePivot = true;
this.appOptions.canFeatureViews = true;
this.appOptions.uiRtl = true;
this.appOptions.uiRtl = !Common.Controllers.Desktop.isActive();
this.appOptions.canRequestReferenceData = this.editorConfig.canRequestReferenceData;
this.appOptions.canRequestOpen = this.editorConfig.canRequestOpen;
this.appOptions.canRequestReferenceSource = this.editorConfig.canRequestReferenceSource;
Expand Down

0 comments on commit 2727a4a

Please sign in to comment.