0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-20 17:54:23 +01:00

only prevent default if getting data-href

This commit is contained in:
Jacob Thornton 2012-01-20 13:42:10 -08:00
parent c75a59e741
commit 93c8152216

View File

@ -125,9 +125,8 @@
$(function () {
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
var $this = $(this)
, target = $this.attr('data-target') || $this.attr('href')
, target = $this.attr('data-target') || e.preventDefault() || $this.attr('href')
, option = $(target).data('collapse') ? 'toggle' : $this.data()
e.preventDefault()
$(target).collapse(option)
})
})