When you click a link for the user to report spam comments (located near the bottom of the page), the modal window appears and then seems to disappear - when in fact it is still on the page, it just moves all the way to the top because of the absolute positioning. This results in a grey overlay that appears to "block" all of the content with no visible popup.

Can this be changed to fixed which would always fix the window to the center of the browser window?

diff --git a/js/modal.js b/js/modal.js
index a986829..5d3d0d9 100644
--- a/js/modal.js
+++ b/js/modal.js
@@ -386,7 +386,7 @@
     if( docHeight < winHeight ) docHeight = winHeight;

     // Create our divs
-    $('body').append('<div id="modalBackdrop" style="z-index: 1000; display: none;"></div><div id="modalContent" style="z-index: 1001; position: absolute;">' + $(content).html() + '</div>');
+    $('body').append('<div id="modalBackdrop" style="z-index: 1000; display: none;"></div><div id="modalContent" style="z-index: 1001; position: fixed;">' + $(content).html() + '</div>');

Files: 
CommentFileSizeAuthor
#7 ctools-modal-popup-fixed-position-2038245-4.patch1.85 KBjerrylow
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

Comments

khaos119’s picture

Patch

khaos119’s picture

Anyone?

roberttstephens’s picture

I agree that position: fixed makes more sense, however this breaks media edit windows.

The behavior you're describing is caused when the window resize event is fired in javascript. The ctools code to calculate the top and left styles for #modalContent is incorrect. I've created a new ctools issue https://drupal.org/node/2055785 that should fix this issue.

fox_01’s picture

Issue summary:View changes

I got the problem if the modal window is opened and i resize the browser it will jump to the top of the page.

Patch #2055785-1: Modal window top and left style values are incorrect after resizing works for me.

fox_01’s picture

Issue summary:View changes

I got the problem if the modal window is opened and i resize the browser it will jump to the top of the page.

Patch #2055785-1: Modal window top and left style values are incorrect after resizing works for me.

jerrylow’s picture

StatusFileSize
new1.85 KB

I've been looking at this issue recently as well. Here's a patch that enables it as a setting instead of just changing the position to fixed. That way the default stays position: absolute but you can customize it to be fixed.

jerrylow’s picture

StatusFileSize
new1.85 KB
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

I've been looking at this issue recently as well. Here's a patch that enables it as a setting instead of just changing the position to fixed. That way the default stays position: absolute but you can customize it to be fixed.

I'm sorry the last patch accidentally kept it as fixed. This is correct.

jerrylow’s picture

Status:Active» Needs review

whitelikeman’s picture

Patch attached in #7 doesn't work for me with the module's 7.x-1.6 version.