diff --git a/app/assets/javascripts/darkswarm/directives/mailto.js.coffee b/app/assets/javascripts/darkswarm/directives/mailto.js.coffee new file mode 100644 index 0000000000..27299005a9 --- /dev/null +++ b/app/assets/javascripts/darkswarm/directives/mailto.js.coffee @@ -0,0 +1,6 @@ +Darkswarm.directive "mailto", (Navigation)-> + restrict: 'A' + link: (scope, element, attrs)-> + element.bind 'click', (e)-> + e.preventDefault() + window.location.href = "mailto:#{attrs.href.split("").reverse().join("")}" diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index a09435efb3..eb655b7c37 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -13,9 +13,7 @@ %i.fi-social-linkedin LinkedIn    %p - %a.button.neutral-btn{href: '#', target: '_blank'} - %i.fi-at-sign - Email us at + %a{href: "hello@openfoodnetwork.org".reverse, target: '_blank', mailto: true} %span.email = "hello@openfoodnetwork.org".reverse .small-2.columns