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
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/bootstrap-alert.js4
-rw-r--r--js/bootstrap-button.js10
-rw-r--r--js/bootstrap-carousel.js14
-rw-r--r--js/bootstrap-collapse.js18
-rw-r--r--js/bootstrap-dropdown.js13
-rw-r--r--js/bootstrap-modal.js28
-rw-r--r--js/bootstrap-tab.js8
-rw-r--r--js/bootstrap-typeahead.js12
8 files changed, 45 insertions, 62 deletions
diff --git a/js/bootstrap-alert.js b/js/bootstrap-alert.js
index 8500bd273c..b0bdc4b7d9 100644
--- a/js/bootstrap-alert.js
+++ b/js/bootstrap-alert.js
@@ -83,8 +83,6 @@
/* ALERT DATA-API
* ============== */
- $(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..dbb2c08ed3 100644
--- a/js/bootstrap-button.js
+++ b/js/bootstrap-button.js
@@ -85,12 +85,10 @@
/* BUTTON DATA-API
* =============== */
- $(function () {
- $('body').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')
- })
+ $(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')
})
}(window.jQuery); \ No newline at end of file
diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js
index b533156526..0101f8881a 100644
--- a/js/bootstrap-carousel.js
+++ b/js/bootstrap-carousel.js
@@ -165,14 +165,12 @@
/* CAROUSEL DATA-API
* ================= */
- $(function () {
- $('body').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('carousel') && $.extend({}, $target.data(), $this.data())
- $target.carousel(options)
- e.preventDefault()
- })
+ $(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('carousel') && $.extend({}, $target.data(), $this.data())
+ $target.carousel(options)
+ e.preventDefault()
})
}(window.jQuery); \ No newline at end of file
diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js
index 7345758000..392e486a89 100644
--- a/js/bootstrap-collapse.js
+++ b/js/bootstrap-collapse.js
@@ -143,16 +143,14 @@
/* COLLAPSIBLE DATA-API
* ==================== */
- $(function () {
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
- var $this = $(this), href
- , target = $this.attr('data-target')
- || e.preventDefault()
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
- , option = $(target).data('collapse') ? 'toggle' : $this.data()
- $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
- $(target).collapse(option)
- })
+ $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
+ var $this = $(this), href
+ , target = $this.attr('data-target')
+ || e.preventDefault()
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
+ $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
+ $(target).collapse(option)
})
}(window.jQuery); \ No newline at end of file
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js
index 503fb7b3ac..4f99e04ffa 100644
--- a/js/bootstrap-dropdown.js
+++ b/js/bootstrap-dropdown.js
@@ -139,13 +139,10 @@
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
- $(function () {
- $('html')
- .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
- $('body')
- .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)
- })
+ $(document)
+ .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
+ .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)
}(window.jQuery); \ No newline at end of file
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js
index d2a4878b3d..185519aaf8 100644
--- a/js/bootstrap-modal.js
+++ b/js/bootstrap-modal.js
@@ -214,21 +214,19 @@
/* MODAL DATA-API
* ============== */
- $(function () {
- $('body').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
- , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
-
- e.preventDefault()
-
- $target
- .modal(option)
- .one('hide', function () {
- $this.focus()
- })
- })
+ $(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
+ , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
+
+ e.preventDefault()
+
+ $target
+ .modal(option)
+ .one('hide', function () {
+ $this.focus()
+ })
})
}(window.jQuery);
diff --git a/js/bootstrap-tab.js b/js/bootstrap-tab.js
index b4e142864e..cc9cba7dcf 100644
--- a/js/bootstrap-tab.js
+++ b/js/bootstrap-tab.js
@@ -125,11 +125,9 @@
/* TAB DATA-API
* ============ */
- $(function () {
- $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
- e.preventDefault()
- $(this).tab('show')
- })
+ $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
+ e.preventDefault()
+ $(this).tab('show')
})
}(window.jQuery); \ No newline at end of file
diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js
index 78cbe9faa5..dc0c7fa07a 100644
--- a/js/bootstrap-typeahead.js
+++ b/js/bootstrap-typeahead.js
@@ -297,13 +297,11 @@
/* TYPEAHEAD DATA-API
* ================== */
- $(function () {
- $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
- var $this = $(this)
- if ($this.data('typeahead')) return
- e.preventDefault()
- $this.typeahead($this.data())
- })
+ $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
+ var $this = $(this)
+ if ($this.data('typeahead')) return
+ e.preventDefault()
+ $this.typeahead($this.data())
})
}(window.jQuery);