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
db9ec13c
Commit
db9ec13c
authored
Jan 26, 2013
by
Guillaume Gautreau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for replacing tooltip when resized
parent
e5be883b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
6 deletions
+44
-6
js/tests/index.html
js/tests/index.html
+3
-0
js/tests/unit/bootstrap-tooltip.css
js/tests/unit/bootstrap-tooltip.css
+13
-0
js/tests/unit/bootstrap-tooltip.js
js/tests/unit/bootstrap-tooltip.js
+28
-6
No files found.
js/tests/index.html
View file @
db9ec13c
...
...
@@ -29,6 +29,9 @@
<script
src=
"../../js/bootstrap-typeahead.js"
></script>
<script
src=
"../../js/bootstrap-affix.js"
></script>
<!-- Needed for testing -->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"unit/bootstrap-tooltip.css"
/>
<!-- unit tests -->
<script
src=
"unit/bootstrap-transition.js"
></script>
<script
src=
"unit/bootstrap-alert.js"
></script>
...
...
js/tests/unit/bootstrap-tooltip.css
0 → 100644
View file @
db9ec13c
.tooltip
{
position
:
absolute
;
}
.tooltip-inner
{
max-width
:
200px
;
}
.tooltip.top
.tooltip-arrow
{
position
:
absolute
;
}
\ No newline at end of file
js/tests/unit/bootstrap-tooltip.js
View file @
db9ec13c
...
...
@@ -253,11 +253,12 @@ $(function () {
})
test
(
"
should place tooltip inside window
"
,
function
(){
$
(
"
#qunit-fixture
"
).
show
();
var
tooltip
=
$
(
"
<a href='#' title='Very very very very very very very very long tooltip'></a>
"
)
var
container
=
$
(
"
<div />
"
).
appendTo
(
"
body
"
)
.
css
({
position
:
"
absolute
"
,
width
:
200
,
height
:
200
,
bottom
:
0
,
left
:
0
})
,
tooltip
=
$
(
"
<a href='#' title='Very very very very very very very very long tooltip'>Hover me</a>
"
)
.
css
({
position
:
"
absolute
"
,
top
:
0
,
left
:
0
})
.
appendTo
(
"
#qunit-fixture
"
)
.
tooltip
({
placement
:
"
top
"
})
.
appendTo
(
container
)
.
tooltip
({
placement
:
"
top
"
,
animate
:
false
})
.
tooltip
(
"
show
"
);
stop
();
...
...
@@ -266,7 +267,28 @@ $(function () {
ok
(
$
(
"
.tooltip
"
).
offset
().
left
>=
0
);
start
();
$
(
"
#qunit-fixture
"
).
hid
e
();
},
2
00
)
container
.
remov
e
();
},
1
00
)
});
test
(
"
should place tooltip on top of element
"
,
function
(){
var
container
=
$
(
"
<div />
"
).
appendTo
(
"
body
"
)
.
css
({
position
:
"
absolute
"
,
bottom
:
0
,
left
:
0
,
textAlign
:
"
right
"
,
width
:
300
,
height
:
300
})
,
p
=
$
(
"
<p style='margin-top:200px' />
"
).
appendTo
(
container
)
,
tooltiped
=
$
(
"
<a href='#' title='very very very very very very very long tooltip'>Hover me</a>
"
)
.
css
({
marginTop
:
200
})
.
appendTo
(
p
)
.
tooltip
({
placement
:
"
top
"
,
animate
:
false
})
.
tooltip
(
"
show
"
);
stop
();
setTimeout
(
function
(){
var
tooltip
=
container
.
find
(
"
.tooltip
"
);
start
();
ok
(
tooltip
.
offset
().
top
+
tooltip
.
outerHeight
()
<=
tooltiped
.
offset
().
top
);
container
.
remove
();
},
100
)
})
})
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