mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-09 15:16:51 +02:00
only prevent default if getting data-href
This commit is contained in:
3
js/bootstrap-collapse.js
vendored
3
js/bootstrap-collapse.js
vendored
@@ -125,9 +125,8 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
|
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
|
||||||
var $this = $(this)
|
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()
|
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
||||||
e.preventDefault()
|
|
||||||
$(target).collapse(option)
|
$(target).collapse(option)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user