aboutsummaryrefslogtreecommitdiff
path: root/docs/assets/js/bootstrap.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-07-17 20:18:03 -0700
committerMark Otto <[email protected]>2013-07-17 20:18:03 -0700
commitbfebf0e490c795601220f74b7089adb4f47acda7 (patch)
tree64c5ce0bff15e7d03da07818bef20b46050ef200 /docs/assets/js/bootstrap.js
parent7cc34ea54765520b62491b53f9dfb24db6ffdfdc (diff)
parent5396c40877eed11a21e4c0934b691e95b8e35be2 (diff)
downloadbootstrap-bfebf0e490c795601220f74b7089adb4f47acda7.tar.xz
bootstrap-bfebf0e490c795601220f74b7089adb4f47acda7.zip
Merge branch '3.0.0-wip' of github.com:twitter/bootstrap into 3.0.0-wip
Diffstat (limited to 'docs/assets/js/bootstrap.js')
-rw-r--r--docs/assets/js/bootstrap.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js
index 03888ac5f..b4845bb80 100644
--- a/docs/assets/js/bootstrap.js
+++ b/docs/assets/js/bootstrap.js
@@ -502,6 +502,10 @@
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
+ var startEvent = $.Event('show.bs.collapse')
+ this.$element.trigger(startEvent)
+ if (startEvent.isDefaultPrevented()) return
+
var dimension = this.dimension()
var scroll = $.camelCase(['scroll', dimension].join('-'))
var actives = this.$parent && this.$parent.find('> .accordion-group > .in')
@@ -514,16 +518,21 @@
}
this.$element[dimension](0)
- this.transition('addClass', $.Event('show.bs.collapse'), 'shown.bs.collapse')
+ this.transition('addClass', 'shown.bs.collapse')
if ($.support.transition) this.$element[dimension](this.$element[0][scroll])
}
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
+
+ var startEvent = $.Event('hide.bs.collapse')
+ this.$element.trigger(startEvent)
+ if (startEvent.isDefaultPrevented()) return
+
var dimension = this.dimension()
this.reset(this.$element[dimension]())
- this.transition('removeClass', $.Event('hide.bs.collapse'), 'hidden')
+ this.transition('removeClass', 'shown.bs.hidden')
this.$element[dimension](0)
}
@@ -540,18 +549,14 @@
return this
}
- Collapse.prototype.transition = function (method, startEvent, completeEvent) {
+ Collapse.prototype.transition = function (method, completeEvent) {
var that = this
var complete = function () {
- if (startEvent.type == 'show') that.reset()
+ if (completeEvent == 'shown.bs.collapse') that.reset()
that.transitioning = 0
that.$element.trigger(completeEvent)
}
- this.$element.trigger(startEvent)
-
- if (startEvent.isDefaultPrevented()) return
-
this.transitioning = 1
this.$element[method]('in')