mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Add basic help modal directive
Useful for showing help text that is too long for a tool tip
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
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')
|
||||
9
app/assets/javascripts/templates/help-modal.html.haml
Normal file
9
app/assets/javascripts/templates/help-modal.html.haml
Normal file
@@ -0,0 +1,9 @@
|
||||
.row.help-icon
|
||||
.small-12.text-center
|
||||
%i.ofn-i_013-help
|
||||
.row.help-text
|
||||
.small-12.columns.text-center
|
||||
{{ helpText }}
|
||||
.row.text-center
|
||||
%button.primary.small{ ng: { click: '$close()' } }
|
||||
= t(:ok)
|
||||
9
app/assets/stylesheets/darkswarm/help-modal.css.scss
Normal file
9
app/assets/stylesheets/darkswarm/help-modal.css.scss
Normal file
@@ -0,0 +1,9 @@
|
||||
.help-modal {
|
||||
.help-text {
|
||||
font-size: 1rem;
|
||||
margin: 20px 0px;
|
||||
}
|
||||
.help-icon {
|
||||
font-size: 4rem;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user