]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
read data options in constructor for collapse
authorfat <jacobthornton@gmail.com>
Sat, 22 Dec 2012 21:48:16 +0000 (13:48 -0800)
committerfat <jacobthornton@gmail.com>
Sat, 22 Dec 2012 21:48:16 +0000 (13:48 -0800)
js/bootstrap-collapse.js

index 6755aa7e2014fa198ce3944f0044d6e9a46cd0b2..3498cdecbb1ec9bff5d5e64e33c9a428cafd0435 100644 (file)
     return this.each(function () {
       var $this = $(this)
         , 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 (typeof option == 'string') data[option]()
     })