diff options
author | Carl Porth <badcarl@gmail.com> | 2012-09-28 02:00:02 +0400 |
---|---|---|
committer | Carl Porth <badcarl@gmail.com> | 2012-09-28 02:00:02 +0400 |
commit | e1f6458e3640a628cdb6b2e4c63950777d46e141 (patch) | |
tree | cf4f67f4a214999cfb5024f6fbe12697b2c3cc17 /js/bootstrap-collapse.js | |
parent | 474471b83140350de320f3ba940bd7dd8326b32e (diff) |
don't wait for ready when binding events to document
Diffstat (limited to 'js/bootstrap-collapse.js')
-rw-r--r-- | js/bootstrap-collapse.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js index 781e274374..392e486a89 100644 --- a/js/bootstrap-collapse.js +++ b/js/bootstrap-collapse.js @@ -143,16 +143,14 @@ /* COLLAPSIBLE DATA-API * ==================== */ - $(function () { - $(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) - }) + $(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 |