diff --git a/apps/common/main/lib/controller/ExternalOleEditor.js b/apps/common/main/lib/controller/ExternalOleEditor.js index 3f1603b65d..9ac32def8f 100644 --- a/apps/common/main/lib/controller/ExternalOleEditor.js +++ b/apps/common/main/lib/controller/ExternalOleEditor.js @@ -104,10 +104,8 @@ define([ 'show': _.bind(function(cmp){ var h = this.oleEditorView.getHeight(), innerHeight = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top'); - if (innerHeight>h && h<700 || innerHeight0 && h>0) + this.oleEditorView.setInnerSize(w, h); } else this.oleEditorView.fireEvent('internalmessage', this.oleEditorView, eventData); } diff --git a/apps/common/main/lib/view/ExternalOleEditor.js b/apps/common/main/lib/view/ExternalOleEditor.js index 3dea5aed75..13643cf6d5 100644 --- a/apps/common/main/lib/view/ExternalOleEditor.js +++ b/apps/common/main/lib/view/ExternalOleEditor.js @@ -80,6 +80,8 @@ define([ render: function() { Common.UI.Window.prototype.render.call(this); + this._headerFooterHeight = 85 + ((parseInt(this.$window.css('border-top-width')) + parseInt(this.$window.css('border-bottom-width')))); + this.boxEl = this.$window.find('.body > .box'); this.btnSave = new Common.UI.Button({ el: $('#id-btn-ole-editor-apply'), @@ -155,6 +157,26 @@ define([ this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top); }, + setInnerSize: function(width, height) { + var maxHeight = Common.Utils.innerHeight(), + maxWidth = Common.Utils.innerWidth(), + borders_width = (parseInt(this.$window.css('border-left-width')) + parseInt(this.$window.css('border-right-width'))), + bordersOffset = this.bordersOffset*2; + height += 90; // add toolbar and statusbar height + if (maxHeight - bordersOffset