Files
openfoodnetwork/app/assets/javascripts/darkswarm/directives/help_modal.js.coffee
Rob Harrington 32622c77bc Add basic help modal directive
Useful for showing help text that is too long for a tool tip
2018-06-22 15:39:47 +10:00

11 lines
358 B
CoffeeScript

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')