Open test app in edit or view mode
This commit is contained in:
parent
db812fa94e
commit
f53450ee2e
|
@ -124,17 +124,16 @@ 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.isEdit = appOptions.canLicense && (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;
|
||||
|
@ -118,8 +119,12 @@ 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.isEdit = appOptions.canLicense && (permissions.edit !== false) && (config.mode !== 'view');
|
||||
|
||||
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;
|
||||
|
||||
|
@ -149,10 +150,15 @@ 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.isEdit = appOptions.canLicense && (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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue