mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
Merge branch '3.0.0-wip' of github.com:twitter/bootstrap into 3.0.0-wip
This commit is contained in:
commit
e6906040de
@ -145,21 +145,22 @@
|
|||||||
// =================
|
// =================
|
||||||
|
|
||||||
$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
||||||
var $this = $(this), href
|
var $this = $(this), href
|
||||||
var target = $this.attr('data-target')
|
var target = $this.attr('data-target')
|
||||||
|| e.preventDefault()
|
|| e.preventDefault()
|
||||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||||
var data = $(target).data('bs.collapse')
|
var $target = $(target)
|
||||||
var option = data ? 'toggle' : $this.data()
|
var data = $target.data('bs.collapse')
|
||||||
var parent = $this.attr('data-parent')
|
var option = data ? 'toggle' : $this.data()
|
||||||
|
var parent = $this.attr('data-parent')
|
||||||
var $parent = parent && $(parent)
|
var $parent = parent && $(parent)
|
||||||
|
|
||||||
if (!data || !data.transitioning) {
|
if (!data || !data.transitioning) {
|
||||||
if ($parent) $parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed')
|
if ($parent) $parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed')
|
||||||
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||||
}
|
}
|
||||||
|
|
||||||
$(target).collapse(option)
|
$target.collapse(option)
|
||||||
})
|
})
|
||||||
|
|
||||||
}(window.jQuery);
|
}(window.jQuery);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user