Switch help modals from angular templates to use ViewComponent and StimulusJs

This commit is contained in:
Cillian O'Ruanaidh
2022-03-23 15:34:39 +00:00
committed by Maikel Linke
parent 268a73a41d
commit 4162830bee
23 changed files with 299 additions and 140 deletions

View File

@@ -1,20 +0,0 @@
angular.module("admin.utils").directive 'helpModal', ($rootScope, $compile, $templateCache, $window, DialogDefaults) ->
restrict: 'C'
scope:
template: '@'
link: (scope, element, attr) ->
# Compile modal template
template = $compile($templateCache.get(scope.template))(scope)
# Load Dialog Options
template.dialog(DialogDefaults)
# Link opening of dialog to click event on element
element.bind 'click', (e) ->
template.dialog('open')
$rootScope.$evalAsync()
scope.close = ->
template.dialog('close')
$rootScope.$evalAsync()
return