Resize plugin window.
This commit is contained in:
parent
520aa3ee65
commit
675ef1fb1f
|
@ -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));
|
||||
|
|
|
@ -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 || {}));
|
||||
});
|
Loading…
Reference in a new issue