Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
db9ec13c
Commit
db9ec13c
authored
12 years ago
by
Guillaume Gautreau
Browse files
Options
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
js/tests/index.html
+3
-0
js/tests/index.html
js/tests/unit/bootstrap-tooltip.css
+13
-0
js/tests/unit/bootstrap-tooltip.css
js/tests/unit/bootstrap-tooltip.js
+28
-6
js/tests/unit/bootstrap-tooltip.js
with
44 additions
and
6 deletions
+44
-6
js/tests/index.html
+
3
-
0
View file @
db9ec13c
...
@@ -29,6 +29,9 @@
...
@@ -29,6 +29,9 @@
<script
src=
"../../js/bootstrap-typeahead.js"
></script>
<script
src=
"../../js/bootstrap-typeahead.js"
></script>
<script
src=
"../../js/bootstrap-affix.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 -->
<!-- unit tests -->
<script
src=
"unit/bootstrap-transition.js"
></script>
<script
src=
"unit/bootstrap-transition.js"
></script>
<script
src=
"unit/bootstrap-alert.js"
></script>
<script
src=
"unit/bootstrap-alert.js"
></script>
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/bootstrap-tooltip.css
0 → 100644
+
13
-
0
View file @
db9ec13c
.tooltip
{
position
:
absolute
;
}
.tooltip-inner
{
max-width
:
200px
;
}
.tooltip.top
.tooltip-arrow
{
position
:
absolute
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/tests/unit/bootstrap-tooltip.js
+
28
-
6
View file @
db9ec13c
...
@@ -253,11 +253,12 @@ $(function () {
...
@@ -253,11 +253,12 @@ $(function () {
})
})
test
(
"
should place tooltip inside window
"
,
function
(){
test
(
"
should place tooltip inside window
"
,
function
(){
$
(
"
#qunit-fixture
"
).
show
();
var
container
=
$
(
"
<div />
"
).
appendTo
(
"
body
"
)
var
tooltip
=
$
(
"
<a href='#' title='Very very very very very very very very long tooltip'></a>
"
)
.
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
})
.
css
({
position
:
"
absolute
"
,
top
:
0
,
left
:
0
})
.
appendTo
(
"
#qunit-fixture
"
)
.
appendTo
(
container
)
.
tooltip
({
placement
:
"
top
"
})
.
tooltip
({
placement
:
"
top
"
,
animate
:
false
})
.
tooltip
(
"
show
"
);
.
tooltip
(
"
show
"
);
stop
();
stop
();
...
@@ -266,7 +267,28 @@ $(function () {
...
@@ -266,7 +267,28 @@ $(function () {
ok
(
$
(
"
.tooltip
"
).
offset
().
left
>=
0
);
ok
(
$
(
"
.tooltip
"
).
offset
().
left
>=
0
);
start
();
start
();
$
(
"
#qunit-fixture
"
).
hid
e
();
container
.
remov
e
();
},
2
00
)
},
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
)
})
})
})
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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