front-page new structure with module-gallery and content and footer logo-gallery
1 /* ========================================================================
2 * Bootstrap: collapse.js v3.0.3
3 * http://getbootstrap.com/javascript/#collapse
4 * ========================================================================
5 * Copyright 2013 Twitter, Inc.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ======================================================================== */
21 +function ($) { "use strict";
23 // COLLAPSE PUBLIC CLASS DEFINITION
24 // ================================
26 var Collapse = function (element, options) {
27 this.$element = $(element)
28 this.options = $.extend({}, Collapse.DEFAULTS, options)
29 this.transitioning = null
31 if (this.options.parent) this.$parent = $(this.options.parent)
32 if (this.options.toggle) this.toggle()
39 Collapse.prototype.dimension = function () {
40 var hasWidth = this.$element.hasClass('width')
41 return hasWidth ? 'width' : 'height'
44 Collapse.prototype.show = function () {
45 if (this.transitioning || this.$element.hasClass('in')) return
47 var startEvent = $.Event('show.bs.collapse')
48 this.$element.trigger(startEvent)
49 if (startEvent.isDefaultPrevented()) return
51 var actives = this.$parent && this.$parent.find('> .panel > .in')
53 if (actives && actives.length) {
54 var hasData = actives.data('bs.collapse')
55 if (hasData && hasData.transitioning) return
56 actives.collapse('hide')
57 hasData || actives.data('bs.collapse', null)
60 var dimension = this.dimension()
63 .removeClass('collapse')
64 .addClass('collapsing')
67 this.transitioning = 1
69 var complete = function () {
71 .removeClass('collapsing')
74 this.transitioning = 0
75 this.$element.trigger('shown.bs.collapse')
78 if (!$.support.transition) return complete.call(this)
80 var scrollSize = $.camelCase(['scroll', dimension].join('-'))
83 .one($.support.transition.end, $.proxy(complete, this))
84 .emulateTransitionEnd(350)
85 [dimension](this.$element[0][scrollSize])
88 Collapse.prototype.hide = function () {
89 if (this.transitioning || !this.$element.hasClass('in')) return
91 var startEvent = $.Event('hide.bs.collapse')
92 this.$element.trigger(startEvent)
93 if (startEvent.isDefaultPrevented()) return
95 var dimension = this.dimension()
98 [dimension](this.$element[dimension]())
102 .addClass('collapsing')
103 .removeClass('collapse')
106 this.transitioning = 1
108 var complete = function () {
109 this.transitioning = 0
111 .trigger('hidden.bs.collapse')
112 .removeClass('collapsing')
113 .addClass('collapse')
116 if (!$.support.transition) return complete.call(this)
120 .one($.support.transition.end, $.proxy(complete, this))
121 .emulateTransitionEnd(350)
124 Collapse.prototype.toggle = function () {
125 this[this.$element.hasClass('in') ? 'hide' : 'show']()
129 // COLLAPSE PLUGIN DEFINITION
130 // ==========================
132 var old = $.fn.collapse
134 $.fn.collapse = function (option) {
135 return this.each(function () {
137 var data = $this.data('bs.collapse')
138 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
140 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
141 if (typeof option == 'string') data[option]()
145 $.fn.collapse.Constructor = Collapse
148 // COLLAPSE NO CONFLICT
149 // ====================
151 $.fn.collapse.noConflict = function () {
160 $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
161 var $this = $(this), href
162 var target = $this.attr('data-target')
163 || e.preventDefault()
164 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
165 var $target = $(target)
166 var data = $target.data('bs.collapse')
167 var option = data ? 'toggle' : $this.data()
168 var parent = $this.attr('data-parent')
169 var $parent = parent && $(parent)
171 if (!data || !data.transitioning) {
172 if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
173 $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
176 $target.collapse(option)