[DE] Fix protection for restricted modes
This commit is contained in:
parent
00d7a665e6
commit
9adcc64e9b
|
@ -180,7 +180,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
lockToolbar: function (causes, lock, opts) {
|
lockToolbar: function (causes, lock, opts) {
|
||||||
Common.Utils.lockControls(causes, lock, opts, this.view.getButtons());
|
this.view && Common.Utils.lockControls(causes, lock, opts, this.view.getButtons());
|
||||||
},
|
},
|
||||||
|
|
||||||
setPreviewMode: function(mode) { //disable accept/reject in popover
|
setPreviewMode: function(mode) { //disable accept/reject in popover
|
||||||
|
|
|
@ -191,13 +191,12 @@ define([
|
||||||
resolve();
|
resolve();
|
||||||
})).then(function () {
|
})).then(function () {
|
||||||
// me.view.btnProtectDoc.toggle(me.api.asc_isProtectedDocument(), true);
|
// me.view.btnProtectDoc.toggle(me.api.asc_isProtectedDocument(), true);
|
||||||
// me.onChangeProtectDocument();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeProtectDocument: function() {
|
onChangeProtectDocument: function() {
|
||||||
// var isProtected = this.api.asc_isProtectedDocument();
|
// var isProtected = this.api.asc_isProtectedDocument();
|
||||||
var isProtected = this.view.btnProtectDoc.isActive(); // test
|
var isProtected = this.view ? this.view.btnProtectDoc.isActive() : false; // test
|
||||||
this.view && this.view.btnProtectDoc.toggle(isProtected, true);
|
this.view && this.view.btnProtectDoc.toggle(isProtected, true);
|
||||||
this.getDocProps(true);
|
this.getDocProps(true);
|
||||||
Common.NotificationCenter.trigger('protect:doclock');
|
Common.NotificationCenter.trigger('protect:doclock');
|
||||||
|
@ -216,7 +215,11 @@ define([
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// test //////
|
// test //////
|
||||||
var docProtected = this.view.btnProtectDoc.isActive(),
|
// if (Common.Utils.InternalSettings.get('protect-test-type')===undefined) {
|
||||||
|
// this.view && this.view.btnProtectDoc.toggle(true, true);
|
||||||
|
// Common.Utils.InternalSettings.set('protect-test-type', Asc.c_oAscProtection.Comments);
|
||||||
|
// }
|
||||||
|
var docProtected = this.view ? this.view.btnProtectDoc.isActive() : true,
|
||||||
type;
|
type;
|
||||||
|
|
||||||
if (docProtected) {
|
if (docProtected) {
|
||||||
|
|
|
@ -440,7 +440,7 @@ define([
|
||||||
var cntrl = this.getApplication().getController('DocProtection');
|
var cntrl = this.getApplication().getController('DocProtection');
|
||||||
docProtection = cntrl ? cntrl.getDocProps() : null;
|
docProtection = cntrl ? cntrl.getDocProps() : null;
|
||||||
}
|
}
|
||||||
if (docProtection) {
|
if (docProtection && this.view) {
|
||||||
var arr = this.view.getButtons();
|
var arr = this.view.getButtons();
|
||||||
Common.Utils.lockControls(Common.enumLock.docLockView, docProtection.isReadOnly, {array: arr});
|
Common.Utils.lockControls(Common.enumLock.docLockView, docProtection.isReadOnly, {array: arr});
|
||||||
Common.Utils.lockControls(Common.enumLock.docLockForms, docProtection.isFormsOnly, {array: arr});
|
Common.Utils.lockControls(Common.enumLock.docLockForms, docProtection.isFormsOnly, {array: arr});
|
||||||
|
|
|
@ -205,7 +205,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
lockToolbar: function (causes, lock, opts) {
|
lockToolbar: function (causes, lock, opts) {
|
||||||
Common.Utils.lockControls(causes, lock, opts, this.view.getButtons());
|
this.view && Common.Utils.lockControls(causes, lock, opts, this.view.getButtons());
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiCanAddHyperlink: function(value) {
|
onApiCanAddHyperlink: function(value) {
|
||||||
|
@ -593,8 +593,10 @@ define([
|
||||||
(new Promise(function (accept, reject) {
|
(new Promise(function (accept, reject) {
|
||||||
accept();
|
accept();
|
||||||
})).then(function(){
|
})).then(function(){
|
||||||
me.view && me.view.onAppReady(config);
|
if (me.view) {
|
||||||
me.onChangeProtectDocument();
|
me.view.onAppReady(config);
|
||||||
|
me.onChangeProtectDocument();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1694,7 +1694,9 @@ define([
|
||||||
var toolbarController = application.getController('Toolbar');
|
var toolbarController = application.getController('Toolbar');
|
||||||
toolbarController && toolbarController.setApi(me.api);
|
toolbarController && toolbarController.setApi(me.api);
|
||||||
|
|
||||||
if (this.appOptions.isEdit) {
|
if (this.appOptions.isRestrictedEdit)
|
||||||
|
application.getController('DocProtection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
||||||
|
else if (this.appOptions.isEdit) {
|
||||||
var rightmenuController = application.getController('RightMenu'),
|
var rightmenuController = application.getController('RightMenu'),
|
||||||
fontsControllers = application.getController('Common.Controllers.Fonts');
|
fontsControllers = application.getController('Common.Controllers.Fonts');
|
||||||
fontsControllers && fontsControllers.setApi(me.api);
|
fontsControllers && fontsControllers.setApi(me.api);
|
||||||
|
|
Loading…
Reference in a new issue