zurb-foundation 4.0.9 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. data/Gemfile.lock +1 -1
  2. data/README.md +10 -3
  3. data/docs/Gemfile +4 -1
  4. data/docs/Gemfile.lock +1 -1
  5. data/docs/_sidebar-components.html.erb +1 -0
  6. data/docs/_sidebar.html.erb +2 -0
  7. data/docs/components/dropdown.html.erb +3 -3
  8. data/docs/components/global.html.erb +1 -1
  9. data/docs/components/grid.html.erb +4 -4
  10. data/docs/components/joyride.html.erb +4 -1
  11. data/docs/components/kitchen-sink.html.erb +864 -0
  12. data/docs/components/orbit.html.erb +1 -1
  13. data/docs/components/section.html.erb +29 -2
  14. data/docs/components/split-buttons.html.erb +1 -1
  15. data/docs/components/top-bar.html.erb +0 -3
  16. data/docs/css/docs.scss +8 -6
  17. data/docs/layout.html.erb +13 -2
  18. data/docs/rtl.html.erb +53 -0
  19. data/docs/support.html.erb +1 -1
  20. data/js/foundation/foundation.clearing.js +20 -14
  21. data/js/foundation/foundation.dropdown.js +10 -11
  22. data/js/foundation/foundation.forms.js +45 -13
  23. data/js/foundation/foundation.joyride.js +14 -6
  24. data/js/foundation/foundation.js +7 -1
  25. data/js/foundation/foundation.orbit.js +10 -8
  26. data/js/foundation/foundation.reveal.js +1 -1
  27. data/js/foundation/foundation.section.js +23 -7
  28. data/js/foundation/foundation.tooltips.js +7 -3
  29. data/js/foundation/foundation.topbar.js +28 -12
  30. data/lib/foundation/generators/install_generator.rb +1 -1
  31. data/lib/foundation/version.rb +1 -1
  32. data/package.json +7 -1
  33. data/scss/foundation/_foundation-global.scss +3 -3
  34. data/scss/foundation/components/_alert-boxes.scss +4 -4
  35. data/scss/foundation/components/_button-groups.scss +6 -4
  36. data/scss/foundation/components/_buttons.scss +4 -4
  37. data/scss/foundation/components/_clearing.scss +18 -16
  38. data/scss/foundation/components/_custom-forms.scss +8 -8
  39. data/scss/foundation/components/_dropdown-buttons.scss +12 -12
  40. data/scss/foundation/components/_dropdown.scss +5 -6
  41. data/scss/foundation/components/_forms.scss +15 -15
  42. data/scss/foundation/components/_grid.scss +18 -18
  43. data/scss/foundation/components/_inline-lists.scss +8 -3
  44. data/scss/foundation/components/_joyride.scss +8 -8
  45. data/scss/foundation/components/_magellan.scss +3 -2
  46. data/scss/foundation/components/_orbit.scss +24 -16
  47. data/scss/foundation/components/_pricing-tables.scss +1 -1
  48. data/scss/foundation/components/_reveal.scss +2 -2
  49. data/scss/foundation/components/_section.scss +5 -5
  50. data/scss/foundation/components/_split-buttons.scss +18 -18
  51. data/scss/foundation/components/_sub-nav.scss +1 -1
  52. data/scss/foundation/components/_switch.scss +11 -12
  53. data/scss/foundation/components/_tables.scss +1 -1
  54. data/scss/foundation/components/_tooltips.scss +2 -1
  55. data/scss/foundation/components/_top-bar.scss +10 -9
  56. data/templates/project/index.html +2 -2
  57. data/templates/project/scss/_settings.scss +8 -0
  58. metadata +6 -4
@@ -87,7 +87,7 @@
87
87
  if (self.is_phone()) {
88
88
  self.pos_phone();
89
89
  } else {
90
- self.pos_default();
90
+ self.pos_default(false, true);
91
91
  }
92
92
  }
93
93
  }, 100));
@@ -374,7 +374,7 @@
374
374
  this.show('init');
