mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-23 20:40:36 +03:00
only prevent default if getting data-href
This commit is contained in:
Vendored
+1
-2
@@ -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