1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +02:00

don't wait for ready when binding events to document

This commit is contained in:
Carl Porth
2012-09-27 15:00:02 -07:00
parent 474471b831
commit e1f6458e36
8 changed files with 43 additions and 60 deletions

View File

@@ -85,12 +85,10 @@
/* BUTTON DATA-API
* =============== */
$(function () {
$(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')
})
$(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);