From 02cd9764aa8fbcb8730977c3238612e3c56131af Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 14 Feb 2015 21:22:01 -0500 Subject: [PATCH] CRM-15705 - Match preview iframe size with dialog --- js/Common.js | 1 + js/angular-crm-ui.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/js/Common.js b/js/Common.js index f970256458..bd100e2b33 100644 --- a/js/Common.js +++ b/js/Common.js @@ -755,6 +755,7 @@ CRM.strings = CRM.strings || {}; }); $el.dialog('option', {width: '100%', height: ($(window).height() - menuHeight), position: {my: "top", at: "top+"+menuHeight, of: window}}); } + $el.trigger('dialogresize'); e.preventDefault(); }); } diff --git a/js/angular-crm-ui.js b/js/angular-crm-ui.js index 50259ae9b7..28ccdc93e2 100644 --- a/js/angular-crm-ui.js +++ b/js/angular-crm-ui.js @@ -308,6 +308,12 @@ doc.close(); }; + // If the iframe is in a dialog, respond to resize events + $(elm).parent().on('dialogresize dialogopen', function(e, ui) { + $(this).css({padding: '0', margin: '0', overflow: 'hidden'}); + iframe.setAttribute('height', '' + $(this).innerHeight() + 'px'); + }); + scope.$parent.$watch(attrs.crmUiIframe, refresh); } }; -- 2.25.1