Skip to content

Commit

Permalink
[DE mobile] Fix Bug 65783
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyEzhin committed Apr 9, 2024
1 parent 28a9a6d commit 3f14304
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apps/common/mobile/resources/less/colors-table.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--brand-word: #446995;
--brand-cell: #40865C;
--brand-slide: #BE664F;
--brand-form: #BE664F;
--brand-form: #AA5252;
--brand-primary: #3880BE;
--brand-secondary: #ED7309;
--brand-text-on-brand: #FFF;
Expand Down
9 changes: 7 additions & 2 deletions apps/documenteditor/mobile/src/controller/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ class MainController extends Component {
}

let type = data.doc ? /^(?:(pdf))$/.exec(data.doc.fileType) : false;

if (type && typeof type[1] === 'string') {
this.changeEditorBrandColorForPdf();
(this.permissions.fillForms===undefined) && (this.permissions.fillForms = (this.permissions.edit!==false));
this.permissions.edit = this.permissions.review = this.permissions.comment = false;
}
Expand All @@ -236,8 +238,6 @@ class MainController extends Component {
// Document Info

const storeDocumentInfo = this.props.storeDocumentInfo;
// this.document

storeDocumentInfo.setDataDoc(this.document);
storeDocumentInfo.setDocInfo(docInfo);

Expand Down Expand Up @@ -484,6 +484,11 @@ class MainController extends Component {
}
}

changeEditorBrandColorForPdf() {
const bodyElement = document.body;
bodyElement.style.setProperty('--brand-word', 'var(--brand-form)');
}

applyMode (appOptions) {
this.api.asc_enableKeyEvents(appOptions.isEdit);
this.api.asc_setViewMode(!appOptions.isEdit && !appOptions.isRestrictedEdit);
Expand Down
23 changes: 13 additions & 10 deletions apps/documenteditor/mobile/src/page/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ const MainPage = inject('storeDocumentInfo', 'users', 'storeAppOptions', 'storeV
const storeVersionHistory = props.storeVersionHistory;
const isVersionHistoryMode = storeVersionHistory.isVersionHistoryMode;
const storeDocumentInfo = props.storeDocumentInfo;
const docExt = storeDocumentInfo.dataDoc ? storeDocumentInfo.dataDoc.fileType : '';
const dataDoc = storeDocumentInfo.dataDoc;
const docExt = dataDoc?.fileType || '';
const isAvailableExt = docExt && docExt !== 'djvu' && docExt !== 'pdf' && docExt !== 'xps';
const storeToolbarSettings = props.storeToolbarSettings;
const isDisconnected = props.users.isDisconnected;
Expand Down Expand Up @@ -228,7 +229,7 @@ const MainPage = inject('storeDocumentInfo', 'users', 'storeAppOptions', 'storeV
};

return (
<Themes>
<Themes fileType={docExt}>
<MainContext.Provider value={{
openOptions: handleClickToOpenOptions,
closeOptions: handleOptionsViewClosed,
Expand All @@ -248,14 +249,16 @@ const MainPage = inject('storeDocumentInfo', 'users', 'storeAppOptions', 'storeV
}
</div>
}
<Subnavbar>
<ToolbarController
openOptions={handleClickToOpenOptions}
closeOptions={handleOptionsViewClosed}
isOpenModal={state.isOpenModal}
/>
<Search useSuspense={false}/>
</Subnavbar>
{dataDoc &&
<Subnavbar>
<ToolbarController
openOptions={handleClickToOpenOptions}
closeOptions={handleOptionsViewClosed}
isOpenModal={state.isOpenModal}
/>
<Search useSuspense={false}/>
</Subnavbar>
}
</Navbar>
<View id="editor_sdk"></View>
{isShowPlaceholder ?
Expand Down

0 comments on commit 3f14304

Please sign in to comment.