Files
openfoodnetwork/app/views/admin/shared/_tooltip.html.haml
Gaetan Craig-Riou 561f4648d2 Improve tooltip partial
Set up default value optiona locals variable
2024-09-10 13:29:39 +10:00

11 lines
501 B
Plaintext

- tooltip_placement = defined?(placement) ? placement : "top"
- tooltip_link = defined?(link) ? link : ""
- tooltip_link_class = defined?(link_class) ? link_class : ""
%div{"data-controller": "tooltip", "data-tooltip-placement-value": tooltip_placement }
%a{"data-tooltip-target": "element", href: tooltip_link, class: tooltip_link_class}
= link_text
.tooltip-container
.tooltip{"data-tooltip-target": "tooltip"}
= sanitize tooltip_text
.arrow{"data-tooltip-target": "arrow"}