CRM-15705 - Match preview iframe size with dialog
authorColeman Watts <coleman@civicrm.org>
Sun, 15 Feb 2015 02:22:01 +0000 (21:22 -0500)
committerColeman Watts <coleman@civicrm.org>
Sun, 15 Feb 2015 02:22:01 +0000 (21:22 -0500)
js/Common.js
js/angular-crm-ui.js

index f97025645899c0408c74174eab7cd1e7dc6c62ff..bd100e2b33bf10c9e0e561a1ba77a8ab84662450 100644 (file)
@@ -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();
         });
       }
index 50259ae9b7e52476064a91d36ccf5658c5d15a84..28ccdc93e2d59e114dd9de1545531cebd14360ce 100644 (file)
             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);
         }
       };