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
57768d7e
Commit
57768d7e
authored
11 years ago
by
fat
Browse files
Options
Download
Email Patches
Plain Diff
fix #7660
parent
6387d8d5
3 merge requests
!8635
ignore Gruntfile.js in jekyll
,
!8656
Added rel="stylesheet" to CDN-Examples
,
!8527
Inner properties move 1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/modal.js
+6
-5
js/modal.js
js/tests/unit/modal.js
+19
-0
js/tests/unit/modal.js
with
25 additions
and
5 deletions
+25
-5
js/modal.js
+
6
-
5
View file @
57768d7e
...
...
@@ -160,11 +160,12 @@
this
.
$backdrop
=
$
(
'
<div class="modal-backdrop
'
+
animate
+
'
" />
'
)
.
appendTo
(
document
.
body
)
this
.
$backdrop
.
click
(
this
.
options
.
backdrop
==
'
static
'
?
$
.
proxy
(
this
.
$element
[
0
].
focus
,
this
.
$element
[
0
])
:
$
.
proxy
(
this
.
hide
,
this
)
)
this
.
$element
.
on
(
'
click
'
,
$
.
proxy
(
function
(
e
)
{
if
(
e
.
target
!==
e
.
currentTarget
)
return
this
.
options
.
backdrop
==
'
static
'
?
this
.
$element
[
0
].
focus
.
call
(
this
.
$element
[
0
])
:
this
.
hide
.
call
(
this
)
},
this
))
if
(
doAnimate
)
this
.
$backdrop
[
0
].
offsetWidth
// force reflow
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/modal.js
+
19
-
0
View file @
57768d7e
...
...
@@ -134,4 +134,23 @@ $(function () {
})
.
modal
(
"
show
"
)
})
test
(
"
should close modal when clicking outside of modal-content
"
,
function
()
{
stop
()
$
.
support
.
transition
=
false
var
div
=
$
(
"
<div id='modal-test'><div class='contents'></div></div>
"
)
div
.
bind
(
"
shown.bs.modal
"
,
function
()
{
ok
(
$
(
'
#modal-test
'
).
length
,
'
modal insterted into dom
'
)
$
(
'
.contents
'
).
click
()
ok
(
$
(
'
#modal-test
'
).
is
(
"
:visible
"
),
'
modal visible
'
)
$
(
'
#modal-test
'
).
click
()
})
.
bind
(
"
hidden.bs.modal
"
,
function
()
{
ok
(
!
$
(
'
#modal-test
'
).
is
(
"
:visible
"
),
'
modal hidden
'
)
div
.
remove
()
start
()
})
.
modal
(
"
show
"
)
})
})
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