From 8769da5622810983f3c70b16469709a42a4b288b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 19 Jun 2013 14:28:34 +0200 Subject: [PATCH] CMS UI: Resize iframe alongside dialog Fixes regression from 9f600ada2cbefd38fb51b9b274827744a64fd4c7 --- admin/javascript/ssui.core.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/admin/javascript/ssui.core.js b/admin/javascript/ssui.core.js index 74efe5095..dff784fe7 100644 --- a/admin/javascript/ssui.core.js +++ b/admin/javascript/ssui.core.js @@ -186,7 +186,7 @@ $(window).unbind('resize.ssdialog'); }, _resizeIframe: function() { - var opts = {}, newWidth, newHeight; + var opts = {}, newWidth, newHeight, iframe = this.element.children('iframe');; if(this.options.widthRatio) { newWidth = $(window).width() * this.options.widthRatio; if(this.options.minWidth && newWidth < this.options.minWidth) { @@ -210,8 +210,22 @@ if(this.options.autoPosition) { opts.position = this.options.position; } + if(!jQuery.isEmptyObject(opts)) { + // Resize dialog this._setOptions(opts); + + // Resize iframe within dialog + iframe.attr('width', + opts.width + - parseFloat(this.element.css('paddingLeft')) + - parseFloat(this.element.css('paddingRight')) + ); + iframe.attr('height', + opts.height + - parseFloat(this.element.css('paddingTop')) + - parseFloat(this.element.css('paddingBottom')) + ); } } });