Skip to content

Commit 366191a

Browse files
committed
push latest modal static code
1 parent 8045f3d commit 366191a

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

1.3.0/bootstrap-modal.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
that.$element
9090
.addClass('in')
9191
.trigger('shown')
92-
}, 1)
92+
}, 0)
9393
})
9494

9595
return this
@@ -133,15 +133,19 @@
133133
, animate = this.$element.hasClass('fade') ? 'fade' : ''
134134
if ( this.isShown && this.settings.backdrop ) {
135135
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
136-
.click($.proxy(this.hide, this))
137136
.appendTo(document.body)
138137

138+
if ( this.settings.backdrop != 'static' ) {
139+
this.$backdrop.click($.proxy(this.hide, this))
140+
}
141+
139142
setTimeout(function () {
140143
that.$backdrop && that.$backdrop.addClass('in')
141144
$.support.transition && that.$backdrop.hasClass('fade') ?
142145
that.$backdrop.one(transitionEnd, callback) :
143146
callback()
144-
})
147+
}, 0)
148+
145149
} else if ( !this.isShown && this.$backdrop ) {
146150
this.$backdrop.removeClass('in')
147151

javascript.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ <h3>Options</h3>
101101
<tbody>
102102
<tr>
103103
<td>backdrop</td>
104-
<td>boolean</td>
104+
<td>boolean, string</td>
105105
<td>false</td>
106-
<td>Includes a modal-backdrop element</td>
106+
<td>Includes a modal-backdrop element. Set backdrop to <code>"static"</code> if you do not want the modal closed when the backdrop is clicked</td>
107107
</tr>
108108
<tr>
109109
<td>keyboard</td>
@@ -122,7 +122,7 @@ <h3>Options</h3>
122122
<h3>Markup</h3>
123123
<p>You can activate modals on your page easily without having to write a single line of javascript. Just give an element a <code>data-controls-modal</code> attribute which corresponds to a modal element id, and when clicked, it will launch your modal. To add modal options, just include them as data attributes as well.</p>
124124
<pre class="prettyprint linenums">
125-
&lt;a class="btn" data-controls-modal="my-modal" data-backdrop="true" &gt;Launch Modal&lt;/a&gt;
125+
&lt;a class="btn" data-controls-modal="my-modal" data-backdrop="static" &gt;Launch Modal&lt;/a&gt;
126126
</pre>
127127
<p><span class="label notice">Notice</span> If you want your modal to animate in and out, just add a <code>.fade</code> class to your <code>.modal</code> element (refer to the demo to see this in action).</p>
128128
<h3>Methods</h3>
@@ -458,7 +458,7 @@ <h3>Options</h3>
458458
</tr>
459459
<tr>
460460
<td>title</td>
461-
<td>string | function</td>
461+
<td>string, function</td>
462462
<td>'title'</td>
463463
<td>attribute or method for retrieving title text</td>
464464
</tr>
@@ -575,13 +575,13 @@ <h3>Options</h3>
575575
</tr>
576576
<tr>
577577
<td>title</td>
578-
<td>string | function</td>
578+
<td>string, function</td>
579579
<td>'title'</td>
580580
<td>attribute or method for retrieving title text</td>
581581
</tr>
582582
<tr>
583583
<td>content</td>
584-
<td>string | function</td>
584+
<td>string, function</td>
585585
<td>'data-content'</td>
586586
<td>attribute or method for retrieving content text</td>
587587
</tr>

0 commit comments

Comments
 (0)