mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
12 lines
373 B
CoffeeScript
12 lines
373 B
CoffeeScript
angular.module('Darkswarm').directive 'auth', (AuthenticationService) ->
|
|
restrict: 'A'
|
|
link: (scope, elem, attrs) ->
|
|
elem.bind "click", ->
|
|
AuthenticationService.open '/' + attrs.auth
|
|
|
|
window.addEventListener "login:modal:open", ->
|
|
AuthenticationService.open '/login'
|
|
|
|
scope.$on "$destroy", ->
|
|
window.removeEventListener "login:modal:open"
|