diff options
| author | Jacob Thornton <[email protected]> | 2011-11-27 17:31:12 -0800 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2011-11-27 17:31:12 -0800 |
| commit | 7eb340ec589acd56ad960a020969822636c2bc54 (patch) | |
| tree | 83a2886faefd9c939c30a13e0d080d9f17b0610b | |
| parent | 7522517b47521da731bf7a598d5e5a71721c4c44 (diff) | |
| download | bootstrap-7eb340ec589acd56ad960a020969822636c2bc54.tar.xz bootstrap-7eb340ec589acd56ad960a020969822636c2bc54.zip | |
add code to reset data for collapsed element so that item can be intitialized with correct options
| -rw-r--r-- | docs/javascript.html | 24 | ||||
| -rw-r--r-- | js/bootstrap-alert.js (renamed from js/bootstrap-alerts.js) | 2 | ||||
| -rw-r--r-- | js/bootstrap-button.js (renamed from js/bootstrap-buttons.js) | 0 | ||||
| -rw-r--r-- | js/bootstrap-collapse.js | 10 |
4 files changed, 21 insertions, 15 deletions
diff --git a/docs/javascript.html b/docs/javascript.html index 833e6ec02..2db37a9fe 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -29,14 +29,14 @@ <script src="assets/js/google-code-prettify/prettify.js"></script> <script>$(function () { prettyPrint() })</script> <script src="../js/bootstrap-transition.js"></script> - <script src="../js/bootstrap-alerts.js"></script> + <script src="../js/bootstrap-alert.js"></script> <script src="../js/bootstrap-modal.js"></script> <script src="../js/bootstrap-dropdown.js"></script> <script src="../js/bootstrap-scrollspy.js"></script> <script src="../js/bootstrap-tab.js"></script> <script src="../js/bootstrap-twipsy.js"></script> <script src="../js/bootstrap-popover.js"></script> - <script src="../js/bootstrap-buttons.js"></script> + <script src="../js/bootstrap-button.js"></script> <script src="../js/bootstrap-collapse.js"></script> <script> $(function () { @@ -115,7 +115,7 @@ <td>Our Modal plugin is a <strong>super</strong> slim take on the traditional modal js plugin! We took special care to include only the bare functionality that we require at twitter.</td> </tr> <tr> - <td><a href="./javascript.html#alerts">bootstrap-alerts.js</a></td> + <td><a href="./javascript.html#alert">bootstrap-alert.js</a></td> <td>The alert plugin is a super tiny class for adding close functionality to alerts.</td> </tr> <tr> @@ -139,7 +139,7 @@ <td>The popover plugin provides a simple interface for adding popovers to your application. It extends the <a href="#twipsy">boostrap-twipsy.js</a> plugin, so be sure to grab that file as well when including popovers in your project!</td> </tr> <tr> - <td><a href="./javascript.html#buttons">bootstrap-buttons.js</a></td> + <td><a href="./javascript.html#button">bootstrap-button.js</a></td> <td>This plugin offers additional functionality for managing button state.</td> </tr> <tr> @@ -716,12 +716,12 @@ $('a[data-toggle="tab"]').bind('shown', function (e) { </section> - <!-- Alerts + <!-- Alert ================================================== --> - <section id="alerts"> + <section id="alert"> <div class="page-header"> - <h1>Alerts <small>bootstrap-alerts.js</small></h1> + <h1>Alert <small>bootstrap-alert.js</small></h1> </div> <div class="row"> <div class="span3 columns"> @@ -757,20 +757,20 @@ $('a[data-toggle="tab"]').bind('shown', function (e) { </section> - <!-- Buttons + <!-- Button ================================================== --> - <section id="buttons"> + <section id="button"> <div class="page-header"> - <h1>Buttons <small>bootstrap-buttons.js</small></h1> + <h1>Button <small>bootstrap-button.js</small></h1> </div> <div class="row"> <div class="span3 columns"> <p>This plugin offers additional functionality for managing button state.</p> - <a href="../js/bootstrap-buttons.js" target="_blank" class="btn primary">Download</a> + <a href="../js/bootstrap-button.js" target="_blank" class="btn primary">Download</a> </div> <div class="span9 columns"> - <h3>Using bootstrap-buttons.js</h3> + <h3>Using bootstrap-button.js</h3> <pre class="prettyprint linenums">$('.tabs').button()</pre> <h3>Markup</h3> <p>Data attributes are integral to the button plugin. Check out the example code below for the various markup types.</p> diff --git a/js/bootstrap-alerts.js b/js/bootstrap-alert.js index 5f600ba1f..210512a8b 100644 --- a/js/bootstrap-alerts.js +++ b/js/bootstrap-alert.js @@ -1,5 +1,5 @@ /* ========================================================== - * bootstrap-alerts.js v2.0.0 + * bootstrap-alert.js v2.0.0 * http://twitter.github.com/bootstrap/javascript.html#alerts * ========================================================== * Copyright 2011 Twitter, Inc. diff --git a/js/bootstrap-buttons.js b/js/bootstrap-button.js index 1cafe4d68..1cafe4d68 100644 --- a/js/bootstrap-buttons.js +++ b/js/bootstrap-button.js diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js index 629d9b589..93f91513e 100644 --- a/js/bootstrap-collapse.js +++ b/js/bootstrap-collapse.js @@ -42,8 +42,14 @@ , show: function () { var dimension = this.dimension() , scroll = $.camelCase(['scroll', dimension].join('-')) - - this.$parent && this.$parent.find('.in').collapse('hide') + , actives = this.$parent && this.$parent.find('.in') + , hasData + + if (actives && actives.length) { + hasData = actives.data('collapse') + actives.collapse('hide') + hasData || actives.data('collapse', null) + } this.$element[dimension](0) this.transition('addClass', 'show', 'shown') |
