Better sizing of image popups
authorColeman Watts <coleman@civicrm.org>
Fri, 26 Jun 2015 19:39:40 +0000 (15:39 -0400)
committerColeman Watts <coleman@civicrm.org>
Sat, 27 Jun 2015 00:09:31 +0000 (20:09 -0400)
js/Common.js

index 947c43cd53f90e38519ee4551b54496206d9b93f..ff3ddbe987524e8f32e0495287aa53ed2cc3c47d 100644 (file)
@@ -1269,6 +1269,9 @@ CRM.strings = CRM.strings || {};
         CRM.confirm({
           title: ts('Preview'),
           resizable: true,
+          // Prevent overlap with the menubar
+          maxHeight: $(window).height() - 30,
+          position: {my: 'center', at: 'center center+15', of: window},
           message: '<div class="crm-custom-image-popup"><img style="max-width: 100%" src="' + $(this).attr('href') + '"></div>',
           options: null
         });