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
2d81d655
Commit
2d81d655
authored
Sep 28, 2011
by
Mark Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial idea for handling closing of modals from whatever element you want with .js-dismiss class
parent
1b21d5e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
docs/index.html
docs/index.html
+2
-2
docs/javascript.html
docs/javascript.html
+3
-3
js/bootstrap-modal.js
js/bootstrap-modal.js
+1
-1
No files found.
docs/index.html
View file @
2d81d655
...
@@ -1644,7 +1644,7 @@
...
@@ -1644,7 +1644,7 @@
<!-- Modal -->
<!-- Modal -->
<div
class=
"modal"
style=
"position: relative; top: auto; left: auto; margin: 0 auto; z-index: 1"
>
<div
class=
"modal"
style=
"position: relative; top: auto; left: auto; margin: 0 auto; z-index: 1"
>
<div
class=
"modal-header"
>
<div
class=
"modal-header"
>
<a
href=
"#"
class=
"close"
>
×
</a>
<a
href=
"#"
class=
"close
js-dismiss
"
>
×
</a>
<h3>
Modal Heading
</h3>
<h3>
Modal Heading
</h3>
</div>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
...
@@ -1652,7 +1652,7 @@
...
@@ -1652,7 +1652,7 @@
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<a
href=
"#"
class=
"btn primary"
>
Primary
</a>
<a
href=
"#"
class=
"btn primary"
>
Primary
</a>
<a
href=
"#"
class=
"btn
secondary
"
>
Secondary
</a>
<a
href=
"#"
class=
"btn"
>
Secondary
</a>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
docs/javascript.html
View file @
2d81d655
...
@@ -182,15 +182,15 @@ $('#my-modal').bind('hidden', function () {
...
@@ -182,15 +182,15 @@ $('#my-modal').bind('hidden', function () {
<!-- sample modal content -->
<!-- sample modal content -->
<div
id=
"modal-from-dom"
class=
"modal hide fade"
>
<div
id=
"modal-from-dom"
class=
"modal hide fade"
>
<div
class=
"modal-header"
>
<div
class=
"modal-header"
>
<a
href=
"#"
class=
"close"
>
×
</a>
<a
href=
"#"
class=
"close
js-dismiss
"
>
×
</a>
<h3>
Modal Heading
</h3>
<h3>
Modal Heading
</h3>
</div>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<p>
One fine body…
</p>
<p>
One fine body…
</p>
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<a
href=
"#"
class=
"btn primary"
>
Primary
</a>
<a
href=
"#"
class=
"btn primary"
>
Save changes
</a>
<a
href=
"#"
class=
"btn
secondary"
>
Secondary
</a>
<a
href=
"#"
class=
"btn
js-dismiss"
>
Close
</a>
</div>
</div>
</div>
</div>
...
...
js/bootstrap-modal.js
View file @
2d81d655
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
var
Modal
=
function
(
content
,
options
)
{
var
Modal
=
function
(
content
,
options
)
{
this
.
settings
=
$
.
extend
({},
$
.
fn
.
modal
.
defaults
)
this
.
settings
=
$
.
extend
({},
$
.
fn
.
modal
.
defaults
)
this
.
$element
=
$
(
content
)
this
.
$element
=
$
(
content
)
.
delegate
(
'
.
close
'
,
'
click.modal
'
,
$
.
proxy
(
this
.
hide
,
this
))
.
delegate
(
'
.
js-dismiss
'
,
'
click.modal
'
,
$
.
proxy
(
this
.
hide
,
this
))
if
(
options
)
{
if
(
options
)
{
$
.
extend
(
this
.
settings
,
options
)
$
.
extend
(
this
.
settings
,
options
)
...
...
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