Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Porth <badcarl@gmail.com>2012-09-27 10:11:03 +0400
committerCarl Porth <badcarl@gmail.com>2012-09-27 10:11:03 +0400
commit474471b83140350de320f3ba940bd7dd8326b32e (patch)
treefe11a67690e6e84ce8e6a057b780af37ab341d87
parent24e277b85abace0f77076b1cfa96e11b1d1dc891 (diff)
bind data-api events to document instead of body to allow body replacement
-rw-r--r--js/bootstrap-alert.js2
-rw-r--r--js/bootstrap-button.js2
-rw-r--r--js/bootstrap-carousel.js2
-rw-r--r--js/bootstrap-collapse.js2
-rw-r--r--js/bootstrap-dropdown.js2
-rw-r--r--js/bootstrap-modal.js2
-rw-r--r--js/bootstrap-tab.js2
-rw-r--r--js/bootstrap-typeahead.js2
8 files changed, 8 insertions, 8 deletions
diff --git a/js/bootstrap-alert.js b/js/bootstrap-alert.js
index 8500bd273c..ea3209ed19 100644
--- a/js/bootstrap-alert.js
+++ b/js/bootstrap-alert.js
@@ -84,7 +84,7 @@
* ============== */
$(function () {
- $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
+ $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
})
}(window.jQuery); \ No newline at end of file
diff --git a/js/bootstrap-button.js b/js/bootstrap-button.js
index cc2d0048fd..4c0b725c7a 100644
--- a/js/bootstrap-button.js
+++ b/js/bootstrap-button.js
@@ -86,7 +86,7 @@
* =============== */
$(function () {
- $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
+ $(document).on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
$btn.button('toggle')
diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js
index 0d7167e1c2..8751b320cc 100644
--- a/js/bootstrap-carousel.js
+++ b/js/bootstrap-carousel.js
@@ -164,7 +164,7 @@
* ================= */
$(function () {
- $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
+ $(document).on('click.carousel.data-api', '[data-slide]', function ( e ) {
var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js
index 7345758000..781e274374 100644
--- a/js/bootstrap-collapse.js
+++ b/js/bootstrap-collapse.js
@@ -144,7 +144,7 @@
* ==================== */
$(function () {
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
+ $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href
, target = $this.attr('data-target')
|| e.preventDefault()
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js
index 0ef9b0f9d2..5a2766fdea 100644
--- a/js/bootstrap-dropdown.js
+++ b/js/bootstrap-dropdown.js
@@ -141,7 +141,7 @@
$(function () {
$('html')
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
- $('body')
+ $(document)
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js
index d53f13a00c..8a40c2d4e6 100644
--- a/js/bootstrap-modal.js
+++ b/js/bootstrap-modal.js
@@ -216,7 +216,7 @@
* ============== */
$(function () {
- $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
+ $(document).on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
var $this = $(this)
, href = $this.attr('href')
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
diff --git a/js/bootstrap-tab.js b/js/bootstrap-tab.js
index 4fb3c38399..14387a1bf4 100644
--- a/js/bootstrap-tab.js
+++ b/js/bootstrap-tab.js
@@ -126,7 +126,7 @@
* ============ */
$(function () {
- $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
+ $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
$(this).tab('show')
})
diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js
index 78cbe9faa5..ab1d66879d 100644
--- a/js/bootstrap-typeahead.js
+++ b/js/bootstrap-typeahead.js
@@ -298,7 +298,7 @@
* ================== */
$(function () {
- $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
+ $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
var $this = $(this)
if ($this.data('typeahead')) return
e.preventDefault()