mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
See: https://stackoverflow.com/questions/23425254/enable-disable-anchor-tags-using-angularjs
13 lines
334 B
CoffeeScript
13 lines
334 B
CoffeeScript
# Allows disabling of link buttons via disabled attribute.
|
|
# This is normally ignored, ie the link appears disabled but is still clickable.
|
|
|
|
Darkswarm.directive "disableDynamically", ->
|
|
restrict: 'A'
|
|
|
|
link: (scope, element, attrs) ->
|
|
element.on 'click', (e) ->
|
|
if attrs.disabled
|
|
e.preventDefault()
|
|
return
|
|
|