$el.dialog('option', $el.data('origSize'));
$el.data('origSize', null);
} else {
+ var menuHeight = $('#civicrm-menu').outerHeight();
$el.data('origSize', {
- position: {my: 'center', at: 'center', of: window},
+ position: {my: 'center', at: 'center center+' + (menuHeight / 2), of: window},
width: $el.dialog('option', 'width'),
height: $el.dialog('option', 'height')
});
- var menuHeight = $('#civicrm-menu').height();
$el.dialog('option', {width: '100%', height: ($(window).height() - menuHeight), position: {my: "top", at: "top+"+menuHeight, of: window}});
}
e.preventDefault();
}
// Adjust height to fit content (small delay to allow elements to render)
window.setTimeout(function() {
- var currentHeight = $(settings.target).parent().height(),
+ var currentHeight = $(settings.target).parent().outerHeight(),
padding = currentHeight - $(settings.target).height(),
newHeight = $(settings.target).prop('scrollHeight') + padding,
- menuHeight = $('#civicrm-menu').height(),
+ menuHeight = $('#civicrm-menu').outerHeight(),
maxHeight = $(window).height() - menuHeight;
newHeight = newHeight > maxHeight ? maxHeight : newHeight;
if (newHeight > (currentHeight + 15)) {