diff options
author | Scott Hampton <shampton@gitlab.com> | 2019-02-25 11:25:00 -0700 |
---|---|---|
committer | Scott Hampton <shampton@gitlab.com> | 2019-02-25 11:25:00 -0700 |
commit | 506ac78d48b6a96081b02818c432650b8508913a (patch) | |
tree | 05b88ec9ee5757440deec46cc355970ac90ced5e | |
parent | 725dfc77c2ed241121666c8a708efb09122c287f (diff) | |
download | gitlab-ce-506ac78d48b6a96081b02818c432650b8508913a.tar.gz |
Adding tooltip placement
Adding the ability to position the tooltip of the status icon.
-rw-r--r-- | app/views/ci/status/_icon.html.haml | 15 | ||||
-rw-r--r-- | app/views/projects/issues/_merge_requests.html.haml | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/app/views/ci/status/_icon.html.haml b/app/views/ci/status/_icon.html.haml index 09ac086fa22..1fd34eacdf7 100644 --- a/app/views/ci/status/_icon.html.haml +++ b/app/views/ci/status/_icon.html.haml @@ -1,12 +1,13 @@ -- status = local_assigns.fetch(:status) -- size = local_assigns.fetch(:size, 16) -- link = local_assigns.fetch(:link, true) -- title = local_assigns.fetch(:title, "Pipeline: #{status.label}") -- css_classes = "ci-status-link ci-status-icon ci-status-icon-#{status.group} #{'has-tooltip' if title.present?}" +- status = local_assigns.fetch(:status) +- size = local_assigns.fetch(:size, 16) +- link = local_assigns.fetch(:link, true) +- title = local_assigns.fetch(:title, "Pipeline: #{status.label}") +- tooltip_placement = local_assigns.fetch(:tooltip_placement, "left") +- css_classes = "ci-status-link ci-status-icon ci-status-icon-#{status.group} #{'has-tooltip' if title.present?}" - if link && status.has_details? - = link_to status.details_path, class: css_classes, title: title, data: { html: title.present? } do + = link_to status.details_path, class: css_classes, title: title, data: { html: title.present?, placement: tooltip_placement } do = sprite_icon(status.icon, size: size) - else - %span{ class: css_classes, title: title, data: { html: title.present? } } + %span{ class: css_classes, title: title, data: { html: title.present?, placement: tooltip_placement } } = sprite_icon(status.icon, size: size) diff --git a/app/views/projects/issues/_merge_requests.html.haml b/app/views/projects/issues/_merge_requests.html.haml index ab3d7907ad8..7468217418d 100644 --- a/app/views/projects/issues/_merge_requests.html.haml +++ b/app/views/projects/issues/_merge_requests.html.haml @@ -27,7 +27,7 @@ = merge_request.to_reference %span.mr-ci-status.flex-md-grow-1.justify-content-end.d-flex.ml-md-2 - if merge_request.can_read_pipeline? - = render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user), link: true + = render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user), link: true, tooltip_placement: 'bottom' - elsif has_any_head_pipeline = icon('blank fw') |