Commit 98fddaa3 authored by Jacob Thornton's avatar Jacob Thornton

new plugin "collapse" for collapsible lists and "accordion" like support

parent 96adf8f9
......@@ -6,7 +6,7 @@
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Date: Thu Nov 24 13:45:21 PST 2011
* Date: Fri Nov 25 12:09:37 PST 2011
*/
/* Reset.less
* Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc).
......@@ -1879,6 +1879,32 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner {
.fade.in {
opacity: 1;
}
.collapse {
position: relative;
overflow: hidden;
}
.collapse.height {
-webkit-transition: height 0.35s ease;
-moz-transition: height 0.35s ease;
-ms-transition: height 0.35s ease;
-o-transition: height 0.35s ease;
transition: height 0.35s ease;
height: 0;
}
.collapse.height.in {
height: auto;
}
.collapse.width {
-webkit-transition: width 0.35s ease;
-moz-transition: width 0.35s ease;
-ms-transition: width 0.35s ease;
-o-transition: width 0.35s ease;
transition: width 0.35s ease;
width: 0;
}
.collapse.width.in {
width: auto;
}
.label {
padding: 1px 3px 2px;
font-size: 9.75px;
......
......@@ -278,6 +278,8 @@ button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0;
.alert-message.block-message.info{background-color:#ddf4fb;border-color:#c6edf9;}
.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);}
.fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;}
.collapse{position:relative;overflow:hidden;}.collapse.height{-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-ms-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;height:0;}.collapse.height.in{height:auto;}
.collapse.width{-webkit-transition:width 0.35s ease;-moz-transition:width 0.35s ease;-ms-transition:width 0.35s ease;-o-transition:width 0.35s ease;transition:width 0.35s ease;width:0;}.collapse.width.in{width:auto;}
.label{padding:1px 3px 2px;font-size:9.75px;font-weight:bold;color:#ffffff;text-transform:uppercase;background-color:#bfbfbf;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.label.important{background-color:#c43c35;}
.label.warning{background-color:#f89406;}
.label.success{background-color:#46a546;}
......
......@@ -473,3 +473,19 @@ h2 + table {
}
}
#accordion dt a{
display:block;
padding: 9px 15px;
line-height: 1;
background-color: whiteSmoke;
border: 1px solid #EEE;
border-top-color: #fff;
}
#accordion dt:first-child a {
border-top-color:#eee;
}
#accordion dd p {
padding: 10px;
}
\ No newline at end of file
This diff is collapsed.
/* =============================================================
* bootstrap-collapsible.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#collapsible
* =============================================================
* 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"
var Collapse = function ( element, options ) {
this.$element = $(element)
this.settings = $.extend({}, $.fn.collapse.defaults, options)
if (this.settings["parent"]) {
this.$parent = $(this.settings["parent"])
}
this.settings.toggle && this.toggle()
}
Collapse.prototype = {
dimension: function () {
var hasWidth = this.$element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
, show: function () {
var dimension = this.dimension()
, scroll = $.camelCase(['scroll', dimension].join('-'))
this.$parent && this.$parent.find('.in').collapse('hide')
this.$element[dimension](0)
this.transition('addClass', 'show', 'shown')
this.$element[dimension](this.$element[0][scroll])
}
, hide: function () {
var dimension = this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', 'hide', 'hidden')
this.$element[dimension](0)
}
, reset: function ( size ) {
var dimension = this.dimension()
this.$element
.removeClass('collapse')
[dimension](size || '')
[0].offsetWidth
this.$element.addClass('collapse')
}
, transition: function ( method, startEvent, completeEvent ) {
var that = this
, complete = function () {
if (startEvent == 'show') that.reset()
that.$element.trigger(completeEvent)
}
this.$element
.trigger(startEvent)
[method]('in')
$.support.transition && this.$element.hasClass('collapse') ?
this.$element.one($.support.transition.end, complete) :
complete()
}
, toggle: function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
}
}
/* COLLAPSIBLE PLUGIN DEFINITION
* ============================== */
$.fn.collapse = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('collapse')
, options = typeof option == 'object' && option
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.collapse.defaults = {
toggle: true
}
$.fn.collapse.Collapse = Collapse
/* COLLAPSIBLE DATA-API
* ==================== */
$(function () {
$('body').delegate('[data-toggle=collapse]', 'click.collapse.data-api', function ( e ) {
var $this = $(this)
, target = $this.attr('data-target')
, option = $(target).data('collapse') ? 'toggle' : $this.data()
e.preventDefault()
$(target).collapse(option)
})
})
})( window.jQuery || window.ender )
\ No newline at end of file
......@@ -631,14 +631,6 @@ input[type=submit].btn {
}
// PATTERN ANIMATIONS
// ------------------
......@@ -650,6 +642,21 @@ input[type=submit].btn {
}
}
.collapse {
position:relative;
overflow:hidden;
&.height {
.transition(height .35s ease);
height: 0;
&.in { height: auto; }
}
&.width {
.transition(width .35s ease);
width: 0;
&.in { width: auto; }
}
}
// LABELS
// ------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment