diff options
| author | Mark Otto <[email protected]> | 2012-12-08 17:40:42 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2012-12-08 17:40:42 -0800 |
| commit | bc0b94a3fdc8fe480c74f4494073e2c0addb265e (patch) | |
| tree | e13fec2ed829b4586fa4044fffc8dbfadddae54e /docs/javascript.html | |
| parent | be5f31480b53555c492e0077c8bb9f419fc48f62 (diff) | |
| parent | 9376a7c221a64c2bf508d02ea2ccd85748d10fcc (diff) | |
| download | bootstrap-bc0b94a3fdc8fe480c74f4494073e2c0addb265e.tar.xz bootstrap-bc0b94a3fdc8fe480c74f4494073e2c0addb265e.zip | |
Merge branch 'master' into 3.0.0-wip
Conflicts:
docs/assets/css/bootstrap.css
docs/assets/js/bootstrap.js
docs/css.html
docs/templates/pages/base-css.mustache
docs/templates/pages/components.mustache
docs/templates/pages/javascript.mustache
less/breadcrumbs.less
less/tables.less
less/tests/css-tests.html
Diffstat (limited to 'docs/javascript.html')
| -rw-r--r-- | docs/javascript.html | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/docs/javascript.html b/docs/javascript.html index ec97c87ec..6c4fbf7fb 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -131,9 +131,17 @@ $("#myModal").modal('show') // initializes and invokes show immed </pre> <p>Each plugin also exposes its raw constructor on a `Constructor` property: <code>$.fn.popover.Constructor</code>. If you'd like to get a particular plugin instance, retrieve it directly from an element: <code>$('[rel=popover]').data('popover')</code>.</p> + <h3>No conflict</h3> + <p>Sometimes it's neccessary to use bootstrap plugins with other ui frameworks. In these circumstances, occasionally namespace collisions can occur. If this happens, you may call <code>.noCoflict</code> on the plugin you wish to revert the value of.</p> + +<pre class="prettyprint linenums"> +var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value +$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the bootstrap functionality +</pre> + <h3>Events</h3> <p>Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. <code>show</code>) is triggered at the start of an event, and its past participle form (ex. <code>shown</code>) is trigger on the completion of an action.</p> - <p>All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.</p> + <p>All infinitive events provide <code>preventDefault</code> functionality. This provides the ability to stop the execution of an action before it starts.</p> <pre class="prettyprint linenums"> $('#myModal').on('show', function (e) { if (!data) return e.preventDefault() // stops modal from being shown @@ -1122,7 +1130,7 @@ $('#my-alert').bind('closed', function () { <p>Do more with buttons. Control button states or create groups of buttons for more components like toolbars.</p> <h4>Stateful</h4> - <p>Add data-loading-text="Loading..." to use a loading state on a button.</p> + <p>Add <code>data-loading-text="Loading..."</code> to use a loading state on a button.</p> <div class="bs-docs-example" style="padding-bottom: 24px;"> <button type="button" id="fat-btn" data-loading-text="loading..." class="btn btn-primary"> Loading state @@ -1131,14 +1139,14 @@ $('#my-alert').bind('closed', function () { <pre class="prettyprint linenums"><button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button></pre> <h4>Single toggle</h4> - <p>Add data-toggle="button" to activate toggling on a single button.</p> + <p>Add <code>data-toggle="button"</code> to activate toggling on a single button.</p> <div class="bs-docs-example" style="padding-bottom: 24px;"> <button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button> </div> <pre class="prettyprint linenums"><button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button></pre> <h4>Checkbox</h4> - <p>Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.</p> + <p>Add <code>data-toggle="buttons-checkbox"</code> for checkbox style toggling on btn-group.</p> <div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="btn-group" data-toggle="buttons-checkbox"> <button type="button" class="btn btn-primary">Left</button> @@ -1155,7 +1163,7 @@ $('#my-alert').bind('closed', function () { </pre> <h4>Radio</h4> - <p>Add data-toggle="buttons-radio" for radio style toggling on btn-group.</p> + <p>Add <code>data-toggle="buttons-radio"</code> for radio style toggling on btn-group.</p> <div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="btn-group" data-toggle="buttons-radio"> <button type="button" class="btn btn-primary">Left</button> |
