Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let buttons open in new tab #52

Closed
danbrellis opened this issue Jun 7, 2016 · 1 comment
Closed

Let buttons open in new tab #52

danbrellis opened this issue Jun 7, 2016 · 1 comment

Comments

@danbrellis
Copy link

Looking through the source code, I see how buttons are converted to anchor tags in componentFactory.js. Yet, there is no way to set target="_blank". I think this could be an easy addition and for my purposes, useful. Basically, if I wanted to take my email and host it on my website as a sort of archive, it would be beneficial to have certain links open in a new tab.

Something simple, like this starting at line 29 under case this.components.button:

var target = '';

if (element.attr('target')) {
    target = ' target="' + element.attr('target') + '"';
}

// If we have the href attribute we can create an anchor for the inner of the button;
if (element.attr('href')) {
    inner = format('<a href="%s"%s>%s</a>', element.attr('href'), target, inner);
}
@rafibomb
Copy link
Member

rafibomb commented Jun 8, 2016

Looks there was a PR merged for this already #42
It will go out with 2.2 this month!

@rafibomb rafibomb closed this as completed Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants