mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
Refactoring
This commit is contained in:
@ -143,17 +143,17 @@ DE.ApplicationController = new(function(){
|
||||
}
|
||||
|
||||
function onEditorPermissions(params) {
|
||||
|
||||
var licType = params.asc_getLicenseType();
|
||||
appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
|
||||
appOptions.canFillForms = appOptions.canLicense && (permissions.fillForms===true) && (config.mode !== 'view');
|
||||
appOptions.canSubmitForms = appOptions.canLicense && (typeof (config.customization) == 'object') && !!config.customization.submitForm;
|
||||
appOptions.canBrandingExt = params.asc_getCanBranding();
|
||||
appOptions.isEdit = appOptions.canLicense && appOptions.canBrandingExt && (permissions.edit !== false) && (config.mode !== 'view');
|
||||
|
||||
api.asc_SetFastCollaborative(true);
|
||||
api.asc_setAutoSaveGap(1);
|
||||
|
||||
onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
|
||||
api.asc_setViewMode(!appOptions.isEdit);
|
||||
api.asc_LoadDocument();
|
||||
api.Resize();
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@ PE.ApplicationController = new(function(){
|
||||
config = {},
|
||||
docConfig = {},
|
||||
permissions = {},
|
||||
appOptions = {},
|
||||
created = false;
|
||||
|
||||
var LoadingDocument = -256;
|
||||
@ -138,8 +139,16 @@ PE.ApplicationController = new(function(){
|
||||
}
|
||||
|
||||
function onEditorPermissions(params) {
|
||||
var licType = params.asc_getLicenseType();
|
||||
appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
|
||||
appOptions.canBrandingExt = params.asc_getCanBranding();
|
||||
appOptions.isEdit = appOptions.canLicense && appOptions.canBrandingExt && (permissions.edit !== false) && (config.mode !== 'view');
|
||||
|
||||
api.asc_SetFastCollaborative(true);
|
||||
api.asc_setAutoSaveGap(1);
|
||||
|
||||
onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
api.asc_setViewMode(false);
|
||||
api.asc_setViewMode(!appOptions.isEdit);
|
||||
|
||||
api.asc_LoadDocument();
|
||||
api.Resize();
|
||||
|
||||
@ -36,6 +36,7 @@ SSE.ApplicationController = new(function(){
|
||||
config = {},
|
||||
docConfig = {},
|
||||
permissions = {},
|
||||
appOptions = {},
|
||||
maxPages = 0,
|
||||
created = false;
|
||||
|
||||
@ -169,10 +170,16 @@ SSE.ApplicationController = new(function(){
|
||||
}
|
||||
|
||||
function onEditorPermissions(params) {
|
||||
var licType = params.asc_getLicenseType();
|
||||
appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
|
||||
appOptions.canBrandingExt = params.asc_getCanBranding();
|
||||
appOptions.isEdit = appOptions.canLicense && appOptions.canBrandingExt && (permissions.edit !== false) && (config.mode !== 'view');
|
||||
|
||||
api.asc_SetFastCollaborative(true);
|
||||
api.asc_setAutoSaveGap(1);
|
||||
|
||||
onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
api.asc_setViewMode(!appOptions.isEdit);
|
||||
api.asc_LoadDocument();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user