diff options
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 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 |