diff --git a/apps/common/main/lib/controller/ExternalDiagramEditor.js b/apps/common/main/lib/controller/ExternalDiagramEditor.js index 876c5f6a5..4ce21da3d 100644 --- a/apps/common/main/lib/controller/ExternalDiagramEditor.js +++ b/apps/common/main/lib/controller/ExternalDiagramEditor.js @@ -182,7 +182,6 @@ define([ if (this.diagramEditorView) { if (eventData.type == 'documentReady') { this.diagramEditorView._isExternalDocReady = true; - this.diagramEditorView.setControlsDisabled(false); if (this.diagramEditorView._chartData) { externalEditor && externalEditor.serviceCommand('setChartData', this.diagramEditorView._chartData); this.diagramEditorView._chartData = null; @@ -191,6 +190,10 @@ define([ this.onDiagrammEditingDisabled(); } } else + if (eventData.type == 'chartDataReady') { + if (this.needDisableEditing===undefined) + this.diagramEditorView.setControlsDisabled(false); + } else if (eventData.type == "shortcut") { if (eventData.data.key == 'escape') this.diagramEditorView.hide(); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index dfe11889f..1a6141a88 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -369,6 +369,13 @@ define([ } }, + onSelectionChanged: function(info){ + if (!this._isChartDataReady){ + this._isChartDataReady = true; + Common.Gateway.internalMessage('chartDataReady'); + } + }, + onLongActionBegin: function(type, id) { var action = {id: id, type: type}; this.stackLongActions.push(action); @@ -908,6 +915,8 @@ define([ me.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me)); me.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me)); /** coauthoring end **/ + if (me.appOptions.isEditDiagram) + me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onSelectionChanged, me)); if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) { me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], ApplyEditRights);