1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +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:
Jacob Thornton
2012-03-24 18:20:09 -07:00
parent ef5ac02b69
commit bccc2cb719
16 changed files with 128 additions and 32 deletions

View File

@@ -61,7 +61,7 @@
}
this.$element[dimension](0)
this.transition('addClass', 'show', 'shown')
this.transition('addClass', $.Event('show'), 'shown')
this.$element[dimension](this.$element[0][scroll])
}
@@ -70,7 +70,7 @@
if (this.transitioning) return
dimension = this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', 'hide', 'hidden')
this.transition('removeClass', $.Event('hide'), 'hidden')
this.$element[dimension](0)
}
@@ -95,11 +95,13 @@
that.$element.trigger(completeEvent)
}
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
this.transitioning = 1
this.$element
.trigger(startEvent)
[method]('in')
this.$element[method]('in')
$.support.transition && this.$element.hasClass('collapse') ?
this.$element.one($.support.transition.end, complete) :