Edit sse ole object from right panel
This commit is contained in:
parent
ac0e61182b
commit
7268073d19
|
@ -181,7 +181,18 @@ define([
|
||||||
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
||||||
|
|
||||||
this.btnEditObject.on('click', _.bind(function(btn){
|
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.fireEvent('editcomplete', this);
|
||||||
}, this));
|
}, this));
|
||||||
this.btnFitMargins.on('click', _.bind(this.setFitMargins, this));
|
this.btnFitMargins.on('click', _.bind(this.setFitMargins, this));
|
||||||
|
@ -424,7 +435,7 @@ define([
|
||||||
|
|
||||||
if (this._state.isOleObject) {
|
if (this._state.isOleObject) {
|
||||||
var plugin = DE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid});
|
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 {
|
} else {
|
||||||
this.btnSelectImage.setDisabled(pluginGuid===null || this._locked);
|
this.btnSelectImage.setDisabled(pluginGuid===null || this._locked);
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,18 @@ define([
|
||||||
|
|
||||||
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
||||||
this.btnEditObject.on('click', _.bind(function(btn){
|
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.fireEvent('editcomplete', this);
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
|
@ -348,7 +359,7 @@ define([
|
||||||
|
|
||||||
if (this._state.isOleObject) {
|
if (this._state.isOleObject) {
|
||||||
var plugin = PE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid});
|
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 {
|
} else {
|
||||||
this.btnSelectImage.setDisabled(pluginGuid===null || this._locked);
|
this.btnSelectImage.setDisabled(pluginGuid===null || this._locked);
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,18 @@ define([
|
||||||
this.spnHeight.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);});
|
this.spnHeight.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);});
|
||||||
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
||||||
this.btnEditObject.on('click', _.bind(function(btn){
|
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);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
|
@ -448,7 +459,7 @@ define([
|
||||||
|
|
||||||
if (this._state.isOleObject) {
|
if (this._state.isOleObject) {
|
||||||
var plugin = SSE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid});
|
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 {
|
} else {
|
||||||
this.btnSelectImage.setDisabled(pluginGuid===null || this._locked);
|
this.btnSelectImage.setDisabled(pluginGuid===null || this._locked);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue