There are various reports of ctools modals not sizing correctly, and several attempts fix it using outerHeight() differently.

Here is another patch that attempts to fix it. More detail about the different scenarios and ways to test them are require to resolve this once and for all.

Comment 5 on #1803104: Modal dialog position after ajax load is not refreshed has a very similar patch, but that adds the parameter true where this patch adds false instead.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, jquery-outerheight.patch, failed testing.

mrjmd’s picture

Status: Needs work » Needs review
FileSize
1.3 KB

Re-roll attached.

DamienMcKenna’s picture

Status: Needs review » Needs work

The code needs a little bit of tweaking to match the Drupal coding standards, specifically no whitespace inside of the parenthesiseses, so "(winHeight / 2)" instead of "( winHeight / 2 )".

mrjmd’s picture

Status: Needs work » Needs review
FileSize
1.29 KB

Fixed :)

maximpodorov’s picture

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 4 year old patch in #5 to modal.js does not apply to the latest ctools 7.x-1.x-dev and if still applicable needs to be rerolled.

Checking patch js/modal.js...
error: while searching for:

    // Create our content div, get the dimensions, and hide it
    var modalContent = $('#modalContent').css('top','-1000px');
    var mdcTop = wt + ( winHeight / 2 ) - (  modalContent.outerHeight() / 2);
    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);

error: patch failed: js/modal.js:438
error: js/modal.js: patch does not apply
ikeigenwijs’s picture

The jumping to top after scrolling in a modal is still a problem.

shubham.prakash’s picture

Assigned: Unassigned » shubham.prakash
shubham.prakash’s picture

Assigned: shubham.prakash » Unassigned
Status: Needs work » Needs review
FileSize
1.37 KB

This patch should fix the issue.

rpayanm’s picture

Issue tags: -Needs reroll