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
4d73aa60
Commit
4d73aa60
authored
Jul 17, 2013
by
Mark Otto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '3.0.0-wip' of github.com:twitter/bootstrap into 3.0.0-wip
Conflicts: docs/assets/js/bootstrap.min.js
parents
d3a13962
59f847e8
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
10 deletions
+70
-10
docs/assets/js/bootstrap.js
docs/assets/js/bootstrap.js
+6
-4
docs/assets/js/bootstrap.min.js
docs/assets/js/bootstrap.min.js
+1
-1
js/popover.js
js/popover.js
+6
-4
js/tests/unit/popover.js
js/tests/unit/popover.js
+20
-0
js/tests/unit/tooltip.js
js/tests/unit/tooltip.js
+37
-1
No files found.
docs/assets/js/bootstrap.js
View file @
4d73aa60
...
@@ -1443,11 +1443,13 @@
...
@@ -1443,11 +1443,13 @@
}
}
Popover
.
prototype
.
getContent
=
function
()
{
Popover
.
prototype
.
getContent
=
function
()
{
var
content
=
typeof
this
.
options
.
content
==
'
function
'
?
var
$e
=
this
.
$element
this
.
options
.
content
.
call
(
this
.
$element
[
0
])
:
var
o
=
this
.
options
this
.
options
.
content
return
content
||
this
.
$element
.
attr
(
'
data-content
'
)
return
$e
.
attr
(
'
data-content
'
)
||
(
typeof
o
.
content
==
'
function
'
?
o
.
content
.
call
(
$e
[
0
])
:
o
.
content
)
}
}
Popover
.
prototype
.
tip
=
function
()
{
Popover
.
prototype
.
tip
=
function
()
{
...
...
docs/assets/js/bootstrap.min.js
View file @
4d73aa60
This diff is collapsed.
Click to expand it.
js/popover.js
View file @
4d73aa60
...
@@ -64,11 +64,13 @@
...
@@ -64,11 +64,13 @@
}
}
Popover
.
prototype
.
getContent
=
function
()
{
Popover
.
prototype
.
getContent
=
function
()
{
var
content
=
typeof
this
.
options
.
content
==
'
function
'
?
var
$e
=
this
.
$element
this
.
options
.
content
.
call
(
this
.
$element
[
0
])
:
var
o
=
this
.
options
this
.
options
.
content
return
content
||
this
.
$element
.
attr
(
'
data-content
'
)
return
$e
.
attr
(
'
data-content
'
)
||
(
typeof
o
.
content
==
'
function
'
?
o
.
content
.
call
(
$e
[
0
])
:
o
.
content
)
}
}
Popover
.
prototype
.
tip
=
function
()
{
Popover
.
prototype
.
tip
=
function
()
{
...
...
js/tests/unit/popover.js
View file @
4d73aa60
...
@@ -77,6 +77,26 @@ $(function () {
...
@@ -77,6 +77,26 @@ $(function () {
$
(
'
#qunit-fixture
'
).
empty
()
$
(
'
#qunit-fixture
'
).
empty
()
})
})
test
(
"
should get title and content from attributes #2
"
,
function
()
{
$
.
support
.
transition
=
false
var
popover
=
$
(
'
<a href="#" title="@mdo" data-content="loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻" >@mdo</a>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
popover
({
title
:
'
ignored title option
'
,
content
:
'
ignored content option
'
})
.
popover
(
'
show
'
)
ok
(
$
(
'
.popover
'
).
length
,
'
popover was inserted
'
)
equals
(
$
(
'
.popover .popover-title
'
).
text
(),
'
@mdo
'
,
'
title correctly inserted
'
)
equals
(
$
(
'
.popover .popover-content
'
).
text
(),
"
loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻
"
,
'
content correctly inserted
'
)
popover
.
popover
(
'
hide
'
)
ok
(
!
$
(
'
.popover
'
).
length
,
'
popover was removed
'
)
$
(
'
#qunit-fixture
'
).
empty
()
})
test
(
"
should respect custom classes
"
,
function
()
{
test
(
"
should respect custom classes
"
,
function
()
{
$
.
support
.
transition
=
false
$
.
support
.
transition
=
false
var
popover
=
$
(
'
<a href="#">@fat</a>
'
)
var
popover
=
$
(
'
<a href="#">@fat</a>
'
)
...
...
js/tests/unit/tooltip.js
View file @
4d73aa60
...
@@ -296,7 +296,7 @@ $(function () {
...
@@ -296,7 +296,7 @@ $(function () {
$
(
"
head
"
).
append
(
'
<style> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>
'
)
$
(
"
head
"
).
append
(
'
<style> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>
'
)
var
container
=
$
(
"
<div />
"
).
appendTo
(
"
body
"
)
var
container
=
$
(
"
<div />
"
).
appendTo
(
"
body
"
)
,
target
=
$
(
'
<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line">
To my right
</a>
'
)
,
target
=
$
(
'
<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line"></a>
'
)
.
appendTo
(
container
)
.
appendTo
(
container
)
.
tooltip
({
placement
:
'
right
'
})
.
tooltip
({
placement
:
'
right
'
})
.
tooltip
(
'
show
'
)
.
tooltip
(
'
show
'
)
...
@@ -305,4 +305,40 @@ $(function () {
...
@@ -305,4 +305,40 @@ $(function () {
ok
(
Math
.
round
(
target
.
offset
().
top
+
target
[
0
].
offsetHeight
/
2
-
tooltip
[
0
].
offsetHeight
/
2
)
===
Math
.
round
(
tooltip
.
offset
().
top
)
)
ok
(
Math
.
round
(
target
.
offset
().
top
+
target
[
0
].
offsetHeight
/
2
-
tooltip
[
0
].
offsetHeight
/
2
)
===
Math
.
round
(
tooltip
.
offset
().
top
)
)
target
.
tooltip
(
'
hide
'
)
target
.
tooltip
(
'
hide
'
)
})
})
test
(
"
tooltip title test #1
"
,
function
()
{
var
tooltip
=
$
(
'
<a href="#" rel="tooltip" title="Simple tooltip" style="display: inline-block; position: absolute; top: 0; left: 0;"></a>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
tooltip
({
})
.
tooltip
(
'
show
'
)
equal
(
$
(
'
.tooltip
'
).
children
(
'
.tooltip-inner
'
).
text
(),
'
Simple tooltip
'
,
'
title from title attribute is set
'
)
tooltip
.
tooltip
(
'
hide
'
)
ok
(
!
$
(
"
.tooltip
"
).
length
,
'
tooltip removed
'
)
})
test
(
"
tooltip title test #2
"
,
function
()
{
var
tooltip
=
$
(
'
<a href="#" rel="tooltip" title="Simple tooltip" style="display: inline-block; position: absolute; top: 0; left: 0;"></a>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
tooltip
({
title
:
'
This is a tooltip with some content
'
})
.
tooltip
(
'
show
'
)
equal
(
$
(
'
.tooltip
'
).
children
(
'
.tooltip-inner
'
).
text
(),
'
Simple tooltip
'
,
'
title is set from title attribute while prefered over title option
'
)
tooltip
.
tooltip
(
'
hide
'
)
ok
(
!
$
(
"
.tooltip
"
).
length
,
'
tooltip removed
'
)
})
test
(
"
tooltip title test #3
"
,
function
()
{
var
tooltip
=
$
(
'
<a href="#" rel="tooltip" style="display: inline-block; position: absolute; top: 0; left: 0;"></a>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
tooltip
({
title
:
'
This is a tooltip with some content
'
})
.
tooltip
(
'
show
'
)
equal
(
$
(
'
.tooltip
'
).
children
(
'
.tooltip-inner
'
).
text
(),
'
This is a tooltip with some content
'
,
'
title from title option is set
'
)
tooltip
.
tooltip
(
'
hide
'
)
ok
(
!
$
(
"
.tooltip
"
).
length
,
'
tooltip removed
'
)
})
})
})
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