diff options
| author | Mark Otto <[email protected]> | 2011-09-28 20:21:09 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2011-09-28 20:21:09 -0700 |
| commit | 2d81d65533ded88c76712e787edbd745d38e403e (patch) | |
| tree | a68898fb108608de600579a3aa939fbfc62862d4 | |
| parent | 1b21d5e321ec77c6381becae2e2d7d1c4ab14d9a (diff) | |
| download | bootstrap-2d81d65533ded88c76712e787edbd745d38e403e.tar.xz bootstrap-2d81d65533ded88c76712e787edbd745d38e403e.zip | |
initial idea for handling closing of modals from whatever element you want with .js-dismiss class
| -rw-r--r-- | docs/index.html | 4 | ||||
| -rw-r--r-- | docs/javascript.html | 6 | ||||
| -rw-r--r-- | js/bootstrap-modal.js | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/docs/index.html b/docs/index.html index 857af2448..b24999c62 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1644,7 +1644,7 @@ <!-- Modal --> <div class="modal" style="position: relative; top: auto; left: auto; margin: 0 auto; z-index: 1"> <div class="modal-header"> - <a href="#" class="close">×</a> + <a href="#" class="close js-dismiss">×</a> <h3>Modal Heading</h3> </div> <div class="modal-body"> @@ -1652,7 +1652,7 @@ </div> <div class="modal-footer"> <a href="#" class="btn primary">Primary</a> - <a href="#" class="btn secondary">Secondary</a> + <a href="#" class="btn">Secondary</a> </div> </div> </div> diff --git a/docs/javascript.html b/docs/javascript.html index d16926186..d5eb98739 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -182,15 +182,15 @@ $('#my-modal').bind('hidden', function () { <!-- sample modal content --> <div id="modal-from-dom" class="modal hide fade"> <div class="modal-header"> - <a href="#" class="close">×</a> + <a href="#" class="close js-dismiss">×</a> <h3>Modal Heading</h3> </div> <div class="modal-body"> <p>One fine body…</p> </div> <div class="modal-footer"> - <a href="#" class="btn primary">Primary</a> - <a href="#" class="btn secondary">Secondary</a> + <a href="#" class="btn primary">Save changes</a> + <a href="#" class="btn js-dismiss">Close</a> </div> </div> diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index da6706073..5c38a7477 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -55,7 +55,7 @@ var Modal = function ( content, options ) { this.settings = $.extend({}, $.fn.modal.defaults) this.$element = $(content) - .delegate('.close', 'click.modal', $.proxy(this.hide, this)) + .delegate('.js-dismiss', 'click.modal', $.proxy(this.hide, this)) if ( options ) { $.extend( this.settings, options ) |
