mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-27 06:05:19 +00:00
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:
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
%button.question-mark-icon{"ng-class" => "{open: tt_isOpen}", type: 'button'}
|
||||
Reference in New Issue
Block a user