diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js index 8a2ea25e9..44bc41f0f 100644 --- a/apps/common/main/lib/controller/Plugins.js +++ b/apps/common/main/lib/controller/Plugins.js @@ -73,6 +73,7 @@ define([ this.api.asc_registerCallback("asc_onPluginShow", _.bind(this.onPluginShow, this)); this.api.asc_registerCallback("asc_onPluginClose", _.bind(this.onPluginClose, this)); + this.api.asc_registerCallback("asc_onPluginResize", _.bind(this.onPluginResize, this)); return this; }, @@ -233,6 +234,14 @@ define([ this.panelPlugins.closeInsideMode(); }, + onPluginResize: function(width, height, callback) { + if (this.pluginDlg) { + this.pluginDlg.setInnerSize(width, height); + if (callback) + callback.call(); + } + }, + onDlgBtnClick: function(event) { var state = event.currentTarget.attributes['result'].value; this.api.asc_pluginButtonClick(parseInt(state)); diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index e97ceb2bb..76b3f56dc 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -273,6 +273,15 @@ define([ } }, + setInnerSize: function(width, height) { + var $window = this.getChild(); + var boxEl = $window.find('.body > .box'); + boxEl.css('height', height); + + Common.UI.Window.prototype.setHeight.call(this, height + 85); + Common.UI.Window.prototype.setWidth.call(this, width); + }, + textLoading : 'Loading' }, Common.Views.PluginDlg || {})); }); \ No newline at end of file