Skip to content

Commit

Permalink
Merge pull request #4 from zurb/master
Browse files Browse the repository at this point in the history
Update Foundation
  • Loading branch information
winghouchan committed Apr 18, 2014
2 parents 2a5a361 + 2344a82 commit 1c612e9
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 23 deletions.
18 changes: 10 additions & 8 deletions doc/includes/accordion/examples_accordion_grid.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dl class="accordion" data-accordion>
<ul class="small-block-grid-1 medium-block-grid-3">
<li>
<ul class="small-block-grid-1 medium-block-grid-3">
<li>
<dl class="accordion" data-accordion="myAccordionGroup">
<dd>
<a href="#panel1c">Accordion 1</a>
<div id="panel1c" class="content">
Expand All @@ -19,8 +19,10 @@
Panel 3. Lorem ipsum dolor
</div>
</dd>
</li>
<li>
</dl>
</li>
<li>
<dl class="accordion" data-accordion="myAccordionGroup">
<dd>
<a href="#panel4c">Accordion 4</a>
<div id="panel4c" class="content">
Expand All @@ -39,6 +41,6 @@
Panel 6. Lorem ipsum dolor
</div>
</dd>
</li>
</ul>
</dl>
</dl>
</li>
</ul>
21 changes: 21 additions & 0 deletions doc/pages/components/accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,27 @@ <h4>Rendered HTML</h4>

***

<h3>Distributed accordion groups</h3>

You can name the accordion so that it can be spread across different parent containers. In this example the accordion is named *myAccordionGroup* and it is split between different columns in a block grid. This allows the accordion to be responsive to screen width.

<div class="row">
<div class="large-6 columns">
<h4>HTML</h4>
{{#markdown}}
```html
{{> examples_accordion_grid}}
```
{{/markdown}}
</div>
<div class="large-6 columns">
<h4>Rendered HTML</h4>
{{> examples_accordion_grid}}
</div>
</div>

***

## Customize With Sass

Accordions can be easily customized with the Sass variables provided in the `_settings.scss` file.
Expand Down
4 changes: 2 additions & 2 deletions doc/pages/components/equalizer.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ <h4>Rendered HTML</h4>
```js
$(document).foundation({
equalizer:
// specify if Equalizer should make elements equal height on the small media query range
equalize_on_small: false
// specify if Equalizer should make elements equal height once they become stacked
equalize_on_stack: false
});
```
{{/markdown}}
Expand Down
8 changes: 6 additions & 2 deletions js/foundation/foundation.accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@
var S = this.S;
S(this.scope)
.off('.fndtn.accordion')
.on('click.fndtn.accordion', '[' + this.attr_name() + '] dd > a', function (e) {
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a', function (e) {
var accordion = S(this).closest('[' + self.attr_name() + ']'),
target = S('#' + this.href.split('#')[1]),
siblings = S('dd > .content', accordion),
aunts = $('dd', accordion),
groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
settings = accordion.data(self.attr_name(true) + '-init'),
active_content = S('dd > .content.' + settings.active_class, accordion);
e.preventDefault();

if (! S(this).closest('dl').is(accordion)) { return; }
if (accordion.attr(self.attr_name())) {
siblings = siblings.add('[' + groupSelector + '] dd > .content');
aunts = aunts.add('[' + groupSelector + '] dd');
}

if (settings.toggleable && target.is(active_content)) {
target.parent('dd').toggleClass(settings.active_class, false);
Expand Down
4 changes: 2 additions & 2 deletions js/foundation/foundation.equalizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use_tallest: true,
before_height_change: $.noop,
after_height_change: $.noop,
equalize_on_small: false
equalize_on_stack: false
},

init : function (scope, method, options) {
Expand Down Expand Up @@ -42,7 +42,7 @@
}
});

if (settings.equalize_on_small === false) {
if (settings.equalize_on_stack === false) {
if (isStacked) return;
};

Expand Down
2 changes: 1 addition & 1 deletion scss/foundation/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ $select-hover-bg-color: scale-color($select-bg-color, $lightness: -3%) !default;

// Alignment options
@if $alignment == right {
float: none;
float: none !important;
text-align: right;
}
@else if $alignment == inline {
Expand Down
18 changes: 10 additions & 8 deletions spec/accordion/grid.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dl class="accordion" data-accordion>
<ul class="small-block-grid-1 medium-block-grid-3">
<li>
<ul class="small-block-grid-1 medium-block-grid-3">
<li>
<dl class="accordion" data-accordion="myAccordionGroup">
<dd>
<a href="#panel1c">Accordion 1</a>
<div id="panel1c" class="content">
Expand All @@ -19,8 +19,10 @@
Panel 3. Lorem ipsum dolor
</div>
</dd>
</li>
<li>
</dl>
</li>
<li>
<dl class="accordion" data-accordion="myAccordionGroup">
<dd>
<a href="#panel4c">Accordion 4</a>
<div id="panel4c" class="content">
Expand All @@ -39,6 +41,6 @@
Panel 6. Lorem ipsum dolor
</div>
</dd>
</li>
</ul>
</dl>
</dl>
</li>
</ul>

0 comments on commit 1c612e9

Please sign in to comment.