Commit aad91046 authored by Jacob Thornton's avatar Jacob Thornton
Browse files

fixes #8569

parent a282dba5
Showing with 11 additions and 11 deletions
+11 -11
...@@ -1027,11 +1027,11 @@ ...@@ -1027,11 +1027,11 @@
.one('hide', function () { .one('hide', function () {
$this.is(':visible') && $this.focus() $this.is(':visible') && $this.focus()
}) })
}) })
var $body = $(document.body) var $body = $(document.body)
.on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') }) .on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') }) .on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') })
}(window.jQuery); }(window.jQuery);
/* ======================================================================== /* ========================================================================
......
...@@ -29,14 +29,14 @@ lead: "Bring Bootstrap's components to life with over a dozen custom jQuery plug ...@@ -29,14 +29,14 @@ lead: "Bring Bootstrap's components to life with over a dozen custom jQuery plug
<h3 id="js-data-attrs">Data attributes</h3> <h3 id="js-data-attrs">Data attributes</h3>
<p>You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API and should be your first consideration when using a plugin.</p> <p>You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API and should be your first consideration when using a plugin.</p>
<p>That said, in some situations it may be desirable to turn this functionality off. Therefore, we also provide the ability to disable the data attribute API by unbinding all events on the body namespaced with <code>data-api</code>. This looks like this: <p>That said, in some situations it may be desirable to turn this functionality off. Therefore, we also provide the ability to disable the data attribute API by unbinding all events on the document namespaced with <code>data-api</code>. This looks like this:
{% highlight js %} {% highlight js %}
$('body').off('.data-api') $(document).off('.data-api')
{% endhighlight %} {% endhighlight %}
<p>Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:</p> <p>Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:</p>
{% highlight js %} {% highlight js %}
$('body').off('.alert.data-api') $(document).off('.alert.data-api')
{% endhighlight %} {% endhighlight %}
<h3 id="js-programmatic-api">Programmatic API</h3> <h3 id="js-programmatic-api">Programmatic API</h3>
......
...@@ -232,10 +232,10 @@ ...@@ -232,10 +232,10 @@
.one('hide', function () { .one('hide', function () {
$this.is(':visible') && $this.focus() $this.is(':visible') && $this.focus()
}) })
}) })
var $body = $(document.body) var $body = $(document.body)
.on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') }) .on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') }) .on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') })
}(window.jQuery); }(window.jQuery);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment