mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-06 13:46:42 +02:00
read data options in constructor for collapse
This commit is contained in:
2
js/bootstrap-collapse.js
vendored
2
js/bootstrap-collapse.js
vendored
@@ -129,7 +129,7 @@
|
|||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('collapse')
|
, data = $this.data('collapse')
|
||||||
, options = typeof option == 'object' && option
|
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
|
||||||
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
||||||
if (typeof option == 'string') data[option]()
|
if (typeof option == 'string') data[option]()
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user