From 0c2f58fa42956c55745fb13cf7a3dbe9deb03713 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 1 Oct 2019 15:17:14 +0200 Subject: [PATCH] style(tooltips): content to the right and fixed width --- frontend/src/utils/tooltips/tooltips.scss | 4 ++-- src/Utils/Message.hs | 6 +++++- templates/widgets/tooltip.hamlet | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/utils/tooltips/tooltips.scss b/frontend/src/utils/tooltips/tooltips.scss index 148e3c5f4..b659b4d43 100644 --- a/frontend/src/utils/tooltips/tooltips.scss +++ b/frontend/src/utils/tooltips/tooltips.scss @@ -61,7 +61,7 @@ display: none; top: -10px; transform: translateY(-100%); - right: 3px; + left: 3px; width: 275px; z-index: 10; background-color: #fafafa; @@ -76,7 +76,7 @@ background-color: #fafafa; transform: rotate(45deg); position: absolute; - right: 10px; + left: 10px; bottom: -8px; } } diff --git a/src/Utils/Message.hs b/src/Utils/Message.hs index ee4278c70..95847be30 100644 --- a/src/Utils/Message.hs +++ b/src/Utils/Message.hs @@ -196,7 +196,11 @@ getMessages = fmap decodeMessage <$> ClassyPrelude.Yesod.getMessages messageTooltip :: forall site. Message -> WidgetFor site () messageTooltip Message{..} = let urgency = statusToUrgencyClass messageStatus ic = iconText $ case messageIcon of - Nothing -> IconWarning + Nothing -> case messageStatus of + Utils.Message.Error -> IconProblem + Utils.Message.Warning -> IconWarning + Utils.Message.Success -> IconOK + Utils.Message.Info -> IconTooltipDefault Just i -> i tooltip = toWidget messageContent :: WidgetFor site () in $(whamletFile "templates/widgets/tooltip.hamlet") diff --git a/templates/widgets/tooltip.hamlet b/templates/widgets/tooltip.hamlet index fc92c5717..7dedb05c2 100644 --- a/templates/widgets/tooltip.hamlet +++ b/templates/widgets/tooltip.hamlet @@ -1,7 +1,7 @@ $newline never
-
+
^{tooltip}