Commit 8ca1f9b5 authored by mojzis's avatar mojzis Committed by joelpittet

Issue #1678562 by mojzis, AlexKirienko, adr_p, Chris Matthews, dooglet,...

Issue #1678562 by mojzis, AlexKirienko, adr_p, Chris Matthews, dooglet, tlilleberg, litzastark, DamienMcKenna: Modal may receive negative top css position
parent f1b02e37
......@@ -555,7 +555,7 @@
// Create our content div, get the dimensions, and hide it
var modalContent = $('#modalContent').css('top','-1000px');
var $modalHeader = modalContent.find('.modal-header');
var mdcTop = wt + ( winHeight / 2 ) - ( modalContent.outerHeight() / 2);
var mdcTop = wt + Math.max((winHeight / 2) - (modalContent.outerHeight() / 2), 0);
var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2);
$('#modalBackdrop').css(css).css('top', 0).css('height', docHeight + 'px').css('width', docWidth + 'px').show();
modalContent.css({top: mdcTop + 'px', left: mdcLeft + 'px'}).hide()[animation](speed);
......@@ -640,7 +640,7 @@
// Get where we should move content to
var modalContent = $('#modalContent');
var mdcTop = wt + ( winHeight / 2 ) - ( modalContent.outerHeight() / 2);
var mdcTop = wt + Math.max((winHeight / 2) - (modalContent.outerHeight() / 2), 0);
var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2);
// Apply the changes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment