[DE] Fix disable file menu

This commit is contained in:
Julia Radzhabova 2021-06-29 17:26:04 +03:00
parent 8e5979570b
commit 6f4de5a73f
3 changed files with 7 additions and 7 deletions

View file

@ -667,7 +667,7 @@ define([
},
SetDisabled: function(disable, options) {
// if (viewMode) this.mode.isEdit = !disable;
this.mode.isEdit = !disable;
if (disable) this.leftMenu.close();
// var comments = this.getApplication().getController('Common.Controllers.Comments');

View file

@ -784,16 +784,15 @@ define([
app.getController('DocumentHolder').getView().SetDisabled(disable, options.allowProtect);
}
if (options.leftMenu) {
if (options.leftMenu.disable) {
if (options.leftMenu.disable)
app.getController('LeftMenu').SetDisabled(disable, options);
if (options.viewMode!==undefined)
this.appOptions.isEdit = !options.viewMode;
}
if (options.leftMenu.previewMode)
app.getController('LeftMenu').setPreviewMode(disable);
}
if (options.fileMenu) {
app.getController('LeftMenu').leftMenu.getMenu('file').SetDisabled(disable, options.fileMenu);
if (options.leftMenu.disable)
app.getController('LeftMenu').leftMenu.getMenu('file').applyMode();
}
if (options.comments) {
var comments = this.getApplication().getController('Common.Controllers.Comments');

View file

@ -271,6 +271,8 @@ define([
},
applyMode: function() {
if (!this.rendered) return;
if (!this.panels) {
this.panels = {
'opts' : (new DE.Views.FileMenuPanels.Settings({menu:this})).render(this.$el.find('#panel-settings')),
@ -363,8 +365,7 @@ define([
}
if (!delay) {
if ( this.rendered )
this.applyMode();
this.applyMode();
}
return this;
},