I've installed Popups API and the Popups test module on a fresh Drupal 6 installation. No other modules enabled except core required and popups API and popups test.
When I use any browser except IE, I have a good time. Popups open and close. All my difficulties are mine to bear.
When I use IE, the popup will close but the overlay will persist. Clicking the overlay won't make it go away. None of the links are clickable. Sometimes IE claims that there's an error on this line:
Popups.popupStack.splice(Popups.popupStack.indexOf(popup), 1); // Remove popup from stack. Probably should rework into .pop()
From this function.
Popups.removePopup = function(popup) {
if (!Popups.isset(popup)) {
popup = Popups.activePopup();
}
if (popup) {
popup.$popup().remove();
Popups.popupStack.splice(Popups.popupStack.indexOf(popup), 1); // Remove popup from stack. Probably should rework into .pop()
}
};
Comments
Comment #1
longwaveIE6 and 7 do not support the indexOf method on array objects, so the overlay is never removed. The attached patch replaces the indexOf call with an explicit loop through the array.
Comment #2
Anonymous (not verified) commentedI hate IE, but I love longwave.
Longwave shared this link in IRC, which may provide help to others who encounter this kind of problem in the future. http://soledadpenades.com/2007/05/17/arrayindexof-in-internet-explorer/
Comment #3
silurius commentedIf anyone can help me patch an alpha5 instance manually (text editor) I would be very grateful. I'd prefer to avoid the standard methods as it's it's been a long time, this is probably just one file and I have limited time. (Is this patch even viable for alpha5?)
Edited to add: Never mind, after studying the structure of the patch file I realized/remembered what the - and + symbols actually meant. :) I can confirm that the patch works here under alpha5 - fixes IE, doesn't break other browsers. One small thing to add to the issue: The gray overlay graphic does not cover the entire viewport. I run a zen fixed layout subtheme and when IE is full-screened, there are a couple of inches of web page visible outside the popup overlay on the left. (This part of the issue may only pertain to alpha5 for all I know).
Comment #4
gcassie commentedThanks, this was a big help. Fixed IE 6 & 7; FF 3 and Chrome are still happy.
Comment #5
pivica commentedTested and now it works for IE6&7. Thanks.
Comment #6
zoo33 commentedPatch tested, works great!
Comment #7
deviantintegral commentedThis patch also works for me.
Comment #8
RoboPhred commentedSince there is only one instance of the popup in the stack, the patch should break out of the for loop after it is found and spliced. There is no need to keep going down the array.
Comment #9
davidburnsthis patch worked for me as well, thanks.
Comment #10
jbrauer commentedThis patch resolved the issue with IE in my usage as well.
Comment #11
ghing commentedHere's a patch file that will work with the 6.x-2.0-alpha5 release.
Comment #12
turadg commentedAre the committers deliberating on committing this patch?
http://drupal.org/node/199723/committers
User Last commit First commit Commits
starbow 19 weeks ago 1 year ago 337 commits
Takafumi 47 weeks ago 47 weeks ago 2 commits
Comment #13
timtrinidad commentedAlternatively, you could use jQuery's inArray function instead of indexOf. (I didn't create a patch because I've already applied two other patches to popups.js...)
Change the line
Popups.popupStack.splice(Popups.popupStack.indexOf(popup), 1); // Remove popup from stack. Probably should rework into .pop()to
Popups.popupStack.splice(jQuery.inArray(popup,Popups.popupStack), 1); // Remove popup from stack. Probably should rework into .pop()Comment #14
millenniumtreew00t. Thanks longwave.
Comment #15
drasgardian commentedapplied patch from post #11 and it worked great.
Comment #16
dboulet commentedHere's a patch for the fix in #13.
Comment #17
greg.harveyI'm not sure about the latest patch. Is there any guarantee jquery will be available? I had a quick swizz through the module code and it seems to me full jquery is not necessarily available. I think this would require an additional piece of code to add jquery.js if it's not available already, and adding the whole of jquery.js might not be desired, when longwave's approach works just fine and has no dependencies...?
Comment #18
greg.harveyI'm a +1 for R&TBC for the patch in #11, btw. =)
EXCEPT! The file names at the top of the patch need sorting out - I would post, but don't want to confuse the current discussion point (jQuery or not jQuery?) ^^
Comment #19
greg.harveyI'm reliably informed (by longwave) that jquery is included anyway, so #16 should be cool. I've tested it and it works for me! =)
Comment #20
dboulet commentedjQuery is part of Drupal core, and is automatically added to the page whenever
drupal_add_js()is called—so yes, it is guaranteed to be available to all scripts in Drupal. Though the patch in #11 works, I think that a simpler solution that leverages jQuery makes more sense.Comment #21
dboulet commentedOops, cross-posted.
Comment #22
longwaveI was unaware that jQuery.inArray() existed when I first wrote the patch in #1, the patch in #16 is functionally the same but much cleaner to read than my version.
I've also sent a message to starbow asking to commit this patch as this issue has been around for six months now.
Comment #23
3cwebdev commentedsub
Comment #24
longwavePatch from #13 has been committed to the 6.x-2.x-dev branch.