Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
field_description_tooltip
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
field_description_tooltip
Merge requests
!12
Issue
#3354359
: How to Position tooltip to above the icon?
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3354359
: How to Position tooltip to above the icon?
issue/field_description_tooltip-3354359:3354359-how-to-position
into
1.x
Overview
0
Commits
1
Pipelines
0
Changes
5
Merged
Andrei Vesterli
requested to merge
issue/field_description_tooltip-3354359:3354359-how-to-position
into
1.x
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
5
Expand
0
0
Merge request reports
Compare
1.x
version 1
9e845859
2 years ago
1.x (base)
and
latest version
latest version
9e845859
1 commit,
2 years ago
version 1
9e845859
1 commit,
2 years ago
5 files
+
81
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
js/tooltip.js
+
11
−
2
Options
@@ -10,7 +10,7 @@
// Check if there are any fields that are configured as tooltip.
if
(
tooltipFields
.
length
)
{
tooltipFields
.
each
(
function
()
{
$
(
once
(
'
fieldDescriptionTooltip
'
,
tooltipFields
,
context
))
.
each
(
function
()
{
let
description
=
$
(
this
).
find
(
'
[data-drupal-field-elements="description"], [class*="description"]
'
);
// Check if there is a description available in order to start the
@@ -22,11 +22,20 @@
let
lineBreak
=
'
<br />
'
;
// Remove the description text and move it to the "title" attribute.
$
(
this
).
html
(
'
<img width="20" src="/
'
+
settings
.
fieldDescriptionTooltip
.
img
+
'
" />
'
);
$
(
this
).
attr
(
'
title
'
,
tooltipText
);
$
(
this
).
html
(
'
<img width="20" src="/
'
+
settings
.
fieldDescriptionTooltip
.
img
+
'
" />
'
);
// Set the tooltip position.
let
position_my
=
settings
.
fieldDescriptionTooltip
.
position
.
my_1
+
'
'
+
settings
.
fieldDescriptionTooltip
.
position
.
my_2
;
let
position_at
=
settings
.
fieldDescriptionTooltip
.
position
.
at_1
+
'
'
+
settings
.
fieldDescriptionTooltip
.
position
.
at_2
;
// Add the tooltip js trigger.
$
(
this
).
tooltip
({
position
:
{
my
:
position_my
,
at
:
position_at
},
effect
:
"
slideDown
"
,
show
:
{
effect
:
"
slideDown
"
},
// For any custom styling.
tooltipClass
:
"
description-tooltip
"
,
Loading