[DE] Disable items in the Navigation context menu when editing is disabled
This commit is contained in:
parent
dbe086d14f
commit
cd45f0ae06
|
@ -557,6 +557,7 @@ define([
|
||||||
app.getController('RightMenu').SetDisabled(disable, false);
|
app.getController('RightMenu').SetDisabled(disable, false);
|
||||||
app.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
|
app.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
|
||||||
app.getController('DocumentHolder').getView().SetDisabled(disable);
|
app.getController('DocumentHolder').getView().SetDisabled(disable);
|
||||||
|
app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable);
|
||||||
app.getController('Common.Controllers.Plugins').getView('Common.Views.Plugins').disableControls(disable);
|
app.getController('Common.Controllers.Plugins').getView('Common.Views.Plugins').disableControls(disable);
|
||||||
|
|
||||||
var leftMenu = app.getController('LeftMenu').leftMenu;
|
var leftMenu = app.getController('LeftMenu').leftMenu;
|
||||||
|
|
|
@ -900,7 +900,7 @@ define([
|
||||||
leftmenuController.getView('LeftMenu').getMenu('file').loadDocument({doc:me.document});
|
leftmenuController.getView('LeftMenu').getMenu('file').loadDocument({doc:me.document});
|
||||||
leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api);
|
leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api);
|
||||||
|
|
||||||
navigationController.setApi(me.api);
|
navigationController.setApi(me.api).setMode(this.appOptions);
|
||||||
|
|
||||||
chatController.setApi(this.api).setMode(this.appOptions);
|
chatController.setApi(this.api).setMode(this.appOptions);
|
||||||
application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
|
application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
|
||||||
|
|
|
@ -77,6 +77,7 @@ define([
|
||||||
});
|
});
|
||||||
this.panelNavigation.on('render:after', _.bind(this.onAfterRender, this));
|
this.panelNavigation.on('render:after', _.bind(this.onAfterRender, this));
|
||||||
this._navigationObject = null;
|
this._navigationObject = null;
|
||||||
|
this._isDisabled = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
setApi: function(api) {
|
setApi: function(api) {
|
||||||
|
@ -90,6 +91,8 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
|
this.mode = mode;
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
onAfterRender: function(panelNavigation) {
|
onAfterRender: function(panelNavigation) {
|
||||||
|
@ -163,10 +166,16 @@ define([
|
||||||
top = e.clientY*Common.Utils.zoom();
|
top = e.clientY*Common.Utils.zoom();
|
||||||
showPoint = [e.clientX*Common.Utils.zoom() + 5, top - parentOffset.top + 5];
|
showPoint = [e.clientX*Common.Utils.zoom() + 5, top - parentOffset.top + 5];
|
||||||
|
|
||||||
|
for (var i=0; i<7; i++) {
|
||||||
|
menu.items[i].setVisible(this.mode.isEdit);
|
||||||
|
}
|
||||||
|
|
||||||
var isNotHeader = record.get('isNotHeader');
|
var isNotHeader = record.get('isNotHeader');
|
||||||
menu.items[0].setDisabled(isNotHeader);
|
menu.items[0].setDisabled(isNotHeader || this._isDisabled);
|
||||||
menu.items[1].setDisabled(isNotHeader);
|
menu.items[1].setDisabled(isNotHeader || this._isDisabled);
|
||||||
menu.items[3].setDisabled(isNotHeader);
|
menu.items[3].setDisabled(isNotHeader || this._isDisabled);
|
||||||
|
menu.items[4].setDisabled(this._isDisabled);
|
||||||
|
menu.items[5].setDisabled(this._isDisabled);
|
||||||
menu.items[7].setDisabled(isNotHeader);
|
menu.items[7].setDisabled(isNotHeader);
|
||||||
|
|
||||||
if (showPoint != undefined) {
|
if (showPoint != undefined) {
|
||||||
|
@ -224,6 +233,10 @@ define([
|
||||||
this.panelNavigation.viewNavigationList.expandToLevel(item.value-1);
|
this.panelNavigation.viewNavigationList.expandToLevel(item.value-1);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
SetDisabled: function(state) {
|
||||||
|
this._isDisabled = state;
|
||||||
|
},
|
||||||
|
|
||||||
txtBeginning: 'Beginning of document',
|
txtBeginning: 'Beginning of document',
|
||||||
txtGotoBeginning: 'Go to the beginning of the document'
|
txtGotoBeginning: 'Go to the beginning of the document'
|
||||||
|
|
||||||
|
|
|
@ -361,6 +361,7 @@ define([
|
||||||
DE.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
|
DE.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
|
||||||
DE.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
|
DE.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
|
||||||
DE.getController('DocumentHolder').getView().SetDisabled(disable, true);
|
DE.getController('DocumentHolder').getView().SetDisabled(disable, true);
|
||||||
|
DE.getController('Navigation') && DE.getController('Navigation').SetDisabled(disable);
|
||||||
|
|
||||||
var leftMenu = DE.getController('LeftMenu').leftMenu;
|
var leftMenu = DE.getController('LeftMenu').leftMenu;
|
||||||
leftMenu.btnComments.setDisabled(disable);
|
leftMenu.btnComments.setDisabled(disable);
|
||||||
|
|
Loading…
Reference in a new issue