aboutsummaryrefslogtreecommitdiff
path: root/docs/javascript.html
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-02-11 09:50:40 -0800
committerMark Otto <[email protected]>2014-02-11 09:50:40 -0800
commit8551f42ae2935c96bd37ae8ed15198a0cc22ede2 (patch)
tree77498aad62c25da55fb121470d91623c14873f58 /docs/javascript.html
parentb36d19c3c6caf89fbe996678bdefe3f7e9a69281 (diff)
parent2cef0af211e8b6780fff90fe5f110493585aa97c (diff)
downloadbootstrap-8551f42ae2935c96bd37ae8ed15198a0cc22ede2.tar.xz
bootstrap-8551f42ae2935c96bd37ae8ed15198a0cc22ede2.zip
Merge branch 'master' into pr/12412
Conflicts: dist/css/bootstrap-theme.css.map dist/css/bootstrap.css.map dist/css/bootstrap.min.css docs/assets/js/customize.min.js docs/assets/js/raw-files.min.js docs/dist/css/bootstrap-theme.css.map docs/dist/css/bootstrap.css.map docs/dist/css/bootstrap.min.css test-infra/npm-shrinkwrap.canonical.json
Diffstat (limited to 'docs/javascript.html')
-rw-r--r--docs/javascript.html32
1 files changed, 21 insertions, 11 deletions
diff --git a/docs/javascript.html b/docs/javascript.html
index b0e1287ba..16cd66e65 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -15,8 +15,13 @@ lead: "Bring Bootstrap's components to life with over a dozen custom jQuery plug
<p>Plugins can be included individually (using Bootstrap's individual <code>*.js</code> files), or all at once (using <code>bootstrap.js</code> or the minified <code>bootstrap.min.js</code>).</p>
<div class="bs-callout bs-callout-danger">
- <h4>Do not attempt to include both.</h4>
- <p>Both <code>bootstrap.js</code> and <code>bootstrap.min.js</code> contain all plugins in a single file.</p>
+ <h4>Using the compiled JavaScript</h4>
+ <p>Both <code>bootstrap.js</code> and <code>bootstrap.min.js</code> contain all plugins in a single file. Include only one.</p>
+ </div>
+
+ <div class="bs-callout bs-callout-danger">
+ <h4>Component data attributes</h4>
+ <p>Don't use data attributes from multiple plugins on the same element. For example, a button cannot both have a tooltip and toggle a modal. To accomplish this, use a wrapping element.</p>
</div>
<div class="bs-callout bs-callout-danger">
@@ -342,7 +347,7 @@ $('#myModal').on('show.bs.modal', function (e) {
<td>remote</td>
<td>path</td>
<td>false</td>
- <td><p>If a remote URL is provided, <strong>content will be loaded one time</strong> via jQuery's <code>load</code> method and injected into the root of the modal element. If you're using the data-api, you may alternatively use the <code>href</code> attribute to specify the remote source. An example of this is shown below:</p>
+ <td><p>If a remote URL is provided, <strong>content will be loaded one time</strong> via jQuery's <code>load</code> method and injected into the <code>.modal-content</code> div. If you're using the data-api, you may alternatively use the <code>href</code> attribute to specify the remote source. An example of this is shown below:</p>
{% highlight html %}
<a data-toggle="modal" href="remote.html" data-target="#modal">Click me</a>
{% endhighlight %}
@@ -548,6 +553,10 @@ $('#myModal').on('hidden.bs.modal', function (e) {
{% highlight js %}
$('.dropdown-toggle').dropdown()
{% endhighlight %}
+ <div class="bs-callout bs-callout-info">
+ <h4><code>data-toggle="dropdown"</code> still required</h4>
+ <p>Regardless of whether you call your dropdown via JavaScript or instead use the data-api, <code>data-toggle="dropdown"</code> is always required to be present on the dropdown's trigger element.</p>
+ </div>
<h3>Options</h3>
<p><em>None</em></p>
@@ -557,6 +566,7 @@ $('.dropdown-toggle').dropdown()
<p>Toggles the dropdown menu of a given navbar or tabbed navigation.</p>
<h3>Events</h3>
+ <p>All dropdown events are fired at the <code>.dropdown-menu</code>'s parent element.</p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
@@ -941,12 +951,12 @@ $('#example').tooltip(options)
</div>
{% highlight html linenos %}
<!-- HTML to write -->
-<a href="#" data-toggle="tooltip" title="first tooltip">Hover over me</a>
+<a href="#" data-toggle="tooltip" title="Some tooltip text!">Hover over me</a>
<!-- Generated markup by the plugin -->
<div class="tooltip top">
<div class="tooltip-inner">
- Tooltip!
+ Some tooltip text!
</div>
<div class="tooltip-arrow"></div>
</div>
@@ -1434,10 +1444,10 @@ $('#my-alert').bind('closed.bs.alert', function () {
</button>
<script>
$('#loading-example-btn').click(function () {
- var btn = $(this);
- btn.button('loading');
+ var btn = $(this)
+ btn.button('loading')
$.ajax(...).always(function () {
- btn.button('reset');
+ btn.button('reset')
});
});
</script>
@@ -1542,10 +1552,10 @@ $('.btn').button()
<button id="loading-example-btn" type="button" class="btn btn-primary" data-loading-text="loading stuff...">...</button>
<script>
$('#loading-example-btn').click(function () {
- var btn = $(this);
- btn.button('loading');
+ var btn = $(this)
+ btn.button('loading')
$.ajax(...).always(function () {
- btn.button('reset');
+ btn.button('reset')
});
});
</script>