mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 12:59:05 +02:00
add preventDefault support for all inital event types (show, close, hide, etc.) + fix small bug with scrollspy.last
This commit is contained in:
10
js/bootstrap-tab.js
vendored
10
js/bootstrap-tab.js
vendored
@@ -39,6 +39,7 @@
|
||||
, selector = $this.attr('data-target')
|
||||
, previous
|
||||
, $target
|
||||
, e
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
@@ -49,11 +50,14 @@
|
||||
|
||||
previous = $ul.find('.active a').last()[0]
|
||||
|
||||
$this.trigger({
|
||||
type: 'show'
|
||||
, relatedTarget: previous
|
||||
e = $.Event('show', {
|
||||
relatedTarget: previous
|
||||
})
|
||||
|
||||
$this.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$target = $(selector)
|
||||
|
||||
this.activate($this.parent('li'), $ul)
|
||||
|
Reference in New Issue
Block a user