Adding mailto directive

This commit is contained in:
Will Marshall
2014-04-30 11:41:53 +10:00
parent 149d0fc9b5
commit b6ffb863ce
2 changed files with 7 additions and 3 deletions

View File

@@ -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("")}"