diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js index 5f60017b4..54bba15f1 100644 --- a/apps/documenteditor/main/app/view/ImageSettings.js +++ b/apps/documenteditor/main/app/view/ImageSettings.js @@ -181,7 +181,18 @@ define([ this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this)); this.btnEditObject.on('click', _.bind(function(btn){ - if (this.api) this.api.asc_startEditCurrentOleObject(); + if (this.api) { + var oleobj = this.api.asc_canEditTableOleObject(); + if (oleobj) { + var oleEditor = DE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); + if (oleEditor) { + oleEditor.setEditMode(true); + oleEditor.show(); + oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(oleobj)); + } + } else + this.api.asc_startEditCurrentOleObject(); + } this.fireEvent('editcomplete', this); }, this)); this.btnFitMargins.on('click', _.bind(this.setFitMargins, this)); @@ -424,7 +435,7 @@ define([ if (this._state.isOleObject) { var plugin = DE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid}); - this.btnEditObject.setDisabled(plugin===null || plugin ===undefined || this._locked); + this.btnEditObject.setDisabled(!this.api.asc_canEditTableOleObject() && (plugin===null || plugin ===undefined) || this._locked); } else { this.btnSelectImage.setDisabled(pluginGuid===null || this._locked); } diff --git a/apps/presentationeditor/main/app/view/ImageSettings.js b/apps/presentationeditor/main/app/view/ImageSettings.js index 25bc35c55..c0845cb8b 100644 --- a/apps/presentationeditor/main/app/view/ImageSettings.js +++ b/apps/presentationeditor/main/app/view/ImageSettings.js @@ -148,7 +148,18 @@ define([ this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this)); this.btnEditObject.on('click', _.bind(function(btn){ - if (this.api) this.api.asc_startEditCurrentOleObject(); + if (this.api) { + var oleobj = this.api.asc_canEditTableOleObject(); + if (oleobj) { + var oleEditor = PE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); + if (oleEditor) { + oleEditor.setEditMode(true); + oleEditor.show(); + oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(oleobj)); + } + } else + this.api.asc_startEditCurrentOleObject(); + } this.fireEvent('editcomplete', this); }, this)); @@ -348,7 +359,7 @@ define([ if (this._state.isOleObject) { var plugin = PE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid}); - this.btnEditObject.setDisabled(plugin===null || plugin ===undefined || this._locked); + this.btnEditObject.setDisabled(!this.api.asc_canEditTableOleObject() && (plugin===null || plugin ===undefined) || this._locked); } else { this.btnSelectImage.setDisabled(pluginGuid===null || this._locked); } diff --git a/apps/spreadsheeteditor/main/app/view/ImageSettings.js b/apps/spreadsheeteditor/main/app/view/ImageSettings.js index e8d6404d8..6fdbec171 100644 --- a/apps/spreadsheeteditor/main/app/view/ImageSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ImageSettings.js @@ -215,7 +215,18 @@ define([ this.spnHeight.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this)); this.btnEditObject.on('click', _.bind(function(btn){ - if (this.api) this.api.asc_startEditCurrentOleObject(); + if (this.api) { + var oleobj = this.api.asc_canEditTableOleObject(); + if (oleobj) { + var oleEditor = SSE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); + if (oleEditor) { + oleEditor.setEditMode(true); + oleEditor.show(); + oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(oleobj)); + } + } else + this.api.asc_startEditCurrentOleObject(); + } Common.NotificationCenter.trigger('edit:complete', this); }, this)); @@ -448,7 +459,7 @@ define([ if (this._state.isOleObject) { var plugin = SSE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid}); - this.btnEditObject.setDisabled(plugin===null || plugin ===undefined || this._locked); + this.btnEditObject.setDisabled(!this.api.asc_canEditTableOleObject() && (plugin===null || plugin ===undefined) || this._locked); } else { this.btnSelectImage.setDisabled(pluginGuid===null || this._locked); }