mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
14 lines
430 B
CoffeeScript
14 lines
430 B
CoffeeScript
angular.module('Darkswarm').directive "helpModal", ($modal, $compile, $templateCache)->
|
|
restrict: 'A'
|
|
scope:
|
|
helpText: "@helpModal"
|
|
|
|
link: (scope, elem, attrs, ctrl)->
|
|
compiled = $compile($templateCache.get('help-modal.html'))(scope)
|
|
|
|
elem.on "click", =>
|
|
$modal.open(controller: ctrl, template: compiled, scope: scope, windowClass: 'help-modal small')
|
|
|
|
scope.$on "$destroy", ->
|
|
elem.off("click")
|