diff --git a/frontend/src/utils/tooltips/tooltips.scss b/frontend/src/utils/tooltips/tooltips.scss index 4ab2393cf..845c33310 100644 --- a/frontend/src/utils/tooltips/tooltips.scss +++ b/frontend/src/utils/tooltips/tooltips.scss @@ -1,7 +1,7 @@ .tooltip { position: relative; display: inline-block; - vertical-align: -0.375rem; + vertical-align: middle; &:hover .tooltip__content { display: inline-block; @@ -55,8 +55,6 @@ } .tooltip.tooltip__inline { - vertical-align: middle; - .tooltip__handle { height: 1.0rem; line-height: 1.0rem; diff --git a/src/Handler/Info.hs b/src/Handler/Info.hs index 8605722db..33c0ca262 100644 --- a/src/Handler/Info.hs +++ b/src/Handler/Info.hs @@ -54,7 +54,7 @@ getInfoLecturerR = tooltipPlanned = toWidget [whamlet| _{MsgLecturerInfoTooltipPlanned} |] tooltipNewU2W = toWidget [whamlet| _{MsgLecturerInfoTooltipNewU2W} |] newFeat, plannedFeat, newU2WFeat :: WidgetFor UniWorX () - newFeat = toWidget [whamlet| ^{iconTooltip tooltipNew (Just IconNew)} |] - -- probFeat = toWidget [whamlet| ^{iconTooltip tooltipProblem (Just IconProblem)} |] - plannedFeat = toWidget [whamlet| ^{iconTooltip tooltipPlanned (Just IconPlanned)} |] - newU2WFeat = toWidget [whamlet| ^{iconTooltip tooltipNewU2W (Just IconAnnounce)} |] + newFeat = toWidget [whamlet| ^{iconTooltip tooltipNew (Just IconNew) False} |] + -- probFeat = toWidget [whamlet| ^{iconTooltip tooltipProblem (Just IconProblem) False} |] + plannedFeat = toWidget [whamlet| ^{iconTooltip tooltipPlanned (Just IconPlanned) False} |] + newU2WFeat = toWidget [whamlet| ^{iconTooltip tooltipNewU2W (Just IconAnnounce) True} |] -- to be used inside text blocks diff --git a/src/Utils/Icon.hs b/src/Utils/Icon.hs index 7f94f96d2..4d9165018 100644 --- a/src/Utils/Icon.hs +++ b/src/Utils/Icon.hs @@ -119,12 +119,13 @@ icon ic = [shamlet| |] -- Create an icon (defaults to "?") with a specified tooltip -iconTooltip :: forall site. WidgetFor site () -> Maybe Icon -> WidgetFor site () -iconTooltip tooltip mIcon = let ic = iconText $ case mIcon of - Nothing -> IconTooltipDefault - Just i -> i - urgency = "urgency__info" :: Text - in $(whamletFile "templates/widgets/tooltip.hamlet") +iconTooltip :: forall site. WidgetFor site () -> Maybe Icon -> Bool -> WidgetFor site () +iconTooltip tooltip mIcon isInlineTooltip = let + ic = iconText $ case mIcon of + Nothing -> IconTooltipDefault + Just i -> i + urgency = "urgency__info" :: Text + in $(whamletFile "templates/widgets/tooltip.hamlet") -- declare constats for all icons for compatibility and convenience -- "IconCourse" generates "iconCourse = icon IconCourse" diff --git a/src/Utils/Message.hs b/src/Utils/Message.hs index 95847be30..3a126690d 100644 --- a/src/Utils/Message.hs +++ b/src/Utils/Message.hs @@ -203,4 +203,5 @@ messageTooltip Message{..} = let urgency = statusToUrgencyClass messageStatus Utils.Message.Info -> IconTooltipDefault Just i -> i tooltip = toWidget messageContent :: WidgetFor site () + isInlineTooltip = False in $(whamletFile "templates/widgets/tooltip.hamlet") diff --git a/templates/adminTest.hamlet b/templates/adminTest.hamlet index e00d0c6ef..45d994a0c 100644 --- a/templates/adminTest.hamlet +++ b/templates/adminTest.hamlet @@ -8,7 +8,7 @@ Der Handler sollte jeweils aktuelle Beispiele für alle möglichen Funktionalitäten enthalten, so dass man immer weiß, wo man nachschlagen kann.
- ^{iconTooltip testTooltipMsg Nothing} + ^{iconTooltip testTooltipMsg Nothing False} ^{messageTooltip msgInfoTooltip} ^{messageTooltip msgSuccessTooltip} ^{messageTooltip msgWarningTooltip} diff --git a/templates/widgets/multiFileField.hamlet b/templates/widgets/multiFileField.hamlet index a50d57d4c..e1695557d 100644 --- a/templates/widgets/multiFileField.hamlet +++ b/templates/widgets/multiFileField.hamlet @@ -20,6 +20,6 @@ $# new files _{MsgMultiFileUploadInfo}