Skip to content
GitLab
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
121bf663
Commit
121bf663
authored
10 years ago
by
Heinrich Fenkart
Browse files
Options
Download
Email Patches
Plain Diff
Use mousedown instead of click for backdrop click detection; fixes
#13816
parent
8deab3a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/modal.js
+1
-1
js/modal.js
js/tests/unit/modal.js
+2
-2
js/tests/unit/modal.js
with
3 additions
and
3 deletions
+3
-3
js/modal.js
+
1
-
1
View file @
121bf663
...
@@ -166,7 +166,7 @@
...
@@ -166,7 +166,7 @@
this
.
$backdrop
=
$
(
'
<div class="modal-backdrop
'
+
animate
+
'
" />
'
)
this
.
$backdrop
=
$
(
'
<div class="modal-backdrop
'
+
animate
+
'
" />
'
)
.
appendTo
(
this
.
$body
)
.
appendTo
(
this
.
$body
)
this
.
$element
.
on
(
'
click
.dismiss.bs.modal
'
,
$
.
proxy
(
function
(
e
)
{
this
.
$element
.
on
(
'
mousedown
.dismiss.bs.modal
'
,
$
.
proxy
(
function
(
e
)
{
if
(
e
.
target
!==
e
.
currentTarget
)
return
if
(
e
.
target
!==
e
.
currentTarget
)
return
this
.
options
.
backdrop
==
'
static
'
this
.
options
.
backdrop
==
'
static
'
?
this
.
$element
[
0
].
focus
.
call
(
this
.
$element
[
0
])
?
this
.
$element
[
0
].
focus
.
call
(
this
.
$element
[
0
])
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/modal.js
+
2
-
2
View file @
121bf663
...
@@ -154,7 +154,7 @@ $(function () {
...
@@ -154,7 +154,7 @@ $(function () {
ok
(
$
(
'
#modal-test
'
).
length
,
'
modal insterted into dom
'
)
ok
(
$
(
'
#modal-test
'
).
length
,
'
modal insterted into dom
'
)
$
(
'
.contents
'
).
click
()
$
(
'
.contents
'
).
click
()
ok
(
$
(
'
#modal-test
'
).
is
(
'
:visible
'
),
'
modal visible
'
)
ok
(
$
(
'
#modal-test
'
).
is
(
'
:visible
'
),
'
modal visible
'
)
$
(
'
#modal-test
'
).
click
()
$
(
'
#modal-test
'
).
mousedown
()
})
})
.
on
(
'
hidden.bs.modal
'
,
function
()
{
.
on
(
'
hidden.bs.modal
'
,
function
()
{
ok
(
!
$
(
'
#modal-test
'
).
is
(
'
:visible
'
),
'
modal hidden
'
)
ok
(
!
$
(
'
#modal-test
'
).
is
(
'
:visible
'
),
'
modal hidden
'
)
...
@@ -174,7 +174,7 @@ $(function () {
...
@@ -174,7 +174,7 @@ $(function () {
div
div
.
on
(
'
shown.bs.modal
'
,
function
()
{
.
on
(
'
shown.bs.modal
'
,
function
()
{
triggered
=
0
triggered
=
0
$
(
'
#modal-test
'
).
click
()
$
(
'
#modal-test
'
).
mousedown
()
})
})
.
on
(
'
hide.bs.modal
'
,
function
()
{
.
on
(
'
hide.bs.modal
'
,
function
()
{
triggered
+=
1
triggered
+=
1
...
...
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