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:
parent
c75a59e741
commit
93c8152216
3
js/bootstrap-collapse.js
vendored
3
js/bootstrap-collapse.js
vendored
@ -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)
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user