Use specific link in open_link_as_overlay();

Post

Posted
Rating:
#4331 (In Topic #871)
Joe
BLOCK_TOP_LOGIN.tpl displays the "options" link (only viewable to guests) and uses open_link_as_overlay(this); to open a popup overlay allowing the user to set options prior to logging in (such as logging in using FB, etc):

Code

<a &#111;nclick="return open_link_as_overlay(this);" rel="nofollow" href="{FULL_LOGIN_URL*}" title="{!MORE}: {!_LOGIN}">{$?,{$MOBILE},{!_LOGIN},{!OPTIONS}}</a>

I've replaced that with a button tag, but I can't seem to implement the overlay functionality when using a button in place of the default anchor tag. You can't add the href attribute to a button tag, you can't nest the button tag under an anchor tag (and remain standards compliant). The only logical solution I could think of is nesting the button within a form and placing {FULL_LOGIN_URL*} within the forms action attribute, then use onclick="return open_link_as_overlay(this);" on the button. But, all this did when I tried it was reload the main page and completely ignored open_link_as_overlay(this);.

Is there a way to define a specific link within open_link_as_overlay();? Using onclick="return open_link_as_overlay('https://mylink.com');" didn't seem to work either.

Post

Posted
Rating:
#4338
open_link_as_overlay is just a front-end to faux_open.

onclick="faux_open(some_url);"

Documentation you might read about JavaScript's 'standard' window.open method is mostly applicable to faux_open, which is designed to emulate it for our overlays (instead of new windows).

Post

Posted
Rating:
#4342
Joe
Doesn't work. :(

When I use faux_open(https://google.com);, I get this error:
1: SyntaxError: missing ) after argument list

If I add single quotes, like: faux_open('https://google.com');, I get this error:
120: TypeError: this.width is null

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Adam Edington)
#4343
Joe
Think I've figured it out. I have to manually define the height and width, and add a wide_high=1 to hide the header, but it does the job:

onclick="faux_open('https://composr.app/login.htm?wide_high=1','','width=500,height=500,status=yes,resizable=yes,scrollbars=yes');"

Post

Posted
Rating:
#4344
Yeah, good job.
0 guests and 0 members have recently viewed this.