[DE] Fix disable file menu
This commit is contained in:
parent
8e5979570b
commit
6f4de5a73f
|
@ -667,7 +667,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
SetDisabled: function(disable, options) {
|
SetDisabled: function(disable, options) {
|
||||||
// if (viewMode) this.mode.isEdit = !disable;
|
this.mode.isEdit = !disable;
|
||||||
if (disable) this.leftMenu.close();
|
if (disable) this.leftMenu.close();
|
||||||
|
|
||||||
// var comments = this.getApplication().getController('Common.Controllers.Comments');
|
// var comments = this.getApplication().getController('Common.Controllers.Comments');
|
||||||
|
|
|
@ -784,16 +784,15 @@ define([
|
||||||
app.getController('DocumentHolder').getView().SetDisabled(disable, options.allowProtect);
|
app.getController('DocumentHolder').getView().SetDisabled(disable, options.allowProtect);
|
||||||
}
|
}
|
||||||
if (options.leftMenu) {
|
if (options.leftMenu) {
|
||||||
if (options.leftMenu.disable) {
|
if (options.leftMenu.disable)
|
||||||
app.getController('LeftMenu').SetDisabled(disable, options);
|
app.getController('LeftMenu').SetDisabled(disable, options);
|
||||||
if (options.viewMode!==undefined)
|
|
||||||
this.appOptions.isEdit = !options.viewMode;
|
|
||||||
}
|
|
||||||
if (options.leftMenu.previewMode)
|
if (options.leftMenu.previewMode)
|
||||||
app.getController('LeftMenu').setPreviewMode(disable);
|
app.getController('LeftMenu').setPreviewMode(disable);
|
||||||
}
|
}
|
||||||
if (options.fileMenu) {
|
if (options.fileMenu) {
|
||||||
app.getController('LeftMenu').leftMenu.getMenu('file').SetDisabled(disable, 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) {
|
if (options.comments) {
|
||||||
var comments = this.getApplication().getController('Common.Controllers.Comments');
|
var comments = this.getApplication().getController('Common.Controllers.Comments');
|
||||||
|
|
|
@ -271,6 +271,8 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
applyMode: function() {
|
applyMode: function() {
|
||||||
|
if (!this.rendered) return;
|
||||||
|
|
||||||
if (!this.panels) {
|
if (!this.panels) {
|
||||||
this.panels = {
|
this.panels = {
|
||||||
'opts' : (new DE.Views.FileMenuPanels.Settings({menu:this})).render(this.$el.find('#panel-settings')),
|
'opts' : (new DE.Views.FileMenuPanels.Settings({menu:this})).render(this.$el.find('#panel-settings')),
|
||||||
|
@ -363,8 +365,7 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!delay) {
|
if (!delay) {
|
||||||
if ( this.rendered )
|
this.applyMode();
|
||||||
this.applyMode();
|
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue