Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
948a7466
Commit
948a7466
authored
Aug 01, 2014
by
Chris Rebert
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14299 from twbs/fix-14076
Add unit test for tooltips on SVG elements
parents
de1d8c36
08393bf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
js/tests/unit/tooltip.js
js/tests/unit/tooltip.js
+36
-0
No files found.
js/tests/unit/tooltip.js
View file @
948a7466
...
@@ -739,4 +739,40 @@ $(function () {
...
@@ -739,4 +739,40 @@ $(function () {
$tooltip
.
trigger
(
'
mouseenter
'
)
$tooltip
.
trigger
(
'
mouseenter
'
)
})
})
test
(
'
should correctly position tooltips on SVG elements
'
,
function
()
{
if
(
!
window
.
SVGElement
)
{
// Skip IE8 since it doesn't support SVG
expect
(
0
)
return
}
stop
()
var
styles
=
'
<style>
'
+
'
.tooltip, .tooltip *, .tooltip *:before, .tooltip *:after { box-sizing: border-box; }
'
+
'
.tooltip { position: absolute; }
'
+
'
.tooltip .tooltip-inner { width: 24px; height: 24px; font-family: Helvetica; }
'
+
'
</style>
'
var
$styles
=
$
(
styles
).
appendTo
(
'
head
'
)
$
(
'
#qunit-fixture
'
).
append
(
'
<div style="position: fixed; top: 0; left: 0;">
'
+
'
<svg width="200" height="200">
'
+
'
<circle cx="100" cy="100" r="10" title="m" id="theCircle" />
'
+
'
</svg>
'
+
'
</div>
'
)
var
$circle
=
$
(
'
#theCircle
'
)
$circle
.
on
(
'
shown.bs.tooltip
'
,
function
()
{
var
offset
=
$
(
'
.tooltip
'
).
offset
()
$styles
.
remove
()
ok
(
Math
.
abs
(
offset
.
left
-
88
)
<=
1
,
'
tooltip has correct horizontal location
'
)
start
()
})
.
bootstrapTooltip
({
container
:
'
body
'
,
placement
:
'
top
'
,
trigger
:
'
manual
'
})
$circle
.
bootstrapTooltip
(
'
show
'
)
})
})
})
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