vendor/assets/javascripts/collapse.js in flashgrid-1.1.2 vs vendor/assets/javascripts/collapse.js in flashgrid-1.2.0
- old
+ new
@@ -40,33 +40,34 @@
var dimension = this.dimension()
this.$element
.removeClass('collapse')
- .addClass('collapsing')
- [dimension](0)
+ .addClass('collapsing')[dimension](0)
this.transitioning = 1
var complete = function (e) {
- if (e && e.target != this.$element[0]) return
+ if (e && e.target != this.$element[0]) {
+ this.$element
+ .one($.support.transition.end, $.proxy(complete, this))
+ return
+ }
this.$element
.removeClass('collapsing')
- .addClass('collapse in')
- [dimension]('auto')
+ .addClass('collapse in')[dimension]('')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
this.$element
.one($.support.transition.end, $.proxy(complete, this))
- .emulateTransitionEnd(350)
- [dimension](this.$element[0][scrollSize])
+ .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
}
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
@@ -74,22 +75,24 @@
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var dimension = this.dimension()
- this.$element
- [dimension](this.$element[dimension]())
- [0].offsetHeight
+ this.$element[dimension](this.$element[dimension]())[0].offsetHeight
this.$element
.addClass('collapsing')
.removeClass('collapse')
.removeClass('in')
this.transitioning = 1
var complete = function (e) {
- if (e && e.target != this.$element[0]) return
+ if (e && e.target != this.$element[0]) {
+ this.$element
+ .one($.support.transition.end, $.proxy(complete, this))
+ return
+ }
this.transitioning = 0
this.$element
.trigger('hidden.bs.collapse')
.removeClass('collapsing')
.addClass('collapse')
\ No newline at end of file