front-page new structure with module-gallery and content and footer logo-gallery
1 /* ========================================================================
2 * Bootstrap: button.js v3.0.3
3 * http://getbootstrap.com/javascript/#buttons
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 // BUTTON PUBLIC CLASS DEFINITION
24 // ==============================
26 var Button = function (element, options) {
27 this.$element = $(element)
28 this.options = $.extend({}, Button.DEFAULTS, options)
32 loadingText: 'loading...'
35 Button.prototype.setState = function (state) {
37 var $el = this.$element
38 var val = $el.is('input') ? 'val' : 'html'
41 state = state + 'Text'
43 if (!data.resetText) $el.data('resetText', $el[val]())
45 $el[val](data[state] || this.options[state])
47 // push to event loop to allow forms to submit
48 setTimeout(function () {
49 state == 'loadingText' ?
50 $el.addClass(d).attr(d, d) :
51 $el.removeClass(d).removeAttr(d);
55 Button.prototype.toggle = function () {
56 var $parent = this.$element.closest('[data-toggle="buttons"]')
60 var $input = this.$element.find('input')
61 if ($input.prop('type') === 'radio') {
62 // see if clicking on current one
63 if ($input.prop('checked') && this.$element.hasClass('active'))
66 $parent.find('.active').removeClass('active')
68 if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
71 if (changed) this.$element.toggleClass('active')
75 // BUTTON PLUGIN DEFINITION
76 // ========================
80 $.fn.button = function (option) {
81 return this.each(function () {
83 var data = $this.data('bs.button')
84 var options = typeof option == 'object' && option
86 if (!data) $this.data('bs.button', (data = new Button(this, options)))
88 if (option == 'toggle') data.toggle()
89 else if (option) data.setState(option)
93 $.fn.button.Constructor = Button
99 $.fn.button.noConflict = function () {
108 $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
109 var $btn = $(e.target)
110 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
111 $btn.button('toggle')