Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f009edbb
Commit
f009edbb
authored
Sep 30, 2020
by
Enrique Alcantara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace BS Tooltips with tooltips facade
Replace all jQuery tooltip API calls with the tooltips facade API
parent
63a28a1e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+7
-3
app/assets/javascripts/tooltips/index.js
app/assets/javascripts/tooltips/index.js
+2
-0
No files found.
app/assets/javascripts/main.js
View file @
f009edbb
...
...
@@ -39,6 +39,8 @@ import initPersistentUserCallouts from './persistent_user_callouts';
import
{
initUserTracking
,
initDefaultTrackers
}
from
'
./tracking
'
;
import
{
__
}
from
'
./locale
'
;
import
*
as
tooltips
from
'
~/tooltips
'
;
import
'
ee_else_ce/main_ee
'
;
applyGitLabUIConfig
();
...
...
@@ -77,7 +79,7 @@ document.addEventListener('beforeunload', () => {
// Unbind scroll events
$
(
document
).
off
(
'
scroll
'
);
// Close any open tooltips
$
(
'
.has-tooltip, [data-toggle="tooltip"]
'
).
tooltip
(
'
dispose
'
);
tooltips
.
dispose
(
document
.
querySelectorAll
(
'
.has-tooltip, [data-toggle="tooltip"]
'
)
);
// Close any open popover
$
(
'
[data-toggle="popover"]
'
).
popover
(
'
dispose
'
);
});
...
...
@@ -133,8 +135,10 @@ function deferredInitialisation() {
addSelectOnFocusBehaviour
(
'
.js-select-on-focus
'
);
$
(
'
.remove-row
'
).
on
(
'
ajax:success
'
,
function
removeRowAjaxSuccessCallback
()
{
tooltips
.
dispose
(
this
);
// eslint-disable-next-line no-jquery/no-fade
$
(
this
)
.
tooltip
(
'
dispose
'
)
.
closest
(
'
li
'
)
.
fadeOut
();
});
...
...
@@ -154,7 +158,7 @@ function deferredInitialisation() {
const
delay
=
glTooltipDelay
?
JSON
.
parse
(
glTooltipDelay
)
:
0
;
// Initialize tooltips
$body
.
tooltip
({
tooltips
.
initTooltips
({
selector
:
'
.has-tooltip, [data-toggle="tooltip"]
'
,
trigger
:
'
hover
'
,
boundary
:
'
viewport
'
,
...
...
app/assets/javascripts/tooltips/index.js
View file @
f009edbb
...
...
@@ -58,6 +58,8 @@ const applyToElements = (elements, handler) => toArray(elements).forEach(handler
const
invokeBootstrapApi
=
(
elements
,
method
)
=>
{
if
(
isFunction
(
elements
.
tooltip
))
{
elements
.
tooltip
(
method
);
}
else
{
jQuery
(
elements
).
tooltip
(
method
);
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment