mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-29 12:49:06 +02:00
CMS UI: Resize iframe alongside dialog
Fixes regression from 9f600ada2c
This commit is contained in:
parent
2160fb8000
commit
8769da5622
@ -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'))
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user