Resize plugin window.

This commit is contained in:
Julia Radzhabova 2016-07-26 15:08:39 +03:00
parent 520aa3ee65
commit 675ef1fb1f
2 changed files with 18 additions and 0 deletions

View file

@ -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));

View file

@ -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 || {}));
});