diff options
Diffstat (limited to 'docs/assets/js/bootstrap.js')
| -rw-r--r-- | docs/assets/js/bootstrap.js | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 744b27676..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) } @@ -535,23 +544,19 @@ [dimension](size || 'auto') [0].offsetWidth - this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') + this.$element[size != null ? 'addClass' : 'removeClass']('collapse') 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') @@ -603,7 +608,10 @@ || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 var option = $(target).data('collapse') ? 'toggle' : $this.data() + var parent = $this.attr('data-parent') + var $parent = parent && $(parent) + if ($parent) $parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed') $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') $(target).collapse(option) }) @@ -1420,6 +1428,8 @@ $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) $tip.removeClass('fade top bottom left right in') + + $tip.find('.popover-title:empty').hide() } Popover.prototype.hasContent = function () { |
