[PE] Edit ole objects

This commit is contained in:
Julia Radzhabova 2022-03-11 17:20:24 +03:00
parent fab188cb23
commit 7a282063ef
5 changed files with 38 additions and 0 deletions

View file

@ -161,6 +161,7 @@ require([
/** coauthoring end **/
,'Common.Controllers.Plugins'
,'Common.Controllers.ExternalDiagramEditor'
,'Common.Controllers.ExternalOleEditor'
,'Common.Controllers.ReviewChanges'
,'Common.Controllers.Protection'
,'Transitions'
@ -197,6 +198,7 @@ require([
'common/main/lib/controller/Plugins',
'presentationeditor/main/app/view/ChartSettings',
'common/main/lib/controller/ExternalDiagramEditor'
,'common/main/lib/controller/ExternalOleEditor'
,'common/main/lib/controller/ReviewChanges'
,'common/main/lib/controller/Protection'
,'common/main/lib/controller/Themes'

View file

@ -126,6 +126,27 @@ define([
}, 10);
}, this));
}
var oleEditor = this.getApplication().getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
if (oleEditor) {
oleEditor.on('internalmessage', _.bind(function(cmp, message) {
var command = message.data.command;
var data = message.data.data;
if (this.api) {
if (oleEditor.isEditMode())
this.api.asc_editTableOleObject(data);
}
}, this));
oleEditor.on('hide', _.bind(function(cmp, message) {
if (this.api) {
this.api.asc_enableKeyEvents(true);
}
var me = this;
setTimeout(function(){
me.documentHolder.fireEvent('editcomplete', me.documentHolder);
}, 10);
}, this));
}
}
});
});

View file

@ -851,6 +851,7 @@ define([
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.ExternalOleEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
pluginsController.setApi(me.api);

View file

@ -1622,6 +1622,7 @@ define([
if (me.mode.isEdit===true) {
me.api.asc_registerCallback('asc_onDialogAddHyperlink', _.bind(onDialogAddHyperlink, me));
me.api.asc_registerCallback('asc_doubleClickOnChart', _.bind(me.editChartClick, me));
me.api.asc_registerCallback('asc_doubleClickOnTableOleObject', _.bind(me.onDoubleClickOnTableOleObject, me));
me.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, me));
me.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(onShowSpecialPasteOptions, me));
me.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(onHideSpecialPasteOptions, me));
@ -1762,6 +1763,17 @@ define([
}
},
onDoubleClickOnTableOleObject: function(chart) {
if (this.mode.isEdit && !this._isDisabled) {
var oleEditor = PE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
if (oleEditor && chart) {
oleEditor.setEditMode(true);
oleEditor.show();
oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(chart));
}
}
},
onCutCopyPaste: function(item, e) {
var me = this;
if (me.api) {

View file

@ -152,6 +152,7 @@ require([
/** coauthoring end **/
,'Common.Controllers.Plugins'
,'Common.Controllers.ExternalDiagramEditor'
,'Common.Controllers.ExternalOleEditor'
,'Common.Controllers.ReviewChanges'
,'Common.Controllers.Protection'
,'Transitions'
@ -188,6 +189,7 @@ require([
'common/main/lib/controller/Plugins',
'presentationeditor/main/app/view/ChartSettings',
'common/main/lib/controller/ExternalDiagramEditor'
,'common/main/lib/controller/ExternalOleEditor'
,'common/main/lib/controller/ReviewChanges'
,'common/main/lib/controller/Protection'
,'common/main/lib/controller/Themes'