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
712b89ed
Commit
712b89ed
authored
11 years ago
by
fat
Browse files
Options
Download
Email Patches
Plain Diff
fixes
#9362
parent
728a5e17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/modal.js
+3
-1
js/modal.js
js/tests/unit/modal.js
+19
-0
js/tests/unit/modal.js
with
22 additions
and
1 deletion
+22
-1
js/modal.js
+
3
-
1
View file @
712b89ed
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
var
Modal
=
function
(
element
,
options
)
{
var
Modal
=
function
(
element
,
options
)
{
this
.
options
=
options
this
.
options
=
options
this
.
$element
=
$
(
element
)
.
on
(
'
click.dismiss.modal
'
,
'
[data-dismiss="modal"]
'
,
$
.
proxy
(
this
.
hide
,
this
))
this
.
$element
=
$
(
element
)
this
.
$backdrop
=
this
.
$backdrop
=
this
.
isShown
=
null
this
.
isShown
=
null
...
@@ -54,6 +54,8 @@
...
@@ -54,6 +54,8 @@
this
.
escape
()
this
.
escape
()
this
.
$element
.
on
(
'
click.dismiss.modal
'
,
'
[data-dismiss="modal"]
'
,
$
.
proxy
(
this
.
hide
,
this
))
this
.
backdrop
(
function
()
{
this
.
backdrop
(
function
()
{
var
transition
=
$
.
support
.
transition
&&
that
.
$element
.
hasClass
(
'
fade
'
)
var
transition
=
$
.
support
.
transition
&&
that
.
$element
.
hasClass
(
'
fade
'
)
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/modal.js
+
19
-
0
View file @
712b89ed
...
@@ -174,4 +174,23 @@ $(function () {
...
@@ -174,4 +174,23 @@ $(function () {
})
})
.
modal
(
"
show
"
)
.
modal
(
"
show
"
)
})
})
test
(
"
should close reopened modal with [data-dismiss=modal] click
"
,
function
()
{
stop
()
$
.
support
.
transition
=
false
var
div
=
$
(
"
<div id='modal-test'><div class='contents'><div id='close' data-dismiss='modal'></div></div></div>
"
)
div
.
bind
(
"
shown.bs.modal
"
,
function
()
{
$
(
'
#close
'
).
click
()
ok
(
!
$
(
'
#modal-test
'
).
is
(
"
:visible
"
),
'
modal hidden
'
)
})
.
one
(
"
hidden.bs.modal
"
,
function
()
{
div
.
one
(
'
hidden.bs.modal
'
,
function
()
{
start
()
}).
modal
(
"
show
"
)
})
.
modal
(
"
show
"
)
div
.
remove
()
})
})
})
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