create a new directive: question mark with tooltip

- Display a rounded blue question mark icon
 - Show (hide) on click a blue tooltip on top of the question mark icon
This commit is contained in:
Jean-Baptiste Bellet
2021-02-12 17:14:00 +01:00
parent 7442d06bed
commit 4be2b42fe1
6 changed files with 58 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
Darkswarm.directive "questionMarkWithTooltip", ($tooltip)->
# We use the $tooltip service from Angular foundation to give us boilerplate
# Subsequently we patch the scope, template and restrictions
tooltip = $tooltip 'questionMarkWithTooltip', 'questionMarkWithTooltip', 'click'
tooltip.scope =
variant: "="
tooltip.templateUrl = "question_mark_with_tooltip_icon.html"
tooltip.replace = true
tooltip.restrict = 'E'
tooltip
# This is automatically referenced via naming convention in $tooltip
Darkswarm.directive 'questionMarkWithTooltipPopup', ->
restrict: 'EA'
replace: true
templateUrl: 'question_mark_with_tooltip.html'
scope: false

View File

@@ -0,0 +1,8 @@
.joyride-tip-guide.question-mark-tooltip{ng: {class: "{ in: tt_isOpen, fade: tt_animation }", show: "tt_isOpen"}}
.background{ng: {click: "tt_isOpen = false"}}
.joyride-content-wrapper
This is the unit price of this item.
%br/
It allows you to compare the price of products across varying sizes and weights.
%span.joyride-nub.bottom

View File

@@ -0,0 +1 @@
%button.question-mark-icon{"ng-class" => "{open: tt_isOpen}", type: 'button'}