Skip to content
Snippets Groups Projects
Commit 8a647bbd authored by Jan Hug's avatar Jan Hug
Browse files

Make modal size match viewport

parent b7c31d8d
No related branches found
No related tags found
No related merge requests found
......@@ -18,13 +18,10 @@
*/
Drupal.AjaxCommands.prototype.openIframe.initialResize = function (wrapper) {
var dialog = $('#' + wrapper)
var iframe = $(dialog).find('iframe')
iframe.one('load', function(e) {
var height = e.target.contentWindow.document.body.scrollHeight
var dialogHeight = Math.min(window.innerHeight - 180, height) + 100
dialog.dialog('option', 'height', dialogHeight)
})
var dialogHeight = window.innerHeight - 180
var dialogWidth = window.innerWidth - 180
dialog.dialog('option', 'height', dialogHeight)
dialog.dialog('option', 'width', dialogWidth)
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment