[DE] Disable context menu in the view mode for review.
This commit is contained in:
parent
57a8cdadb4
commit
feac63e93e
|
@ -79,6 +79,7 @@ define([
|
||||||
me.fastcoauthtips = [];
|
me.fastcoauthtips = [];
|
||||||
me._currentMathObj = undefined;
|
me._currentMathObj = undefined;
|
||||||
me._currentParaObjDisabled = false;
|
me._currentParaObjDisabled = false;
|
||||||
|
me._isDisabled = false;
|
||||||
|
|
||||||
var showPopupMenu = function(menu, value, event, docElement, eOpts){
|
var showPopupMenu = function(menu, value, event, docElement, eOpts){
|
||||||
if (!_.isUndefined(menu) && menu !== null){
|
if (!_.isUndefined(menu) && menu !== null){
|
||||||
|
@ -212,7 +213,7 @@ define([
|
||||||
|
|
||||||
var showObjectMenu = function(event, docElement, eOpts){
|
var showObjectMenu = function(event, docElement, eOpts){
|
||||||
if (me.api){
|
if (me.api){
|
||||||
var obj = (me.mode.isEdit) ? fillMenuProps(me.api.getSelectedElements()) : fillViewMenuProps(me.api.getSelectedElements());
|
var obj = (me.mode.isEdit && !me._isDisabled) ? fillMenuProps(me.api.getSelectedElements()) : fillViewMenuProps(me.api.getSelectedElements());
|
||||||
if (obj) showPopupMenu(obj.menu_to_show, obj.menu_props, event, docElement, eOpts);
|
if (obj) showPopupMenu(obj.menu_to_show, obj.menu_props, event, docElement, eOpts);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -229,7 +230,7 @@ define([
|
||||||
|
|
||||||
var onFocusObject = function(selectedElements) {
|
var onFocusObject = function(selectedElements) {
|
||||||
if (me.currentMenu && me.currentMenu.isVisible() && me.currentMenu !== me.hdrMenu){
|
if (me.currentMenu && me.currentMenu.isVisible() && me.currentMenu !== me.hdrMenu){
|
||||||
var obj = (me.mode.isEdit) ? fillMenuProps(selectedElements) : fillViewMenuProps(selectedElements);
|
var obj = (me.mode.isEdit && !me._isDisabled) ? fillMenuProps(selectedElements) : fillViewMenuProps(selectedElements);
|
||||||
if (obj) {
|
if (obj) {
|
||||||
if (obj.menu_to_show===me.currentMenu) {
|
if (obj.menu_to_show===me.currentMenu) {
|
||||||
me.currentMenu.options.initMenu(obj.menu_props);
|
me.currentMenu.options.initMenu(obj.menu_props);
|
||||||
|
@ -659,7 +660,7 @@ define([
|
||||||
|
|
||||||
var onDialogAddHyperlink = function() {
|
var onDialogAddHyperlink = function() {
|
||||||
var win, props, text;
|
var win, props, text;
|
||||||
if (me.api && me.mode.isEdit){
|
if (me.api && me.mode.isEdit && !me._isDisabled){
|
||||||
var handlerDlg = function(dlg, result) {
|
var handlerDlg = function(dlg, result) {
|
||||||
if (result == 'ok') {
|
if (result == 'ok') {
|
||||||
props = dlg.getSettings();
|
props = dlg.getSettings();
|
||||||
|
@ -706,7 +707,7 @@ define([
|
||||||
};
|
};
|
||||||
|
|
||||||
var onDoubleClickOnChart = function(chart) {
|
var onDoubleClickOnChart = function(chart) {
|
||||||
if (me.mode.isEdit) {
|
if (me.mode.isEdit && !me._isDisabled) {
|
||||||
var diagramEditor = DE.getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');
|
var diagramEditor = DE.getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');
|
||||||
if (diagramEditor && chart) {
|
if (diagramEditor && chart) {
|
||||||
diagramEditor.setEditMode(true);
|
diagramEditor.setEditMode(true);
|
||||||
|
@ -1814,10 +1815,10 @@ define([
|
||||||
initMenu: function (value) {
|
initMenu: function (value) {
|
||||||
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties()));
|
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties()));
|
||||||
|
|
||||||
menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments);
|
menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
|
||||||
menuViewUndo.setDisabled(!me.api.asc_getCanUndo());
|
menuViewUndo.setDisabled(!me.api.asc_getCanUndo() && !me._isDisabled);
|
||||||
menuViewCopySeparator.setVisible(!isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments);
|
menuViewCopySeparator.setVisible(!isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
|
||||||
menuViewAddComment.setVisible(!isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments);
|
menuViewAddComment.setVisible(!isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
|
||||||
menuViewAddComment.setDisabled(value.paraProps && value.paraProps.locked === true);
|
menuViewAddComment.setDisabled(value.paraProps && value.paraProps.locked === true);
|
||||||
|
|
||||||
var cancopy = me.api && me.api.can_CopyCut();
|
var cancopy = me.api && me.api.can_CopyCut();
|
||||||
|
@ -3299,6 +3300,10 @@ define([
|
||||||
_.defer(function(){ me.cmpEl.focus(); }, 50);
|
_.defer(function(){ me.cmpEl.focus(); }, 50);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
SetDisabled: function(state) {
|
||||||
|
this._isDisabled = state;
|
||||||
|
},
|
||||||
|
|
||||||
alignmentText : 'Alignment',
|
alignmentText : 'Alignment',
|
||||||
leftText : 'Left',
|
leftText : 'Left',
|
||||||
rightText : 'Right',
|
rightText : 'Right',
|
||||||
|
|
Loading…
Reference in a new issue