mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
19 lines
451 B
CoffeeScript
19 lines
451 B
CoffeeScript
Darkswarm.directive "ofnModal", ($modal)->
|
|
restrict: 'E'
|
|
replace: true
|
|
transclude: true
|
|
template: "<a>{{title}}</a>"
|
|
|
|
link: (scope, elem, attrs, ctrl, transclude)->
|
|
scope.title = attrs.title
|
|
|
|
contents = null
|
|
transclude scope, (clone)->
|
|
contents = clone
|
|
|
|
scope.cancel = ->
|
|
scope.modalInstance.dismiss("cancel")
|
|
|
|
elem.on "click", ->
|
|
scope.modalInstance = $modal.open(controller: ctrl, template: contents)
|