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
a4f0e8d3
Commit
a4f0e8d3
authored
Aug 10, 2013
by
Jacob Thornton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #9111
parent
dbed9da7
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
143 deletions
+166
-143
dist/js/bootstrap.js
dist/js/bootstrap.js
+2
-1
dist/js/bootstrap.min.js
dist/js/bootstrap.min.js
+1
-1
js/modal.js
js/modal.js
+2
-1
js/tests/unit/modal.js
js/tests/unit/modal.js
+161
-140
No files found.
dist/js/bootstrap.js
View file @
a4f0e8d3
...
@@ -925,6 +925,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
...
@@ -925,6 +925,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this
.
$element
this
.
$element
.
removeClass
(
'
in
'
)
.
removeClass
(
'
in
'
)
.
attr
(
'
aria-hidden
'
,
true
)
.
attr
(
'
aria-hidden
'
,
true
)
.
off
(
'
click.dismiss.modal
'
)
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
fade
'
)
?
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
fade
'
)
?
this
.
$element
this
.
$element
...
@@ -977,7 +978,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
...
@@ -977,7 +978,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this
.
$backdrop
=
$
(
'
<div class="modal-backdrop
'
+
animate
+
'
" />
'
)
this
.
$backdrop
=
$
(
'
<div class="modal-backdrop
'
+
animate
+
'
" />
'
)
.
appendTo
(
document
.
body
)
.
appendTo
(
document
.
body
)
this
.
$element
.
on
(
'
click
'
,
$
.
proxy
(
function
(
e
)
{
this
.
$element
.
on
(
'
click
.dismiss.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
])
...
...
dist/js/bootstrap.min.js
View file @
a4f0e8d3
This diff is collapsed.
Click to expand it.
js/modal.js
View file @
a4f0e8d3
...
@@ -103,6 +103,7 @@
...
@@ -103,6 +103,7 @@
this
.
$element
this
.
$element
.
removeClass
(
'
in
'
)
.
removeClass
(
'
in
'
)
.
attr
(
'
aria-hidden
'
,
true
)
.
attr
(
'
aria-hidden
'
,
true
)
.
off
(
'
click.dismiss.modal
'
)
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
fade
'
)
?
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
fade
'
)
?
this
.
$element
this
.
$element
...
@@ -155,7 +156,7 @@
...
@@ -155,7 +156,7 @@
this
.
$backdrop
=
$
(
'
<div class="modal-backdrop
'
+
animate
+
'
" />
'
)
this
.
$backdrop
=
$
(
'
<div class="modal-backdrop
'
+
animate
+
'
" />
'
)
.
appendTo
(
document
.
body
)
.
appendTo
(
document
.
body
)
this
.
$element
.
on
(
'
click
'
,
$
.
proxy
(
function
(
e
)
{
this
.
$element
.
on
(
'
click
.dismiss.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
])
...
...
js/tests/unit/modal.js
View file @
a4f0e8d3
...
@@ -153,4 +153,25 @@ $(function () {
...
@@ -153,4 +153,25 @@ $(function () {
})
})
.
modal
(
"
show
"
)
.
modal
(
"
show
"
)
})
})
test
(
"
should trigger hide event once when clicking outside of modal-content
"
,
function
()
{
stop
()
$
.
support
.
transition
=
false
var
div
=
$
(
"
<div id='modal-test'><div class='contents'></div></div>
"
)
var
triggered
div
.
bind
(
"
shown.bs.modal
"
,
function
()
{
triggered
=
0
$
(
'
#modal-test
'
).
click
()
})
.
one
(
"
hidden.bs.modal
"
,
function
()
{
div
.
modal
(
"
show
"
)
})
.
bind
(
"
hide.bs.modal
"
,
function
()
{
triggered
+=
1
ok
(
triggered
===
1
,
'
modal hide triggered once
'
)
start
()
})
.
modal
(
"
show
"
)
})
})
})
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