I'm using the Automodal module, and when linking to other nodes from an modal frame, it's opening the content into a new window/tab instead of the parent window/tab. I think it's related to this issue #1166990: target="_new" incorrectly added to javascript actions, as I made a change to line 112 changing the target from "_new" to "_top" as a test, and the modal links behave as I expected.

Am I using the two modules incorrectly or is this a bug?

Comments

thedavidmeister’s picture

Version: 6.x-1.7 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new363 bytes

thanks, this was causing problems for me in two ways.

I'm trying to display a signup form inside a modal frame and

1. I'm using legal, which has a link to the site's T&C that i don't want to open in a new tab
2. I'm using the chozen javascript library to style my dropdown menus and the markup contains links that completely break without this fix.

patch attached is rolled against dev version of modal frame for D6.

Is there some reason that links are opened in a new tab? it seems to me to be one of those behaviours that people instinctively assume "should" happen without any other great reason, so there should be no harm in overriding it, but of course I don't actually know in this case.

lelizondo’s picture

StatusFileSize
new363 bytes

patch didn't work for me although the solution did. I'm attaching a new patch with the same solution

Edit: both patches are identical. I wasn't applying the patch correctly.

thedavidmeister’s picture

:P

thedavidmeister’s picture

so now I need legal to open in a new tab, but I still don't want my themed dropdowns to break.

This patch addresses my concern with the javascript library I was using by not parsing links that contain "javascript" as the href in this case is "javascript:void();"

Also, I'm using _blank instead of _new as _blank is actually in the HTML spec whereas _new is not.

dsnopek’s picture

Title: New window being opened when linking from modal » Use _blank instead of _new and ignore 'javascript:' links.
Issue summary: View changes
Status: Needs review » Fixed

Patch in #4 looks good, thanks! Committed in 1650917.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.