mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 05:30:15 +08:00
[DE mobile] Correct force edit mode
This commit is contained in:
@ -70,29 +70,18 @@ class ThemesController extends React.Component {
|
||||
this.checkSystemDarkTheme = this.checkSystemDarkTheme.bind(this);
|
||||
}
|
||||
|
||||
turnOffViewerMode() {
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
appOptions.changeViewerMode(false);
|
||||
}
|
||||
|
||||
init() {
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
const editorConfig = window.native?.editorConfig;
|
||||
const editorType = window.editorType;
|
||||
const obj = LocalStorage.getItem("ui-theme");
|
||||
|
||||
let theme = this.themes_map.light;
|
||||
|
||||
if(editorConfig) {
|
||||
const isForceEdit = editorConfig.forceedit;
|
||||
const themeConfig = editorConfig.theme;
|
||||
const typeTheme = themeConfig ? themeConfig.type : null;
|
||||
const isSelectTheme = themeConfig ? themeConfig.select : null;
|
||||
|
||||
// if(isForceEdit && editorType === 'de') {
|
||||
// this.turnOffViewerMode();
|
||||
// }
|
||||
|
||||
if(isSelectTheme) {
|
||||
if(!!obj) {
|
||||
theme = this.setClientTheme(theme, obj);
|
||||
|
||||
@ -220,12 +220,17 @@ class MainController extends Component {
|
||||
|
||||
this.applyMode(storeAppOptions);
|
||||
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
const editorConfig = window.native?.editorConfig;
|
||||
const isForceEdit = editorConfig?.forceedit;
|
||||
const storeDocumentInfo = this.props.storeDocumentInfo;
|
||||
const dataDoc = storeDocumentInfo.dataDoc;
|
||||
const isExtRestriction = dataDoc.fileType !== 'oform';
|
||||
|
||||
if(isExtRestriction) {
|
||||
if(isExtRestriction && !isForceEdit) {
|
||||
this.api.asc_addRestriction(Asc.c_oAscRestrictionType.View);
|
||||
} else if(isExtRestriction && isForceEdit) {
|
||||
appOptions.changeViewerMode(false);
|
||||
} else {
|
||||
this.api.asc_addRestriction(Asc.c_oAscRestrictionType.OnlyForms)
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||
|
||||
f7.popover.close('.document-menu.modal-in', false);
|
||||
|
||||
appOptions.changeViewerMode();
|
||||
appOptions.changeViewerMode(true);
|
||||
api.asc_addRestriction(Asc.c_oAscRestrictionType.View);
|
||||
}
|
||||
|
||||
|
||||
@ -140,8 +140,9 @@ class ApplicationSettingsController extends Component {
|
||||
|
||||
LocalStorage.setItem("ui-theme", JSON.stringify(theme));
|
||||
appOptions.setColorTheme(theme);
|
||||
} else if(this.checkSystemDarkTheme()) {
|
||||
theme = themesMap.dark;
|
||||
} else {
|
||||
const isSystemDarkTheme = this.checkSystemDarkTheme();
|
||||
if(isSystemDarkTheme) theme = themesMap.dark;
|
||||
|
||||
LocalStorage.setItem("ui-theme", JSON.stringify(themesMap["system"]));
|
||||
appOptions.setColorTheme(themesMap["system"]);
|
||||
|
||||
@ -28,7 +28,7 @@ class ProtectionDocumentController extends React.Component {
|
||||
appOptions.setTypeProtection(typeProtection);
|
||||
|
||||
if(typeProtection !== Asc.c_oAscEDocProtect.TrackedChanges && !isViewer) {
|
||||
appOptions.changeViewerMode();
|
||||
appOptions.changeViewerMode(true);
|
||||
}
|
||||
|
||||
protection.asc_setEditType(typeProtection);
|
||||
|
||||
@ -116,7 +116,7 @@ class MainPage extends Component {
|
||||
f7.popover.close('.document-menu.modal-in', false);
|
||||
f7.navbar.show('.main-navbar', false);
|
||||
|
||||
appOptions.changeViewerMode();
|
||||
appOptions.changeViewerMode(false);
|
||||
api.asc_removeRestriction(Asc.c_oAscRestrictionType.View)
|
||||
api.asc_addRestriction(Asc.c_oAscRestrictionType.None);
|
||||
};
|
||||
|
||||
@ -62,6 +62,7 @@ export class storeAppOptions {
|
||||
type: 'system'
|
||||
}
|
||||
};
|
||||
|
||||
isEdit = false;
|
||||
|
||||
isConfigSelectTheme = true;
|
||||
@ -96,8 +97,8 @@ export class storeAppOptions {
|
||||
|
||||
|
||||
isViewer = true;
|
||||
changeViewerMode() {
|
||||
this.isViewer = !this.isViewer;
|
||||
changeViewerMode(value) {
|
||||
this.isViewer = value;
|
||||
}
|
||||
|
||||
canViewComments = false;
|
||||
|
||||
Reference in New Issue
Block a user