From aad910465c3379061b15f3d515a806dad63375ad Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 24 Jul 2013 20:21:23 -0700 Subject: [PATCH] fixes #8569 --- dist/js/bootstrap.js | 8 ++++---- javascript.html | 6 +++--- js/modal.js | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index dbcb9a0c7b..11ca613101 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -1027,11 +1027,11 @@ .one('hide', function () { $this.is(':visible') && $this.focus() }) - }) + }) - var $body = $(document.body) - .on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') }) - .on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') }) + var $body = $(document.body) + .on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') }) + .on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') }) }(window.jQuery); /* ======================================================================== diff --git a/javascript.html b/javascript.html index 72b37d4fb6..23fe677191 100644 --- a/javascript.html +++ b/javascript.html @@ -29,14 +29,14 @@ lead: "Bring Bootstrap's components to life with over a dozen custom jQuery plug

Data attributes

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.

-

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 data-api. This looks like this: +

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 data-api. This looks like this: {% highlight js %} -$('body').off('.data-api') +$(document).off('.data-api') {% endhighlight %}

Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:

{% highlight js %} -$('body').off('.alert.data-api') +$(document).off('.alert.data-api') {% endhighlight %}

Programmatic API

diff --git a/js/modal.js b/js/modal.js index 5a234146e3..4a89ba7eac 100644 --- a/js/modal.js +++ b/js/modal.js @@ -232,10 +232,10 @@ .one('hide', function () { $this.is(':visible') && $this.focus() }) - }) + }) - var $body = $(document.body) - .on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') }) - .on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') }) + var $body = $(document.body) + .on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') }) + .on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') }) }(window.jQuery);