aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2011-09-28 20:21:09 -0700
committerMark Otto <[email protected]>2011-09-28 20:21:09 -0700
commit2d81d65533ded88c76712e787edbd745d38e403e (patch)
treea68898fb108608de600579a3aa939fbfc62862d4
parent1b21d5e321ec77c6381becae2e2d7d1c4ab14d9a (diff)
downloadbootstrap-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.html4
-rw-r--r--docs/javascript.html6
-rw-r--r--js/bootstrap-modal.js2
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">&times;</a>
+ <a href="#" class="close js-dismiss">&times;</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">&times;</a>
+ <a href="#" class="close js-dismiss">&times;</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 )