comparison static/bootstrap/js/bootstrap-collapse.js @ 88:a5a3d454eac9

Updated Bootstrap.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 05 Apr 2013 08:08:12 -0700
parents 130eccd396d8
children
comparison
equal deleted inserted replaced
87:c0cf67362fb1 88:a5a3d454eac9
1 /* ============================================================= 1 /* =============================================================
2 * bootstrap-collapse.js v2.2.2 2 * bootstrap-collapse.js v2.3.1
3 * http://twitter.github.com/bootstrap/javascript.html#collapse 3 * http://twitter.github.com/bootstrap/javascript.html#collapse
4 * ============================================================= 4 * =============================================================
5 * Copyright 2012 Twitter, Inc. 5 * Copyright 2012 Twitter, Inc.
6 * 6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * Licensed under the Apache License, Version 2.0 (the "License");
50 var dimension 50 var dimension
51 , scroll 51 , scroll
52 , actives 52 , actives
53 , hasData 53 , hasData
54 54
55 if (this.transitioning) return 55 if (this.transitioning || this.$element.hasClass('in')) return
56 56
57 dimension = this.dimension() 57 dimension = this.dimension()
58 scroll = $.camelCase(['scroll', dimension].join('-')) 58 scroll = $.camelCase(['scroll', dimension].join('-'))
59 actives = this.$parent && this.$parent.find('> .accordion-group > .in') 59 actives = this.$parent && this.$parent.find('> .accordion-group > .in')
60 60
70 $.support.transition && this.$element[dimension](this.$element[0][scroll]) 70 $.support.transition && this.$element[dimension](this.$element[0][scroll])
71 } 71 }
72 72
73 , hide: function () { 73 , hide: function () {
74 var dimension 74 var dimension
75 if (this.transitioning) return 75 if (this.transitioning || !this.$element.hasClass('in')) return
76 dimension = this.dimension() 76 dimension = this.dimension()
77 this.reset(this.$element[dimension]()) 77 this.reset(this.$element[dimension]())
78 this.transition('removeClass', $.Event('hide'), 'hidden') 78 this.transition('removeClass', $.Event('hide'), 'hidden')
79 this.$element[dimension](0) 79 this.$element[dimension](0)
80 } 80 }
127 127
128 $.fn.collapse = function (option) { 128 $.fn.collapse = function (option) {
129 return this.each(function () { 129 return this.each(function () {
130 var $this = $(this) 130 var $this = $(this)
131 , data = $this.data('collapse') 131 , data = $this.data('collapse')
132 , options = typeof option == 'object' && option 132 , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
133 if (!data) $this.data('collapse', (data = new Collapse(this, options))) 133 if (!data) $this.data('collapse', (data = new Collapse(this, options)))
134 if (typeof option == 'string') data[option]() 134 if (typeof option == 'string') data[option]()
135 }) 135 })
136 } 136 }
137 137