]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
only prevent default if getting data-href
authorJacob Thornton <jacobthornton@gmail.com>
Fri, 20 Jan 2012 21:42:10 +0000 (13:42 -0800)
committerJacob Thornton <jacobthornton@gmail.com>
Fri, 20 Jan 2012 21:42:10 +0000 (13:42 -0800)
js/bootstrap-collapse.js

index 2521b7c7a7528b96c6fafc4259632ee23b1d8461..9278f66d0e780e1f6626816f88583c0fe9d1f22e 100644 (file)
   $(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)
     })
   })