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
e9c83647
Commit
e9c83647
authored
Jul 24, 2013
by
Jacob Thornton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #8568 -- account for margins in offset
parent
aad91046
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
31 deletions
+17
-31
dist/js/bootstrap.js
dist/js/bootstrap.js
+8
-15
dist/js/bootstrap.min.js
dist/js/bootstrap.min.js
+1
-1
js/tooltip.js
js/tooltip.js
+8
-15
No files found.
dist/js/bootstrap.js
View file @
e9c83647
...
@@ -1191,7 +1191,6 @@
...
@@ -1191,7 +1191,6 @@
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
var
tp
var
pos
=
this
.
getPosition
()
var
pos
=
this
.
getPosition
()
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualHeight
=
$tip
[
0
].
offsetHeight
var
actualHeight
=
$tip
[
0
].
offsetHeight
...
@@ -1216,20 +1215,10 @@
...
@@ -1216,20 +1215,10 @@
.
addClass
(
placement
)
.
addClass
(
placement
)
}
}
switch
(
placement
)
{
var
tp
=
placement
==
'
bottom
'
?
{
top
:
pos
.
top
+
pos
.
height
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
:
case
'
bottom
'
:
placement
==
'
top
'
?
{
top
:
pos
.
top
-
actualHeight
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
:
tp
=
{
top
:
pos
.
top
+
pos
.
height
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
placement
==
'
left
'
?
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
-
actualWidth
}
:
break
/* placement == 'right' */
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
+
pos
.
width
}
case
'
top
'
:
tp
=
{
top
:
pos
.
top
-
actualHeight
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
break
case
'
left
'
:
tp
=
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
-
actualWidth
}
break
case
'
right
'
:
tp
=
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
+
pos
.
width
}
break
}
this
.
applyPlacement
(
tp
,
placement
)
this
.
applyPlacement
(
tp
,
placement
)
this
.
$element
.
trigger
(
'
shown.bs.
'
+
this
.
type
)
this
.
$element
.
trigger
(
'
shown.bs.
'
+
this
.
type
)
...
@@ -1242,6 +1231,10 @@
...
@@ -1242,6 +1231,10 @@
var
width
=
$tip
[
0
].
offsetWidth
var
width
=
$tip
[
0
].
offsetWidth
var
height
=
$tip
[
0
].
offsetHeight
var
height
=
$tip
[
0
].
offsetHeight
// manually read margins because getBoundingClientRect includes difference
offset
.
top
=
offset
.
top
+
parseInt
(
$tip
.
css
(
'
margin-top
'
),
10
)
offset
.
left
=
offset
.
left
+
parseInt
(
$tip
.
css
(
'
margin-left
'
),
10
)
$tip
$tip
.
offset
(
offset
)
.
offset
(
offset
)
.
addClass
(
'
in
'
)
.
addClass
(
'
in
'
)
...
...
dist/js/bootstrap.min.js
View file @
e9c83647
This diff is collapsed.
Click to expand it.
js/tooltip.js
View file @
e9c83647
...
@@ -155,7 +155,6 @@
...
@@ -155,7 +155,6 @@
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
var
tp
var
pos
=
this
.
getPosition
()
var
pos
=
this
.
getPosition
()
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualHeight
=
$tip
[
0
].
offsetHeight
var
actualHeight
=
$tip
[
0
].
offsetHeight
...
@@ -180,20 +179,10 @@
...
@@ -180,20 +179,10 @@
.
addClass
(
placement
)
.
addClass
(
placement
)
}
}
switch
(
placement
)
{
var
tp
=
placement
==
'
bottom
'
?
{
top
:
pos
.
top
+
pos
.
height
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
:
case
'
bottom
'
:
placement
==
'
top
'
?
{
top
:
pos
.
top
-
actualHeight
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
:
tp
=
{
top
:
pos
.
top
+
pos
.
height
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
placement
==
'
left
'
?
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
-
actualWidth
}
:
break
/* placement == 'right' */
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
+
pos
.
width
}
case
'
top
'
:
tp
=
{
top
:
pos
.
top
-
actualHeight
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
break
case
'
left
'
:
tp
=
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
-
actualWidth
}
break
case
'
right
'
:
tp
=
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
+
pos
.
width
}
break
}
this
.
applyPlacement
(
tp
,
placement
)
this
.
applyPlacement
(
tp
,
placement
)
this
.
$element
.
trigger
(
'
shown.bs.
'
+
this
.
type
)
this
.
$element
.
trigger
(
'
shown.bs.
'
+
this
.
type
)
...
@@ -206,6 +195,10 @@
...
@@ -206,6 +195,10 @@
var
width
=
$tip
[
0
].
offsetWidth
var
width
=
$tip
[
0
].
offsetWidth
var
height
=
$tip
[
0
].
offsetHeight
var
height
=
$tip
[
0
].
offsetHeight
// manually read margins because getBoundingClientRect includes difference
offset
.
top
=
offset
.
top
+
parseInt
(
$tip
.
css
(
'
margin-top
'
),
10
)
offset
.
left
=
offset
.
left
+
parseInt
(
$tip
.
css
(
'
margin-left
'
),
10
)
$tip
$tip
.
offset
(
offset
)
.
offset
(
offset
)
.
addClass
(
'
in
'
)
.
addClass
(
'
in
'
)
...
...
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