1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 15:44:51 +02:00

add code to reset data for collapsed element so that item can be intitialized with correct options

This commit is contained in:
Jacob Thornton
2011-11-27 17:31:12 -08:00
parent 7522517b47
commit 7eb340ec58
4 changed files with 20 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/* ==========================================================
* bootstrap-alerts.js v2.0.0
* bootstrap-alert.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2011 Twitter, Inc.

View File

@@ -42,8 +42,14 @@
, show: function () {
var dimension = this.dimension()
, scroll = $.camelCase(['scroll', dimension].join('-'))
, actives = this.$parent && this.$parent.find('.in')
, hasData
this.$parent && this.$parent.find('.in').collapse('hide')
if (actives && actives.length) {
hasData = actives.data('collapse')
actives.collapse('hide')
hasData || actives.data('collapse', null)
}
this.$element[dimension](0)
this.transition('addClass', 'show', 'shown')