zurb-foundation 4.0.8 → 4.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zurb-foundation (4.0.8)
4
+ zurb-foundation (4.0.9)
5
5
  sass (>= 3.2.0)
6
6
 
7
7
  GEM
data/docs/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 4.0.9- March 19, 2013
2
+ * Added `auto` option to `Foundation.section.js.
3
+ * Fixes dropdown positioning for split buttons.
4
+
5
+ You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.0.8...v4.0.9).
6
+
1
7
  ### 4.0.8- March 15, 2013
2
8
  * Added paragraph `text-rendering` variable: `$paragraph-text-rendering`.
3
9
  * Changed blockgrid to use clearfix instead of overflow.
@@ -11,7 +11,7 @@
11
11
 
12
12
  <div class="row">
13
13
  <div class="large-3 columns">
14
- <div class="section-container vertical-nav" data-section>
14
+ <div class="section-container vertical-nav" data-section="vertical-nav">
15
15
  <section class="section">
16
16
  <p class="title"><a href="#">Section 1</a></p>
17
17
  <div class="content">
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
  </div>
41
41
  <div class="large-9 columns">
42
- <div class="section-container horizontal-nav" data-section>
42
+ <div class="section-container horizontal-nav" data-section="horizontal-nav">
43
43
  <section class="section">
44
44
  <p class="title"><a href="#">Section 1</a></p>
45
45
  <div class="content">
@@ -65,7 +65,7 @@
65
65
  </div>
66
66
  </section>
67
67
  </div>
68
- <div class="section-container tabs" data-section data-options="deep_linking: true;">
68
+ <div class="section-container auto" data-section data-options="deep_linking: true;">
69
69
  <section class="section">
70
70
  <p class="title"><a href="#panel1">Section 1</a></p>
71
71
  <div class="content" data-slug="panel1">
@@ -124,8 +124,10 @@
124
124
  <h3>Build With Predefined HTML Classes</h3>
125
125
  <p>There are two ways to build sections in Foundation 4, with our predefined HTML classes or with our structure and mixins. Building a sections using our predefined classes is super-easy, you just need to create a <code>&lt;div class="section-container" data-section&gt;</code> as a wrapper for the sections themselves. Inside of this wrapper, you'll create either a <code>&lt;section class="section"&gt;</code> or <code>&lt;div class="section"&gt;</code>. Within that you'll include some sort of <code>.title</code> (this can be headers or a paragragh) and a <code>&lt;div class="content"&gt;</code>. Here is the markup you'll need:</p>
126
126
 
127
+ <p>If you want to use ZURB's default styles for section elements you can apply the <code>auto</code>, <code>tabs</code>, <code>accordion</code>, <code>vertical-nav</code>, or <code>horizontal-nav</code> classes. By default, section elements will be an accordion on mobile and tabs on desktops and tablets. If you want to adjust this behavior and force a particular format for your section, you will need to set <code>data-section</code> equal to the format you want to force as shown in the variations below.</p>
128
+
127
129
  <%= code_example '
128
- <div class="section-container" data-section>
130
+ <div class="section-container auto" data-section>
129
131
  <section class="section">
130
132
  <p class="title"><a href="#panel1">Section 1</a></p>
131
133
  <div class="content">
@@ -139,10 +141,15 @@
139
141
  </div>
140
142
  </section>
141
143
  </div>', :html %>
144
+ <p>This example will automatically switch between tabs and accordion based on the resolution of the device.</p>
142
145
 
143
146
  <p>The class options:</p>
144
147
  <ul class="disc">
145
-
148
+ <li>auto</li>
149
+ <li>tabs</li>
150
+ <li>accordion</li>
151
+ <li>vertical-nav</li>
152
+ <li>horizontal-nav</li>
146
153
  </ul>
147
154
 
148
155
  <p>For these styles to come across, make sure you have the <strong>default Foundation CSS package</strong> or that you've selected <strong>section from a custom package</strong>. These should be linked up following our default <a href="#getting-started">HTML page structure</a>.</p>
@@ -153,7 +160,7 @@
153
160
  <h6>Accordion</h6>
154
161
  <p>Adding an <code>accordion</code> class to the section container will show an accordion on both small and large screens.</p>
155
162
  <%= code_example '
156
- <div class="section-container accordion" data-section>
163
+ <div class="section-container accordion" data-section="accordion">
157
164
  <section class="section">
158
165
  <p class="title"><a href="#">Section 1</a></p>
159
166
  <div class="content">
@@ -168,10 +175,10 @@
168
175
  </section>
169
176
  </div>', :html %>
170
177
 
171
- <h6>Tabs/Accordion</h6>
172
- <p>Adding a <code>tabs</code> class to the section container will enable tabs on large screens and show an accordion on small screens.</p>
178
+ <h6>Tabs</h6>
179
+ <p>Adding a <code>tabs</code> class to the section container will enable tabs on both small and large screens.</p>
173
180
  <%= code_example '
174
- <div class="section-container tabs" data-section>
181
+ <div class="section-container tabs" data-section="tabs">
175
182
  <section class="section">
176
183
  <p class="title"><a href="#">Section 1</a></p>
177
184
  <div class="content">
@@ -196,7 +203,7 @@
196
203
  <%= code_example '
197
204
  <div class="row">
198
205
  <div class="large-3 columns">
199
- <div class="section-container vertical-nav" data-section>
206
+ <div class="section-container vertical-nav" data-section="vertical-nav">
200
207
  <section class="section">
201
208
  <p class="title"><a href="#">Section 1</a></p>
202
209
  <div class="content">
@@ -236,7 +243,7 @@
236
243
  <p>Use the <code>side-nav</code> class on the list to apply the Foundation navigation styles</p>
237
244
 
238
245
  <%= code_example '
239
- <div class="section-container horizontal-nav" data-section>
246
+ <div class="section-container horizontal-nav" data-section="horizontal-nav">
240
247
  <section class="section">
241
248
  <p class="title"><a href="#">Section 1</a></p>
242
249
  <div class="content">
@@ -269,7 +276,7 @@
269
276
  <p>Set <code>deep-linking</code> to true to enable deep linking to sections of content. Deep linking allows visitors to visit a predefined URL with a hash that points to a particular section of the content. Deep linking also requires a matching <code>data-slug</code> on the content section that the hash should point to, without the pound (&#35;) sign.</p>
270
277
 
271
278
  <%= code_example '
272
- <div class="section-container" data-section data-options="deep_linking: true">
279
+ <div class="section-container auto" data-section data-options="deep_linking: true">
273
280
  <section class="section">
274
281
  <p class="title"><a href="#section1">Section 1</a></p>
275
282
  <div class="content" data-slug="section1">
@@ -316,7 +323,7 @@ $section-bottom-margin: emCalc(20px);
316
323
  <hr>
317
324
 
318
325
  <h3>Using the JavaScript</h3>
319
- <p>You don't need ths JS to create sections with Foundation. The only reason you'll need to include <code>foundation.section.js</code> is if you want to add the ability to close an alert. You'll also need to make sure to include <code>zepto.js</code> and <code>foundation.js</code> above the sections plugin. Above your closing <code>&lt;/body&gt;</code> tag include the following line of code and make sure you have the JS in your directory.</p>
326
+ <p>You'll need to include <code>zepto.js</code> and <code>foundation.js</code> above the sections plugin. Above your closing <code>&lt;/body&gt;</code> tag include the following line of code and make sure you have the JS in your directory.</p>
320
327
 
321
328
  <p><a href="../javascript.html" title="How to install Foundation JavaScript">Read how to install Foundation JavaScript</a></p>
322
329
 
@@ -325,7 +332,7 @@ $section-bottom-margin: emCalc(20px);
325
332
  <p>Then, you'll need to add a data-attribute to make the JS work properly on that element. That looks like:</p>
326
333
 
327
334
  <%= code_example '
328
- <div class="section-container" data-section>
335
+ <div class="section-container auto" data-section>
329
336
  <section class="section">
330
337
  <p class="title"><a href="#panel1">Section 1</a></p>
331
338
  <div class="content">
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.dropdown = {
7
7
  name : 'dropdown',
8
8
 
9
- version : '4.0.6',
9
+ version : '4.0.9',
10
10
 
11
11
  settings : {
12
12
  activeClass: 'open'
@@ -97,10 +97,18 @@
97
97
  top: position.top + this.outerHeight(target)
98
98
  });
99
99
  } else {
100
+ if ($(window).width() > this.outerWidth(dropdown) + target.offset().left) {
101
+ var left = position.left;
102
+ } else {
103
+ if (!dropdown.hasClass('right')) {
104
+ dropdown.addClass('right');
105
+ }
106
+ var left = position.left - (this.outerWidth(dropdown) - this.outerWidth(target));
107
+ }
100
108
  dropdown.attr('style', '').css({
101
109
  position : 'absolute',
102
110
  top: position.top + this.outerHeight(target),
103
- left: position.left
111
+ left: left
104
112
  });
105
113
  }
106
114
 
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.reveal = {
7
7
  name: 'reveal',
8
8
 
9
- version : '4.0.6',
9
+ version : '4.0.9',
10
10
 
11
11
  locked : false,
12
12
 
@@ -88,29 +88,35 @@
88
88
  var modal = $(this.scope);
89
89
  }
90
90
 
91
- var open_modal = $('.reveal-modal.open');
91
+ if (!modal.hasClass('open')) {
92
+ var open_modal = $('.reveal-modal.open');
92
93
 
93
- if (typeof modal.data('css-top') === 'undefined') {
94
- modal.data('css-top', parseInt(modal.css('top'), 10))
95
- .data('offset', this.cache_offset(modal));
96
- }
94
+ if (typeof modal.data('css-top') === 'undefined') {
95
+ modal.data('css-top', parseInt(modal.css('top'), 10))
96
+ .data('offset', this.cache_offset(modal));
97
+ }
97
98
 
98
- modal.trigger('open');
99
+ modal.trigger('open');
99
100
 
100
- if (open_modal.length < 1) {
101
- this.toggle_bg(modal);
101
+ if (open_modal.length < 1) {
102
+ this.toggle_bg(modal);
103
+ }
104
+ this.hide(open_modal, this.settings.css.open);
105
+ this.show(modal, this.settings.css.open);
102
106
  }
103
-
104
- this.toggle_modals(open_modal, modal);
105
107
  },
106
108
 
107
109
  close : function (modal) {
108
- var modal = modal || $(this.scope);
109
- this.locked = true;
110
- var open_modal = $('.reveal-modal.open').not(modal);
111
- modal.trigger('close');
112
- this.toggle_bg(modal);
113
- this.toggle_modals(open_modal, modal);
110
+
111
+ var modal = modal || $(this.scope),
112
+ open_modals = $('.reveal-modal.open');
113
+
114
+ if (open_modals.length > 0) {
115
+ this.locked = true;
116
+ modal.trigger('close');
117
+ this.toggle_bg(modal);
118
+ this.hide(open_modals, this.settings.css.close);
119
+ }
114
120
  },
115
121
 
116
122
  close_targets : function () {
@@ -123,20 +129,8 @@
123
129
  return base;
124
130
  },
125
131
 
126
- toggle_modals : function (open_modal, modal) {
127
- if (open_modal.length > 0) {
128
- this.hide(open_modal, this.settings.css.close);
129
- }
130
-
131
- if (modal.filter(':visible').length > 0) {
132
- this.hide(modal, this.settings.css.close);
133
- } else {
134
- this.show(modal, this.settings.css.open);
135
- }
136
- },
137
-
138
132
  toggle_bg : function (modal) {
139
- if (this.settings.bg.length === 0) {
133
+ if ($('.reveal-modal-bg').length === 0) {
140
134
  this.settings.bg = $('<div />', {'class': this.settings.bgClass})
141
135
  .insertAfter(modal);
142
136
  }
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.section = {
7
7
  name: 'section',
8
8
 
9
- version : '4.0.8',
9
+ version : '4.0.9',
10
10
 
11
11
  settings : {
12
12
  deep_linking: false,
@@ -55,7 +55,7 @@
55
55
  $(document)
56
56
  .on('click.fndtn.section', function (e) {
57
57
  if ($(e.target).closest('.title').length < 1) {
58
- $('[data-section].vertical-nav, [data-section].horizontal-nav')
58
+ $('[data-section="vertical-nav"], [data-section="horizontal-nav"]')
59
59
  .find('section, .section')
60
60
  .removeClass('active')
61
61
  .attr('style', '');
@@ -167,15 +167,19 @@
167
167
  },
168
168
 
169
169
  is_vertical : function (el) {
170
- return el.hasClass('vertical-nav');
170
+ return /vertical-nav/i.test(el.data('section'));
171
171
  },
172
172
 
173
173
  is_horizontal : function (el) {
174
- return el.hasClass('horizontal-nav');
174
+ return /horizontal-nav/i.test(el.data('section'));
175
175
  },
176
176
 
177
177
  is_accordion : function (el) {
178
- return el.hasClass('accordion');
178
+ return /accordion/i.test(el.data('section'));
179
+ },
180
+
181
+ is_tabs : function (el) {
182
+ return /tabs/i.test(el.data('section'));
179
183
  },
180
184
 
181
185
  set_active_from_hash : function () {
@@ -244,7 +248,7 @@
244
248
 
245
249
  small : function (el) {
246
250
  var settings = $.extend({}, this.settings, this.data_options(el));
247
- if (el && el.hasClass('tabs')) {
251
+ if (this.is_tabs(el)) {
248
252
  return false;
249
253
  }
250
254
  if (el && this.is_accordion(el)) {
@@ -1,3 +1,3 @@
1
1
  module Foundation
2
- VERSION = "4.0.8"
2
+ VERSION = "4.0.9"
3
3
  end
@@ -80,12 +80,21 @@ $f-dropdown-content-padding: emCalc(20px) !default;
80
80
  z-index: 99;
81
81
  }
82
82
  &:after {
83
- @include css-triangle($f-dropdown-triangle-size + 1,$f-dropdown-border-color,bottom);
83
+ @include css-triangle($f-dropdown-triangle-size + 1, $f-dropdown-border-color, bottom);
84
84
  position: absolute;
85
85
  top: -(($f-dropdown-triangle-size + 1) * 2);
86
86
  left: $f-dropdown-triangle-side-offset - 1;
87
87
  z-index: 98;
88
88
  }
89
+
90
+ &.right:before {
91
+ left: auto;
92
+ right: $f-dropdown-triangle-side-offset;
93
+ }
94
+ &.right:after {
95
+ left: auto;
96
+ right: $f-dropdown-triangle-side-offset - 1;
97
+ }
89
98
  }
90
99
 
91
100
  @if $max-width { max-width: $max-width; }
@@ -134,4 +143,4 @@ $f-dropdown-content-padding: emCalc(20px) !default;
134
143
  &.large { max-width: 800px; }
135
144
  }
136
145
 
137
- }
146
+ }
@@ -203,11 +203,13 @@ $section-bottom-margin: emCalc(20px) !default;
203
203
  @if $include-html-section-classes {
204
204
 
205
205
  /* Sections */
206
- .section-container {
206
+ .section-container, .section-container.auto {
207
207
  @include section-container;
208
208
 
209
209
  section,
210
- .section { @include section; }
210
+ .section {
211
+ @include section;
212
+ }
211
213
  }
212
214
 
213
215
  .section-container.tabs {
@@ -219,6 +221,12 @@ $section-bottom-margin: emCalc(20px) !default;
219
221
 
220
222
  @media #{$small} {
221
223
 
224
+ .section-container.auto {
225
+ @include section-container(false, tabs);
226
+
227
+ section,
228
+ .section { @include section(tabs); }
229
+ }
222
230
  .section-container.accordion .section {
223
231
  padding-top: 0 !important;
224
232
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zurb-foundation
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.8
4
+ version: 4.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-15 00:00:00.000000000 Z
12
+ date: 2013-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass
@@ -229,7 +229,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
229
229
  version: '0'
230
230
  segments:
231
231
  - 0
232
- hash: -2268811908877619416
232
+ hash: -1567269957682062365
233
233
  required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  none: false
235
235
  requirements:
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  segments:
240
240
  - 0
241
- hash: -2268811908877619416
241
+ hash: -1567269957682062365
242
242
  requirements: []
243
243
  rubyforge_project:
244
244
  rubygems_version: 1.8.23