375
375
  },
376
376
 
377
- pos_default : function (init) {
377
+ pos_default : function (init, resizing) {
378
378
  var half_fold = Math.ceil($(window).height() / 2),
379
379
  tip_position = this.settings.$next_tip.offset(),
380
380
  $nub = this.settings.$next_tip.find('.joyride-nub'),
@@ -387,20 +387,28 @@
387
387
  this.settings.$next_tip.show();
388
388
  }
389
389
 
390
+ if (typeof resizing === 'undefined') resizing = false;
390
391
  if (!/body/i.test(this.settings.$target.selector)) {
391
392
 
392
393
  if (this.bottom()) {
394
+ var leftOffset = this.settings.$target.offset().left;
395
+ if (Foundation.rtl) {
396
+ leftOffset = this.settings.$target.offset().width - this.settings.$next_tip.width() + leftOffset;
397
+ }
393
398
  this.settings.$next_tip.css({
394
399
  top: (this.settings.$target.offset().top + nub_height + this.outerHeight(this.settings.$target)),
395
- left: this.settings.$target.offset().left});
400
+ left: leftOffset});
396
401
 
397
402
  this.nub_position($nub, this.settings.tipSettings.nubPosition, 'top');
398
403
 
399
404
  } else if (this.top()) {
400
-
405
+ var leftOffset = this.settings.$target.offset().left;
406
+ if (Foundation.rtl) {
407
+ leftOffset = this.settings.$target.offset().width - this.settings.$next_tip.width() + leftOffset;
408
+ }
401
409
  this.settings.$next_tip.css({
402
410
  top: (this.settings.$target.offset().top - this.outerHeight(this.settings.$next_tip) - nub_height),
403
- left: this.settings.$target.offset().left});
411
+ left: leftOffset});
404
412
 
405
413
  this.nub_position($nub, this.settings.tipSettings.nubPosition, 'bottom');
406
414
 
@@ -433,7 +441,7 @@
433
441
 
434
442
  this.settings.attempts++;
435
443
 
436
- this.pos_default(true);
444
+ this.pos_default();
437
445
 
438
446
  }
439
447
 
