Merge pull request #2051 from ONLYOFFICE/fix/refactoringLocks

Refactoring locks
This commit is contained in:
maxkadushkin 2022-11-14 18:07:03 +03:00 committed by GitHub
commit 50bf470a63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -234,7 +234,7 @@ define([
Common.NotificationCenter.on('document:ready', function () {
if ( config.isEdit ) {
var maincontroller = webapp.getController('Main');
if (maincontroller.api.asc_isReadOnly && maincontroller.api.asc_isReadOnly()) {
if (maincontroller.api.asc_getLocalRestrictions && Asc.c_oAscLocalRestrictionType.None !== maincontroller.api.asc_getLocalRestrictions()) {
maincontroller.warningDocumentIsLocked();
}
}

View file

@ -979,7 +979,7 @@ Common.Utils.warningDocumentIsLocked = function (opts) {
callback: function(btn){
if (btn == 'edit') {
if ( opts.disablefunc ) opts.disablefunc(false);
app.getController('Main').api.asc_setIsReadOnly(false);
app.getController('Main').api.asc_setLocalRestrictions(Asc.c_oAscLocalRestrictionType.None);
}
}
});