Improve email javascript in sidebar (#155)

This will appear in Firefox and Safari.

Remediates the issue describe here: https://stackoverflow.com/questions/21461589/javascript-mailto-using-window-open#32675594
This commit is contained in:
Marnick Vandecauter 2020-10-18 16:10:27 +00:00 committed by GitHub
parent b9fb716e6a
commit 46a8efb38a

View file

@ -72,7 +72,7 @@
https://twitter.com/{{ site.twitter.username }} https://twitter.com/{{ site.twitter.username }}
{%- elsif entry.type == 'email' -%} {%- elsif entry.type == 'email' -%}
{% assign email = site.social.email | split: '@' %} {% assign email = site.social.email | split: '@' %}
javascript:window.open('mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')) javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
{%- elsif entry.type == 'rss' -%} {%- elsif entry.type == 'rss' -%}
{{ "/feed.xml" | relative_url }} {{ "/feed.xml" | relative_url }}
{%- else -%} {%- else -%}
@ -87,4 +87,4 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>