@@ -98,7 +98,7 @@ if (typeof jQuery === "undefined" &&
98
98
  window.Foundation = {
99
99
  name : 'Foundation',
100
100
 
101
- version : '4.0.8',
101
+ version : '4.1.0',
102
102
 
103
103
  // global Foundation cache object
104
104
  cache : {},
@@ -113,6 +113,10 @@ if (typeof jQuery === "undefined" &&
113
113
  // used for development only
114
114
  if (nc) this.nc = nc;
115
115
 
116
+
117
+ // check RTL
118
+ this.rtl = /rtl/i.test($('html').attr('dir'));
119
+
116
120
  // set foundation global scope
117
121
  this.scope = scope || this.scope;
118
122
 
@@ -177,6 +181,8 @@ if (typeof jQuery === "undefined" &&
177
181
 
178
182
  patch : function (lib) {
179
183
  this.fix_outer(lib);
184
+ lib.scope = this.scope;
185
+ lib.rtl = this.rtl;
180
186
  },
181
187
 
182
188
  inherit : function (scope, methods) {
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.orbit = {
7
7
  name: 'orbit',
8
8
 
9
- version: '4.0.0',
9
+ version: '4.1.0',
10
10
 
11
11
  settings: {
12
12
  timer_speed: 10000,
@@ -305,7 +305,8 @@
305
305
  $container = $slides_container.parent(),
306
306
  $slides = $slides_container.children(),
307
307
  $active_slide = $slides_container.find('.' + self.settings.active_slide_class),
308
- active_index = $active_slide.index();
308
+ active_index = $active_slide.index(),
309
+ margin_position = Foundation.rtl ? 'marginRight' : 'marginLeft';
309
310
 
310
311
  if ($container.hasClass(self.settings.orbit_transition_class)) {
311
312
  return false;
@@ -326,11 +327,11 @@
326
327
  active_index = (index_or_direction % $slides.length);
327
328
  }
328
329
  if (active_index === ($slides.length - 1) && index_or_direction === 'next') {
329
- $slides_container.css('marginLeft', '0%');
330
+ $slides_container.css(margin_position, '0%');
330
331
  active_index = 1;
331
332
  }
332
333
  else if (active_index === 0 && index_or_direction === 'prev') {
333
- $slides_container.css('marginLeft', '-' + ($slides.length - 1) * 100 + '%');
334
+ $slides_container.css(margin_position, '-' + ($slides.length - 1) * 100 + '%');
334
335
  active_index = $slides.length - 2;
335
336
  }
336
337
  // Start transition, make next slide active
@@ -347,14 +348,15 @@
347
348
  // Check to see if animation will occur, otherwise perform
348
349
  // callbacks manually
349
350
  $slides_container.trigger('orbit:before-slide-change');
350
- if ($slides_container.css('marginLeft') === new_margin_left) {
351
+ if ($slides_container.css(margin_position) === new_margin_left) {
351
352
  $container.removeClass(self.settings.orbit_transition_class);
352
353
  $slides_container.trigger('orbit:after-slide-change', [{slide_number: active_index, total_slides: $slides_container.children().length - 2}]);
353
354
  callback();
354
355
  } else {
355
- $slides_container.animate({
356
- 'marginLeft' : new_margin_left
357
- }, self.settings.animation_speed, 'linear', function() {
356
+ var properties = {};
357
+ properties[margin_position] = new_margin_left;
358
+
359
+ $slides_container.animate(properties, self.settings.animation_speed, 'linear', function() {
358
360
  $container.removeClass(self.settings.orbit_transition_class);
359
361
  $slides_container.trigger('orbit:after-slide-change', [{slide_number: active_index, total_slides: $slides_container.children().length - 2}]);
360
362
  callback();
@@ -132,7 +132,7 @@
132
132
  toggle_bg : function (modal) {
133
133
  if ($('.reveal-modal-bg').length === 0) {
134
134
  this.settings.bg = $('<div />', {'class': this.settings.bgClass})
135
- .insertAfter(modal);
135
+ .appendTo('body');
136
136
  }
137
137
 
138
138
  if (this.settings.bg.filter(':visible').length > 0) {
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.section = {
7
7
  name: 'section',
8
8
 
9
- version : '4.0.9',
9
+ version : '4.1.1',
10
10
 
11
11
  settings : {
12
12
  deep_linking: false,
@@ -16,9 +16,7 @@
16
16
 
17
17
  init : function (scope, method, options) {
18
18
  var self = this;
19
-
20
- this.scope = scope || this.scope;
21
- Foundation.inherit(this, 'throttle data_options');
19
+ Foundation.inherit(this, 'throttle data_options position_right offset_right');
22
20
 
23
21
  if (typeof method != 'string') {
24
22
  this.set_active_from_hash();
@@ -214,7 +212,11 @@
214
212
 
215
213
  } else {
216
214
  titles.each(function () {
217
- $(this).css('left', previous_width);
215
+ if (!self.rtl) {
216
+ $(this).css('left', previous_width);
217
+ } else {
218
+ $(this).css('right', previous_width);
219
+ }
218
220
  previous_width += self.outerWidth($(this));
219
221
  });
220
222
  }
@@ -232,8 +234,11 @@
232
234
  section.find('section, .section').each(function () {
233
235
  var title = $(this).find('.title'),
234
236
  content = $(this).find('.content');
235
-
236
- content.css({left: title.position().left - 1, top: self.outerHeight(title) - 2});
237
+ if (!self.rtl) {
238
+ content.css({left: title.position().left - 1, top: self.outerHeight(title) - 2});
239
+ } else {
240
+ content.css({right: self.position_right(title) + 1, top: self.outerHeight(title) - 2});
241
+ }
237
242
  });
238
243
 
239
244
  // temporary work around for Zepto outerheight calculation issues.
@@ -246,6 +251,17 @@
246
251
 
247
252
  },
248
253
 
254
+ position_right : function (el) {
255
+ var section = el.closest('[data-section]'),
256
+ section_width = el.closest('[data-section]').width(),
257
+ offset = section.find('.title').length;
258
+ return (section_width - el.position().left - el.width() * (el.index() + 1) - offset);
259
+ },
260
+
261
+ reflow : function () {
262
+ $('[data-section]').trigger('resize');
263
+ },
264
+
249
265
  small : function (el) {
250
266
  var settings = $.extend({}, this.settings, this.data_options(el));
251
267
  if (this.is_tabs(el)) {
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.tooltips = {
7
7
  name: 'tooltips',
8
8
 
9
- version : '4.0.2',
9
+ version : '4.1.0',
10
10
 
11
11
  settings : {
12
12
  selector : '.has-tip',
@@ -136,10 +136,14 @@
136
136
  tip.addClass('tip-override');
137
137
  objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
138
138
  } else {
139
- objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', target.offset().left, width);
139
+ var left = target.offset().left;
140
+ if (Foundation.rtl) {
141
+ left = target.offset().left + target.offset().width - this.outerWidth(tip);
142
+ }
143
+ objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', left, width);
140
144
  tip.removeClass('tip-override');
141
145
  if (classes && classes.indexOf('tip-top') > -1) {
142
- objPos(tip, (target.offset().top - this.outerHeight(tip)), 'auto', 'auto', target.offset().left, width)
146
+ objPos(tip, (target.offset().top - this.outerHeight(tip)), 'auto', 'auto', left, width)
143
147
  .removeClass('tip-override');
144
148
  } else if (classes && classes.indexOf('tip-left') > -1) {
145
149
  objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left - this.outerWidth(tip) - nubHeight), width)
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.topbar = {
7
7
  name : 'topbar',
8
8
 
9
- version : '4.0.0',
9
+ version : '4.1.0',
10
10
 
11
11
  settings : {
12
12
  index : 0,
@@ -16,9 +16,8 @@
16
16
  init : false
17
17
  },
18
18
 
19
- init : function (scope, method, options) {
19
+ init : function (method, options) {
20
20
  var self = this;
21
- this.scope = scope || this.scope;
22
21
 
23
22
  if (typeof method === 'object') {
24
23
  $.extend(true, this.settings, method);
@@ -77,8 +76,13 @@
77
76
  }
78
77
 
79
78
  if (!topbar.hasClass('expanded')) {
80
- section.css({left: '0%'});
81
- section.find('>.name').css({left: '100%'});
79
+ if (!self.rtl) {
80
+ section.css({left: '0%'});
81
+ section.find('>.name').css({left: '100%'});
82
+ } else {
83
+ section.css({right: '0%'});
84
+ section.find('>.name').css({right: '100%'});
85
+ }
82
86
  section.find('li.moved').removeClass('moved');
83
87
  topbar.data('index', 0);
84
88
  }
@@ -86,7 +90,7 @@
86
90
  if (topbar.parent().hasClass('fixed')) {
87
91
  topbar.parent().removeClass('fixed');
88
92
  $('body').css('padding-top','0');
89
- window.scrollTo(0);
93
+ window.scrollTo(0,0);
90
94
  } else if (topbar.hasClass('fixed expanded')) {
91
95
  topbar.parent().addClass('fixed');
92
96
  $('body').css('padding-top',offst);
@@ -109,8 +113,13 @@
109
113
 
110
114
  topbar.data('index', topbar.data('index') + 1);
111
115
  $selectedLi.addClass('moved');
112
- section.css({left: -(100 * topbar.data('index')) + '%'});
113
- section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
116
+ if (!self.rtl) {
117
+ section.css({left: -(100 * topbar.data('index')) + '%'});
118
+ section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
119
+ } else {
120
+ section.css({right: -(100 * topbar.data('index')) + '%'});
121
+ section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
122
+ }
114
123
 
115
124
  $this.siblings('ul')
116
125
  .height(topbar.data('height') + self.outerHeight(titlebar, true));
@@ -120,8 +129,10 @@
120
129
  });
121
130
 
122
131
  $(window).on('resize.fndtn.topbar', function () {
123
- if (!this.breakpoint()) {
124
- $('.top-bar').css('min-height', '');
132
+ if (!self.breakpoint()) {
133
+ $('.top-bar')
134
+ .css('min-height', '')
135
+ .removeClass('expanded');
125
136
  }
126
137
  }.bind(this));
127
138
 
@@ -136,8 +147,13 @@
136
147
  $previousLevelUl = $movedLi.parent();
137
148
 
138
149
  topbar.data('index', topbar.data('index') - 1);
139
- section.css({left: -(100 * topbar.data('index')) + '%'});
140
- section.find('>.name').css({'left': 100 * topbar.data('index') + '%'});
150
+ if (!self.rtl) {
151
+ section.css({left: -(100 * topbar.data('index')) + '%'});
152
+ section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
153
+ } else {
154
+ section.css({right: -(100 * topbar.data('index')) + '%'});
155
+ section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
156
+ }
141
157
 
142
158
  if (topbar.data('index') === 0) {
143
159
  topbar.css('min-height', 0);
@@ -17,7 +17,7 @@ module Foundation
17
17
  settings_file = File.join(File.dirname(__FILE__),"..","..","..","templates","project","scss","_settings.scss")
18
18
  create_file "app/assets/stylesheets/foundation_and_overrides.scss", File.read(settings_file)
19
19
  append_to_file "app/assets/stylesheets/foundation_and_overrides.scss", "\n@import 'foundation';\n"
20
- append_to_file "app/assets/stylesheets/application#{detect_css_format[0]}", "#{detect_css_format[1]} require foundation_and_overrides\n"
20
+ insert_into_file "app/assets/stylesheets/application#{detect_css_format[0]}", "#{detect_css_format[1]} require foundation_and_overrides\n", :after => "require_self\n"
21
21
  end
22
22
 
23
23
  def detect_js_format
@@ -1,3 +1,3 @@
1
1
  module Foundation
2
- VERSION = "4.0.9"
2
+ VERSION = "4.1.1"
3
3
  end
data/package.json CHANGED
@@ -5,5 +5,11 @@
5
5
  "grunt": "~0.4.0",
6
6
  "grunt-contrib-watch": "~0.1.0",
7
7
  "grunt-contrib-qunit": "~0.1.1"
8
- }
8
+ },
9
+ "licenses": [
10
+ {
11
+ "type": "MIT",
12
+ "url": "https://github.com/zurb/foundation/blob/master/LICENSE"
13
+ }
14
+ ]
9
15
  }
@@ -20,14 +20,14 @@ $body-font-style: normal !default;
20
20
  // We use these to control text direction settings
21
21
  $text-direction: ltr !default; // Controls default global text direction, 'rtl' or 'ltr'
22
22
  $default-float: left !default;
23
- $default-opposite: right !default;
23
+ $opposite-direction: right !default;
24
24
  // No need to change this conditional statement, $text-direction variable controls it all.
25
25
  @if $text-direction == ltr {
26
26
  $default-float: left;
27
- $default-opposite: right;
27
+ $opposite-direction: right;
28
28
  } @else {
29
29
  $default-float: right;
30
- $default-opposite: left;
30
+ $opposite-direction: left;
31
31
  }
32
32
 
33
33
  // We use these as default colors throughout
@@ -4,8 +4,8 @@
4
4
 
5
5
  // We use this to control alert padding.
6
6
  $alert-padding-top: emCalc(11px) !default;
7
- $alert-padding-left: $alert-padding-top !default;
8
- $alert-padding-right: $alert-padding-top + emCalc(10px) !default;
7
+ $alert-padding-default-float: $alert-padding-top !default;
8
+ $alert-padding-opposite-direction: $alert-padding-top + emCalc(10px) !default;
9
9
  $alert-padding-bottom: $alert-padding-top + emCalc(1px) !default;
10
10
 
11
11
  // We use these to control text style.
@@ -46,7 +46,7 @@ $alert-radius: $global-radius !defa
46
46
  font-weight: $alert-font-weight;
47
47
  margin-bottom: $alert-bottom-margin;
48
48
  position: relative;
49
- padding: $alert-padding-top $alert-padding-right $alert-padding-bottom $alert-padding-left;
49
+ padding: $alert-padding-top $alert-padding-opposite-direction $alert-padding-bottom $alert-padding-default-float;
50
50
  font-size: $alert-font-size;
51
51
  }
52
52
 
@@ -73,7 +73,7 @@ $alert-radius: $global-radius !defa
73
73
  line-height: 0;
74
74
  position: absolute;
75
75
  top: $alert-close-position + emCalc(2px);
76
- #{$default-opposite}: $alert-close-position;
76
+ #{$opposite-direction}: $alert-close-position;
77
77
  color: $alert-close-color;
78
78
  opacity: $alert-close-opacity;
79
79
  &:hover,
@@ -1,7 +1,9 @@
1
1
  //
2
2
  // Button Group Variables
3
3
  //
4
- $button-bar-margin-right: emCalc(10px) !default;
4
+
5
+ // Sets the margin for the right side by default, and the left margin if right-to-left direction is used
6
+ $button-bar-margin-opposite: emCalc(10px) !default;
5
7
 
6
8
  //
7
9
  // Button Group Mixins
@@ -16,7 +18,7 @@ $button-bar-margin-right: emCalc(10px) !default;
16
18
  }
17
19
  @if $float {
18
20
  float: #{$default-float};
19
- margin-#{$default-opposite}: $button-bar-margin-right;
21
+ margin-#{$opposite-direction}: $button-bar-margin-opposite;
20
22
  & div { overflow: hidden; }
21
23
  }
22
24
  }
@@ -35,11 +37,11 @@ $button-bar-margin-right: emCalc(10px) !default;
35
37
  // We use these to control left and right radius on first/last buttons in the group.
36
38
  @if $radius == true {
37
39
  &:first-child, &:first-child > a, &:first-child > button { @include side-radius($default-float, $button-radius); }
38
- &:last-child, &:last-child > a, &:last-child > button { @include side-radius($default-opposite, $button-radius); }
40
+ &:last-child, &:last-child > a, &:last-child > button { @include side-radius($opposite-direction, $button-radius); }
39
41
  }
40
42
  @else if $radius {
41
43
  &:first-child, &:first-child > a, &:first-child > button { @include side-radius($default-float, $radius); }
42
- &:last-child, &:last-child > a, &:last-child > button { @include side-radius($default-opposite, $radius); }
44
+ &:last-child, &:last-child > a, &:last-child > button { @include side-radius($opposite-direction, $radius); }
43
45
  }
44
46
 
45
47
  // We use this to make the buttons even width across their container
@@ -67,9 +67,9 @@ $button-disabled-opacity: 0.6 !default;
67
67
  // these can be turned off by setting $padding:false
68
68
  @if $padding {
69
69
  padding-top: $padding;
70
- padding-right: $padding * 2;
70
+ padding-#{$opposite-direction}: $padding * 2;
71
71
  padding-bottom: $padding + emCalc(1px);
72
- padding-left: $padding * 2;
72
+ padding-#{$default-float}: $padding * 2;
73
73
 
74
74
  // We control the font-size based on mixin input.
75
75
  @if $padding == $button-med { font-size: $button-font-med; }
@@ -82,9 +82,9 @@ $button-disabled-opacity: 0.6 !default;
82
82
  // We can set $full-width:true to remove side padding extend width.
83
83
  @if $full-width {
84
84
  padding-top: $padding;
85
- padding-right: 0px;
85
+ padding-#{$opposite-direction}: 0px;
86
86
  padding-bottom: $padding + emCalc(1px);
87
- padding-left: 0px;
87
+ padding-#{$default-float}: 0px;
88
88
  width: 100%;
89
89
  }
90
90