]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
fix #11089: document modal show+shown events' relatedTarget property
authorChris Rebert <code@rebertia.com>
Tue, 19 Nov 2013 03:28:37 +0000 (19:28 -0800)
committerChris Rebert <code@rebertia.com>
Tue, 19 Nov 2013 03:29:08 +0000 (19:29 -0800)
javascript.html

index 06a0bd021b0257a7ea90611d18ede9a33b453562..06a5f4570099d2b290d61a3ad306827a376af6fe 100644 (file)
@@ -328,11 +328,11 @@ $('#myModal').modal({
         <tbody>
          <tr>
            <td>show.bs.modal</td>
-           <td>This event fires immediately when the <code>show</code> instance method is called.</td>
+           <td>This event fires immediately when the <code>show</code> instance method is called. If caused by a click, the clicked element is available as the <code>relatedTarget</code> property of the event.</td>
          </tr>
          <tr>
            <td>shown.bs.modal</td>
-           <td>This event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete).</td>
+           <td>This event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete). If caused by a click, the clicked element is available as the <code>relatedTarget</code> property of the event.</td>
          </tr>
          <tr>
            <td>hide.bs.modal</td>
@@ -346,8 +346,8 @@ $('#myModal').modal({
       </table>
     </div><!-- /.table-responsive -->
 {% highlight js %}
-$('#myModal').on('hidden.bs.modal', function () {
-  // do something
+$('#myModal').on('hidden.bs.modal', function (e) {
+  // do something...
 })
 {% endhighlight %}
   </div>