diff options
author | fat <jacobthornton@gmail.com> | 2013-07-18 07:29:41 +0400 |
---|---|---|
committer | fat <jacobthornton@gmail.com> | 2013-07-18 07:29:41 +0400 |
commit | 392bf0c9c9086f2428c12ed5d9efa9b08a8cdb42 (patch) | |
tree | 89e745af88cf1fc6377fd799a046ee9407c57235 /docs/assets/js/bootstrap.js | |
parent | 5396c40877eed11a21e4c0934b691e95b8e35be2 (diff) |
fixes #6691
Diffstat (limited to 'docs/assets/js/bootstrap.js')
-rw-r--r-- | docs/assets/js/bootstrap.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index b4845bb80a..fc2da67090 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -511,10 +511,10 @@ var actives = this.$parent && this.$parent.find('> .accordion-group > .in') if (actives && actives.length) { - var hasData = actives.data('collapse') + var hasData = actives.data('bs.collapse') if (hasData && hasData.transitioning) return actives.collapse('hide') - hasData || actives.data('collapse', null) + hasData || actives.data('bs.collapse', null) } this.$element[dimension](0) @@ -579,10 +579,10 @@ $.fn.collapse = function (option) { return this.each(function () { var $this = $(this) - var data = $this.data('collapse') + var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) } @@ -607,12 +607,17 @@ var target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - var option = $(target).data('collapse') ? 'toggle' : $this.data() + var data = $(target).data('bs.collapse') + var option = data ? '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') + console.log(data, data && data.transitioning) + if (data && !data.transitioning) { + if ($parent) $parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed') + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + } + $(target).collapse(option) }) |