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
3d71eae3
Commit
3d71eae3
authored
Mar 24, 2015
by
Johann-S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add event after template inserted
parent
d37bc2ae
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
0 deletions
+40
-0
docs/_includes/js/popovers.html
docs/_includes/js/popovers.html
+4
-0
docs/_includes/js/tooltips.html
docs/_includes/js/tooltips.html
+4
-0
js/tests/unit/popover.js
js/tests/unit/popover.js
+17
-0
js/tests/unit/tooltip.js
js/tests/unit/tooltip.js
+14
-0
js/tooltip.js
js/tooltip.js
+1
-0
No files found.
docs/_includes/js/popovers.html
View file @
3d71eae3
...
@@ -293,6 +293,10 @@ sagittis lacus vel augue laoreet rutrum faucibus.">
...
@@ -293,6 +293,10 @@ sagittis lacus vel augue laoreet rutrum faucibus.">
<td>
hidden.bs.popover
</td>
<td>
hidden.bs.popover
</td>
<td>
This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).
</td>
<td>
This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).
</td>
</tr>
</tr>
<tr>
<td>
inserted.bs.popover
</td>
<td>
This event is fired after the
<code>
show.bs.popover
</code>
event when the popover template has been added to the DOM.
</td>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
<!-- /.table-responsive -->
</div>
<!-- /.table-responsive -->
...
...
docs/_includes/js/tooltips.html
View file @
3d71eae3
...
@@ -260,6 +260,10 @@ $('#example').tooltip(options)
...
@@ -260,6 +260,10 @@ $('#example').tooltip(options)
<td>
hidden.bs.tooltip
</td>
<td>
hidden.bs.tooltip
</td>
<td>
This event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).
</td>
<td>
This event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).
</td>
</tr>
</tr>
<tr>
<td>
inserted.bs.tooltip
</td>
<td>
This event is fired after the
<code>
show.bs.tooltip
</code>
event when the tooltip template has been added to the DOM.
</td>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
<!-- /.table-responsive -->
</div>
<!-- /.table-responsive -->
...
...
js/tests/unit/popover.js
View file @
3d71eae3
...
@@ -259,4 +259,21 @@ $(function () {
...
@@ -259,4 +259,21 @@ $(function () {
assert
.
strictEqual
(
$popover
.
data
(
'
bs.popover
'
),
undefined
,
'
should not initialize the popover
'
)
assert
.
strictEqual
(
$popover
.
data
(
'
bs.popover
'
),
undefined
,
'
should not initialize the popover
'
)
})
})
QUnit
.
test
(
'
should fire inserted event
'
,
function
(
assert
)
{
assert
.
expect
(
2
)
var
done
=
assert
.
async
()
$
(
'
<a href="#">@Johann-S</a>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
on
(
'
inserted.bs.popover
'
,
function
()
{
assert
.
notEqual
(
$
(
'
.popover
'
).
length
,
0
,
'
popover was inserted
'
)
assert
.
ok
(
true
,
'
inserted event fired
'
)
done
()
})
.
bootstrapPopover
({
title
:
'
Test
'
,
content
:
'
Test
'
})
.
bootstrapPopover
(
'
show
'
)
})
})
})
js/tests/unit/tooltip.js
View file @
3d71eae3
...
@@ -139,6 +139,20 @@ $(function () {
...
@@ -139,6 +139,20 @@ $(function () {
.
bootstrapTooltip
(
'
show
'
)
.
bootstrapTooltip
(
'
show
'
)
})
})
QUnit
.
test
(
'
should fire inserted event
'
,
function
(
assert
)
{
assert
.
expect
(
2
)
var
done
=
assert
.
async
()
$
(
'
<div title="tooltip title"/>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
on
(
'
inserted.bs.tooltip
'
,
function
()
{
assert
.
notEqual
(
$
(
'
.tooltip
'
).
length
,
0
,
'
tooltip was inserted
'
)
assert
.
ok
(
true
,
'
inserted event fired
'
)
done
()
})
.
bootstrapTooltip
(
'
show
'
)
})
QUnit
.
test
(
'
should fire shown event
'
,
function
(
assert
)
{
QUnit
.
test
(
'
should fire shown event
'
,
function
(
assert
)
{
assert
.
expect
(
1
)
assert
.
expect
(
1
)
var
done
=
assert
.
async
()
var
done
=
assert
.
async
()
...
...
js/tooltip.js
View file @
3d71eae3
...
@@ -185,6 +185,7 @@
...
@@ -185,6 +185,7 @@
.
data
(
'
bs.
'
+
this
.
type
,
this
)
.
data
(
'
bs.
'
+
this
.
type
,
this
)
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
this
.
$element
.
trigger
(
'
inserted.bs.
'
+
this
.
type
)
var
pos
=
this
.
getPosition
()
var
pos
=
this
.
getPosition
()
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualWidth
=
$tip
[
0
].
offsetWidth
...
...
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