2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-11 18:02:28 +03:00

.collapse('hide') on hidden uninit-ed collapsible no longer shows it; fixes #15315

Thanks to @peterblazejewicz & @Nikita240
Adds unit tests based on #14417
X-Ref: #14282
Closes #15807
This commit is contained in:
Chris Rebert
2015-03-06 03:05:30 -08:00
parent 01aa0d840a
commit 872e56fcf2
2 changed files with 31 additions and 3 deletions
+1 -1
View File
@@ -172,7 +172,7 @@
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data && options.toggle && option == 'show') options.toggle = false
if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})