Sha256: 03cebf8dda92a07005643b2e97ebc07c71d7bbf204afc16aae42b0707f4685d1

Contents?: true

Size: 1.7 KB

Versions: 48

Compression:

Stored size: 1.7 KB

Contents

/* ============================================================
 * bootstrap-buttons.js v1.4.0
 * http://twitter.github.com/bootstrap/javascript.html#buttons
 * ============================================================
 * Copyright 2011 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */

!function( $ ){

  "use strict"

  function setState(el, state) {
    var d = 'disabled'
      , $el = $(el)
      , data = $el.data()

    state = state + 'Text'
    data.resetText || $el.data('resetText', $el.html())

    $el.html( data[state] || $.fn.button.defaults[state] )

    state == 'loadingText' ?
      $el.addClass(d).attr(d, d) :
      $el.removeClass(d).removeAttr(d)
  }

  function toggle(el) {
    $(el).toggleClass('active')
  }

  $.fn.button = function(options) {
    return this.each(function () {
      if (options == 'toggle') {
        return toggle(this)
      }
      options && setState(this, options)
    })
  }

  $.fn.button.defaults = {
    loadingText: 'loading...'
  }

  $(function () {
    $('body').delegate('.btn[data-toggle]', 'click', function () {
      $(this).button('toggle')
    })
  })

}( window.jQuery || window.ender );

Version data entries

48 entries across 48 versions & 9 rubygems

Version Path
spiderfw-1.0.1 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-1.0.0 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.39 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.38 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.37 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.35 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.34 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.33 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.32 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.31 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.30 apps/core/admin/public/js/bootstrap-buttons.js
namey-0.0.10 api/public/js/bootstrap-buttons.js
namey-0.0.9 api/public/js/bootstrap-buttons.js
spiderfw-0.6.29 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.28 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.27 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.26 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.26.pre1 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.25 apps/core/admin/public/js/bootstrap-buttons.js
spiderfw-0.6.24 apps/core/admin/public/js/bootstrap-buttons.js