mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
initial idea for handling closing of modals from whatever element you want with .js-dismiss class
This commit is contained in:
parent
1b21d5e321
commit
2d81d65533
3 changed files with 6 additions and 6 deletions
|
@ -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 @@
|
||||||
</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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
2
js/bootstrap-modal.js
vendored
2
js/bootstrap-modal.js
vendored
|
@ -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 )
|
||||||
|
|
Loading…
Reference in a new issue