Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
92959878
Commit
92959878
authored
12 years ago
by
Guillaume Gautreau
Browse files
Options
Download
Email Patches
Plain Diff
Unit test for replacing tooltip inside window
parent
6803ff70
2 merge requests
!6821
Typeahead updater
,
!6713
Positioning tooltip on edge case
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/bootstrap-tooltip.js
+1
-1
js/bootstrap-tooltip.js
js/tests/unit/bootstrap-tooltip.js
+18
-0
js/tests/unit/bootstrap-tooltip.js
with
19 additions
and
1 deletion
+19
-1
js/bootstrap-tooltip.js
+
1
-
1
View file @
92959878
...
...
@@ -190,7 +190,7 @@
if
(
offset
.
left
<
0
){
delta
=
-
offset
.
left
*
2
;
offset
.
left
=
0
;
offset
.
left
=
.
1
;
$tip
.
offset
(
offset
);
actualWidth
=
$tip
[
0
].
offsetWidth
;
actualHeight
=
$tip
[
0
].
offsetHeight
;
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/bootstrap-tooltip.js
+
18
-
0
View file @
92959878
...
...
@@ -251,4 +251,22 @@ $(function () {
ok
(
!
$
(
"
#qunit-fixture > .tooltip
"
).
length
,
'
not found in parent
'
)
tooltip
.
tooltip
(
'
hide
'
)
})
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>
"
)
.
css
({
position
:
"
absolute
"
,
top
:
0
,
left
:
0
})
.
appendTo
(
"
#qunit-fixture
"
)
.
tooltip
({
placement
:
"
top
"
})
.
tooltip
(
"
show
"
);
stop
();
setTimeout
(
function
(){
ok
(
$
(
"
.tooltip
"
).
offset
().
left
>=
0
);
start
();
$
(
"
#qunit-fixture
"
).
hide
();
},
200
)
});
})
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
Menu
Explore
Projects
Groups
Snippets