Hi!
I have found that child.js would add target="_new" to links with href="javascript:whatever();", which causes an unwanted new browser tab to open every time the link is clicked.
A possible solution to this issue would be changing the conditional
if (!href || href.length <= 0 || href.charAt(0) == '#') return;
to
if (!href || href.length <= 0 || href.charAt(0) == '#' || href.indexOf('javascript:') > -1) return;

Should I fix it myself and submit the code or wait until the developer agrees with it? It's my first post in Drupal.org, so any help would be appreciated ^^.
Thanks!

Comments

lelizondo’s picture

I'm also getting this behavior

lelizondo’s picture

I couldn't find the lines you're referring to. I ended up changing the JS to not add the target

tobey_p’s picture

I was working on the same problem and did'nt noticed that there is already an issue for this.

I came up with a quite similar solution, but instead of "indexOf()" i used "substr()",
so its for sure that "javascript" is at the begining of the "href".
Additionally i added "toLowerCase()" to take into account that the keyword is maybe written uppercase.

Attached is a patch file.

modctek’s picture

subscribing

dsnopek’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)