foundation-rails 5.0.2.0 → 5.0.3.0

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/lib/foundation/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/foundation/foundation.abide.js +27 -6
  4. data/vendor/assets/javascripts/foundation/foundation.accordion.js +1 -1
  5. data/vendor/assets/javascripts/foundation/foundation.alert.js +3 -3
  6. data/vendor/assets/javascripts/foundation/foundation.clearing.js +25 -12
  7. data/vendor/assets/javascripts/foundation/foundation.dropdown.js +25 -7
  8. data/vendor/assets/javascripts/foundation/foundation.interchange.js +6 -5
  9. data/vendor/assets/javascripts/foundation/foundation.joyride.js +19 -16
  10. data/vendor/assets/javascripts/foundation/foundation.js +12 -9
  11. data/vendor/assets/javascripts/foundation/foundation.magellan.js +13 -1
  12. data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +2 -2
  13. data/vendor/assets/javascripts/foundation/foundation.orbit.js +42 -20
  14. data/vendor/assets/javascripts/foundation/foundation.reveal.js +80 -36
  15. data/vendor/assets/javascripts/foundation/foundation.tab.js +14 -5
  16. data/vendor/assets/javascripts/foundation/foundation.tooltip.js +9 -8
  17. data/vendor/assets/javascripts/foundation/foundation.topbar.js +5 -4
  18. data/vendor/assets/javascripts/vendor/modernizr.js +1405 -3
  19. data/vendor/assets/stylesheets/foundation.scss +2 -0
  20. data/vendor/assets/stylesheets/foundation/_functions.scss +3 -0
  21. data/vendor/assets/stylesheets/foundation/_settings.scss +244 -50
  22. data/vendor/assets/stylesheets/foundation/components/_accordion.scss +15 -15
  23. data/vendor/assets/stylesheets/foundation/components/_alert-boxes.scss +4 -4
  24. data/vendor/assets/stylesheets/foundation/components/_block-grid.scss +3 -2
  25. data/vendor/assets/stylesheets/foundation/components/_breadcrumbs.scss +3 -3
  26. data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +10 -4
  27. data/vendor/assets/stylesheets/foundation/components/_buttons.scss +8 -6
  28. data/vendor/assets/stylesheets/foundation/components/_clearing.scss +1 -1
  29. data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +0 -0
  30. data/vendor/assets/stylesheets/foundation/components/_dropdown.scss +5 -5
  31. data/vendor/assets/stylesheets/foundation/components/_flex-video.scss +0 -0
  32. data/vendor/assets/stylesheets/foundation/components/_forms.scss +43 -19
  33. data/vendor/assets/stylesheets/foundation/components/_global.scss +29 -18
  34. data/vendor/assets/stylesheets/foundation/components/_grid.scss +41 -25
  35. data/vendor/assets/stylesheets/foundation/components/_inline-lists.scss +0 -0
  36. data/vendor/assets/stylesheets/foundation/components/_joyride.scss +1 -1
  37. data/vendor/assets/stylesheets/foundation/components/_keystrokes.scss +5 -5
  38. data/vendor/assets/stylesheets/foundation/components/_labels.scss +0 -0
  39. data/vendor/assets/stylesheets/foundation/components/_magellan.scss +0 -0
  40. data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +110 -98
  41. data/vendor/assets/stylesheets/foundation/components/_orbit.scss +12 -10
  42. data/vendor/assets/stylesheets/foundation/components/_pagination.scss +1 -1
  43. data/vendor/assets/stylesheets/foundation/components/_panels.scss +6 -6
  44. data/vendor/assets/stylesheets/foundation/components/_pricing-tables.scss +0 -0
  45. data/vendor/assets/stylesheets/foundation/components/_progress-bars.scss +1 -1
  46. data/vendor/assets/stylesheets/foundation/components/_reveal.scss +2 -2
  47. data/vendor/assets/stylesheets/foundation/components/_side-nav.scss +4 -4
  48. data/vendor/assets/stylesheets/foundation/components/_split-buttons.scss +0 -0
  49. data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +9 -9
  50. data/vendor/assets/stylesheets/foundation/components/_switch.scss +30 -28
  51. data/vendor/assets/stylesheets/foundation/components/_tables.scss +2 -2
  52. data/vendor/assets/stylesheets/foundation/components/_tabs.scss +75 -73
  53. data/vendor/assets/stylesheets/foundation/components/_thumbs.scss +1 -2
  54. data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +1 -1
  55. data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +61 -47
  56. data/vendor/assets/stylesheets/foundation/components/_type.scss +13 -14
  57. data/vendor/assets/stylesheets/foundation/components/_visibility.scss +23 -8
  58. data/vendor/assets/stylesheets/normalize.scss +0 -0
  59. metadata +3 -5
  60. data/vendor/_settings.scss +0 -992
  61. data/vendor/assets/stylesheets/foundation/components/_functions.scss +0 -70
@@ -4,7 +4,7 @@
4
4
  Foundation.libs.magellan = {
5
5
  name : 'magellan',
6
6
 
7
- version : '5.0.0',
7
+ version : '5.0.3',
8
8
 
9
9
  settings : {
10
10
  active_class: 'active',
@@ -13,7 +13,11 @@
13
13
 
14
14
  init : function (scope, method, options) {
15
15
  this.fixed_magellan = $("[data-magellan-expedition]");
16
+ this.magellan_placeholder = $('<div></div>').css({
17
+ height: this.fixed_magellan.outerHeight(true)
18
+ }).hide().insertAfter(this.fixed_magellan);
16
19
  this.set_threshold();
20
+ this.set_active_class(method);
17
21
  this.last_destination = $('[data-magellan-destination]').last();
18
22
  this.events();
19
23
  },
@@ -67,9 +71,11 @@
67
71
  if (fixed_position) {
68
72
  $expedition.addClass('fixed');
69
73
  $expedition.css({position:"fixed", top:0});
74
+ self.magellan_placeholder.show();
70
75
  } else {
71
76
  $expedition.removeClass('fixed');
72
77
  $expedition.css({position:"", top:""});
78
+ self.magellan_placeholder.hide();
73
79
  }
74
80
  if (fixed_position && typeof attr != 'undefined' && attr != false) {
75
81
  $expedition.css({position:"fixed", top:attr + "px"});
@@ -108,6 +114,12 @@
108
114
  }
109
115
  },
110
116
 
117
+ set_active_class : function (options) {
118
+ if (options && options.active_class && typeof options.active_class === 'string') {
119
+ this.settings.active_class = options.active_class;
120
+ }
121
+ },
122
+
111
123
  off : function () {
112
124
  $(this.scope).off('.fndtn.magellan');
113
125
  $(window).off('.fndtn.magellan');
@@ -4,7 +4,7 @@
4
4
  Foundation.libs.offcanvas = {
5
5
  name : 'offcanvas',
6
6
 
7
- version : '5.0.0',
7
+ version : '5.0.3',
8
8
 
9
9
  settings : {},
10
10
 
@@ -34,4 +34,4 @@
34
34
 
35
35
  reflow : function () {}
36
36
  };
37
- }(jQuery, this, this.document));
37
+ }(jQuery, this, this.document));
@@ -36,7 +36,7 @@
36
36
 
37
37
  self.update_active_link = function(index) {
38
38
  var link = $('a[data-orbit-link="'+slides_container.children().eq(index).attr('data-orbit-slide')+'"]');
39
- link.parents('ul').find('[data-orbit-link]').removeClass(settings.bullets_active_class);
39
+ link.siblings().removeClass(settings.bullets_active_class);
40
40
  link.addClass(settings.bullets_active_class);
41
41
  };
42
42
 
@@ -91,8 +91,13 @@
91
91
  var dir = 'next';
92
92
  locked = true;
93
93
  if (next_idx < idx) {dir = 'prev';}
94
- if (next_idx >= slides.length) {next_idx = 0;}
95
- else if (next_idx < 0) {next_idx = slides.length - 1;}
94
+ if (next_idx >= slides.length) {
95
+ if (!settings.circular) return false;
96
+ next_idx = 0;
97
+ } else if (next_idx < 0) {
98
+ if (!settings.circular) return false;
99
+ next_idx = slides.length - 1;
100
+ }
96
101
 
97
102
  var current = $(slides.get(idx));
98
103
  var next = $(slides.get(next_idx));
@@ -156,11 +161,20 @@
156
161
  }
157
162
  };
158
163
 
159
- self.link_bullet = function(e) {
164
+ self.link_bullet = function(e) {
160
165
  var index = $(this).attr('data-orbit-slide');
161
166
  if ((typeof index === 'string') && (index = $.trim(index)) != "") {
162
- self._goto(parseInt(index));
167
+ if(isNaN(parseInt(index)))
168
+ {
169
+ var slide = container.find('[data-orbit-slide='+index+']');
170
+ if (slide.index() != -1) {self._goto(slide.index() + 1);}
171
+ }
172
+ else
173
+ {
174
+ self._goto(parseInt(index));
175
+ }
163
176
  }
177
+
164
178
  }
165
179
 
166
180
  self.timer_callback = function() {
@@ -375,7 +389,7 @@
375
389
  Foundation.libs.orbit = {
376
390
  name: 'orbit',
377
391
 
378
- version: '5.0.0',
392
+ version: '5.0.3',
379
393
 
380
394
  settings: {
381
395
  animation: 'slide',
@@ -402,6 +416,7 @@
402
416
  active_slide_class: 'active',
403
417
  orbit_transition_class: 'orbit-transitioning',
404
418
  bullets: true,
419
+ circular: true,
405
420
  timer: true,
406
421
  variable_height: false,
407
422
  swipe: true,
@@ -409,24 +424,31 @@
409
424
  after_slide_change: noop
410
425
  },
411
426
 
412
- init: function (scope, method, options) {
427
+ init : function (scope, method, options) {
413
428
  var self = this;
429
+ this.bindings(method, options);
430
+ },
414
431
 
415
- if (typeof method === 'object') {
416
- $.extend(true, self.settings, method);
417
- }
432
+ events : function (instance) {
433
+ var orbit_instance = new Orbit($(instance), $(instance).data('orbit-init'));
434
+ $(instance).data(self.name + '-instance', orbit_instance);
435
+ },
418
436
 
419
- if ($(scope).is('[data-orbit]')) {
420
- var $el = $(scope);
421
- var opts = self.data_options($el);
422
- new Orbit($el, $.extend({},self.settings, opts));
423
- }
437
+ reflow : function () {
438
+ var self = this;
424
439
 
425
- $('[data-orbit]', scope).each(function(idx, el) {
426
- var $el = $(el);
427
- var opts = self.data_options($el);
428
- new Orbit($el, $.extend({},self.settings, opts));
429
- });
440
+ if ($(self.scope).is('[data-orbit]')) {
441
+ var $el = $(self.scope);
442
+ var instance = $el.data(self.name + '-instance');
443
+ instance.compute_dimensions();
444
+ } else {
445
+ $('[data-orbit]', self.scope).each(function(idx, el) {
446
+ var $el = $(el);
447
+ var opts = self.data_options($el);
448
+ var instance = $el.data(self.name + '-instance');
449
+ instance.compute_dimensions();
450
+ });
451
+ }
430
452
  }
431
453
  };
432
454
 
@@ -4,7 +4,7 @@
4
4
  Foundation.libs.reveal = {
5
5
  name : 'reveal',
6
6
 
7
- version : '5.0.0',
7
+ version : '5.0.3',
8
8
 
9
9
  locked : false,
10
10
 
@@ -36,7 +36,7 @@
36
36
 
37
37
  init : function (scope, method, options) {
38
38
  Foundation.inherit(this, 'delay');
39
-
39
+ $.extend(true, this.settings, method, options);
40
40
  this.bindings(method, options);
41
41
  },
42
42
 
@@ -65,7 +65,9 @@
65
65
  });
66
66
 
67
67
  $(this.scope)
68
- .off('.reveal')
68
+ .off('.reveal');
69
+
70
+ $(document)
69
71
  .on('click.fndtn.reveal', this.close_targets(), function (e) {
70
72
 
71
73
  e.preventDefault();
@@ -103,18 +105,35 @@
103
105
  .on('closed.fndtn.reveal', '[data-reveal]', this.close_video);
104
106
  }
105
107
 
106
- $('body').on('keyup.fndtn.reveal', function ( event ) {
108
+ return true;
109
+ },
110
+
111
+ // PATCH #3: turning on key up capture only when a reveal window is open
112
+ key_up_on : function (scope) {
113
+ var self = this;
114
+
115
+ // PATCH #1: fixing multiple keyup event trigger from single key press
116
+ $('body').off('keyup.fndtn.reveal').on('keyup.fndtn.reveal', function ( event ) {
107
117
  var open_modal = $('[data-reveal].open'),
108
118
  settings = open_modal.data('reveal-init');
109
- if ( event.which === 27 && settings.close_on_esc) { // 27 is the keycode for the Escape key
110
- open_modal.foundation('reveal', 'close');
119
+ // PATCH #2: making sure that the close event can be called only while unlocked,
120
+ // so that multiple keyup.fndtn.reveal events don't prevent clean closing of the reveal window.
121
+ if ( settings && event.which === 27 && settings.close_on_esc && !self.locked) { // 27 is the keycode for the Escape key
122
+ self.close.call(self, open_modal);
111
123
  }
112
124
  });
113
125
 
114
126
  return true;
115
127
  },
116
128
 
129
+ // PATCH #3: turning on key up capture only when a reveal window is open
130
+ key_up_off : function (scope) {
131
+ $('body').off('keyup.fndtn.reveal');
132
+ return true;
133
+ },
134
+
117
135
  open : function (target, ajax_settings) {
136
+ var self = this;
118
137
  if (target) {
119
138
  if (typeof target.selector !== 'undefined') {
120
139
  var modal = $('#' + target.data('reveal-id'));
@@ -127,6 +146,8 @@
127
146
  var modal = $(this.scope);
128
147
  }
129
148
 
149
+ var settings = modal.data('reveal-init');
150
+
130
151
  if (!modal.hasClass('open')) {
131
152
  var open_modal = $('[data-reveal].open');
132
153
 
@@ -135,18 +156,28 @@
135
156
  .data('offset', this.cache_offset(modal));
136
157
  }
137
158
 
159
+ this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open
138
160
  modal.trigger('open');
139
161
 
140
162
  if (open_modal.length < 1) {
141
- this.toggle_bg();
163
+ this.toggle_bg(modal);
164
+ }
165
+
166
+ if (typeof ajax_settings === 'string') {
167
+ ajax_settings = {
168
+ url: ajax_settings
169
+ };
142
170
  }
143
171
 
144
172
  if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
145
- this.hide(open_modal, this.settings.css.close);
146
- this.show(modal, this.settings.css.open);
173
+ if (open_modal.length > 0) {
174
+ var open_modal_settings = open_modal.data('reveal-init');
175
+ this.hide(open_modal, open_modal_settings.css.close);
176
+ }
177
+
178
+ this.show(modal, settings.css.open);
147
179
  } else {
148
- var self = this,
149
- old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
180
+ var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
150
181
 
151
182
  $.extend(ajax_settings, {
152
183
  success: function (data, textStatus, jqXHR) {
@@ -157,8 +188,11 @@
157
188
  modal.html(data);
158
189
  $(modal).foundation('section', 'reflow');
159
190
 
160
- self.hide(open_modal, self.settings.css.close);
161
- self.show(modal, self.settings.css.open);
191
+ if (open_modal.length > 0) {
192
+ var open_modal_settings = open_modal.data('reveal-init');
193
+ self.hide(open_modal, open_modal_settings.css.close);
194
+ }
195
+ self.show(modal, settings.css.open);
162
196
  }
163
197
  });
164
198
 
@@ -168,15 +202,16 @@
168
202
  },
169
203
 
170
204
  close : function (modal) {
171
-
172
205
  var modal = modal && modal.length ? modal : $(this.scope),
173
- open_modals = $('[data-reveal].open');
206
+ open_modals = $('[data-reveal].open'),
207
+ settings = modal.data('reveal-init');
174
208
 
175
209
  if (open_modals.length > 0) {
176
210
  this.locked = true;
211
+ this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open
177
212
  modal.trigger('close');
178
- this.toggle_bg();
179
- this.hide(open_modals, this.settings.css.close);
213
+ this.toggle_bg(modal);
214
+ this.hide(open_modals, settings.css.close, settings);
180
215
  }
181
216
  },
182
217
 
@@ -190,7 +225,9 @@
190
225
  return base;
191
226
  },
192
227
 
193
- toggle_bg : function () {
228
+ toggle_bg : function (modal) {
229
+ var settings = modal.data('reveal-init');
230
+
194
231
  if ($('.' + this.settings.bg_class).length === 0) {
195
232
  this.settings.bg = $('<div />', {'class': this.settings.bg_class})
196
233
  .appendTo('body');
@@ -206,17 +243,19 @@
206
243
  show : function (el, css) {
207
244
  // is modal
208
245
  if (css) {
246
+ var settings = el.data('reveal-init');
209
247
  if (el.parent('body').length === 0) {
210
- var placeholder = el.wrap('<div style="display: none;" />').parent();
248
+ var placeholder = el.wrap('<div style="display: none;" />').parent(),
249
+ rootElement = this.settings.rootElement || 'body';;
211
250
  el.on('closed.fndtn.reveal.wrapped', function() {
212
251
  el.detach().appendTo(placeholder);
213
252
  el.unwrap().unbind('closed.fndtn.reveal.wrapped');
214
253
  });
215
254
 
216
- el.detach().appendTo('body');
255
+ el.detach().appendTo(rootElement);
217
256
  }
218
257
 
219
- if (/pop/i.test(this.settings.animation)) {
258
+ if (/pop/i.test(settings.animation)) {
220
259
  css.top = $(window).scrollTop() - el.data('offset') + 'px';
221
260
  var end_css = {
222
261
  top: $(window).scrollTop() + el.data('css-top') + 'px',
@@ -226,34 +265,36 @@
226
265
  return this.delay(function () {
227
266
  return el
228
267
  .css(css)
229
- .animate(end_css, this.settings.animation_speed, 'linear', function () {
268
+ .animate(end_css, settings.animation_speed, 'linear', function () {
230
269
  this.locked = false;
231
270
  el.trigger('opened');
232
271
  }.bind(this))
233
272
  .addClass('open');
234
- }.bind(this), this.settings.animation_speed / 2);
273
+ }.bind(this), settings.animation_speed / 2);
235
274
  }
236
275
 
237
- if (/fade/i.test(this.settings.animation)) {
276
+ if (/fade/i.test(settings.animation)) {
238
277
  var end_css = {opacity: 1};
239
278
 
240
279
  return this.delay(function () {
241
280
  return el
242
281
  .css(css)
243
- .animate(end_css, this.settings.animation_speed, 'linear', function () {
282
+ .animate(end_css, settings.animation_speed, 'linear', function () {
244
283
  this.locked = false;
245
284
  el.trigger('opened');
246
285
  }.bind(this))
247
286
  .addClass('open');
248
- }.bind(this), this.settings.animation_speed / 2);
287
+ }.bind(this), settings.animation_speed / 2);
249
288
  }
250
289
 
251
290
  return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened');
252
291
  }
253
292
 
293
+ var settings = this.settings;
294
+
254
295
  // should we animate the background?
255
- if (/fade/i.test(this.settings.animation)) {
256
- return el.fadeIn(this.settings.animation_speed / 2);
296
+ if (/fade/i.test(settings.animation)) {
297
+ return el.fadeIn(settings.animation_speed / 2);
257
298
  }
258
299
 
259
300
  return el.show();
@@ -262,7 +303,8 @@
262
303
  hide : function (el, css) {
263
304
  // is modal
264
305
  if (css) {
265
- if (/pop/i.test(this.settings.animation)) {
306
+ var settings = el.data('reveal-init');
307
+ if (/pop/i.test(settings.animation)) {
266
308
  var end_css = {
267
309
  top: - $(window).scrollTop() - el.data('offset') + 'px',
268
310
  opacity: 0
@@ -270,33 +312,35 @@
270
312
 
271
313
  return this.delay(function () {
272
314
  return el
273
- .animate(end_css, this.settings.animation_speed, 'linear', function () {
315
+ .animate(end_css, settings.animation_speed, 'linear', function () {
274
316
  this.locked = false;
275
317
  el.css(css).trigger('closed');
276
318
  }.bind(this))
277
319
  .removeClass('open');
278
- }.bind(this), this.settings.animation_speed / 2);
320
+ }.bind(this), settings.animation_speed / 2);
279
321
  }
280
322
 
281
- if (/fade/i.test(this.settings.animation)) {
323
+ if (/fade/i.test(settings.animation)) {
282
324
  var end_css = {opacity: 0};
283
325
 
284
326
  return this.delay(function () {
285
327
  return el
286
- .animate(end_css, this.settings.animation_speed, 'linear', function () {
328
+ .animate(end_css, settings.animation_speed, 'linear', function () {
287
329
  this.locked = false;
288
330
  el.css(css).trigger('closed');
289
331
  }.bind(this))
290
332
  .removeClass('open');
291
- }.bind(this), this.settings.animation_speed / 2);
333
+ }.bind(this), settings.animation_speed / 2);
292
334
  }
293
335
 
294
336
  return el.hide().css(css).removeClass('open').trigger('closed');
295
337
  }
296
338
 
339
+ var settings = this.settings;
340
+
297
341
  // should we animate the background?
298
- if (/fade/i.test(this.settings.animation)) {
299
- return el.fadeOut(this.settings.animation_speed / 2);
342
+ if (/fade/i.test(settings.animation)) {
343
+ return el.fadeOut(settings.animation_speed / 2);
300
344
  }
301
345
 
302
346
  return el.hide();
@@ -5,10 +5,11 @@
5
5
  Foundation.libs.tab = {
6
6
  name : 'tab',
7
7
 
8
- version : '5.0.1',
8
+ version : '5.0.3',
9
9
 
10
10
  settings : {
11
- active_class: 'active'
11
+ active_class: 'active',
12
+ callback : function () {}
12
13
  },
13
14
 
14
15
  init : function (scope, method, options) {
@@ -20,13 +21,21 @@
20
21
  e.preventDefault();
21
22
 
22
23
  var tab = $(this).parent(),
24
+ tabs = tab.closest('[data-tab]'),
23
25
  target = $('#' + this.href.split('#')[1]),
24
26
  siblings = tab.siblings(),
25
- settings = tab.closest('[data-tab]').data('tab-init');
26
-
27
- tab.addClass(settings.active_class);
27
+ settings = tabs.data('tab-init');
28
+
29
+ // allow usage of data-tab-content attribute instead of href
30
+ if ($(this).data('tab-content')) {
31
+ target = $('#' + $(this).data('tab-content').split('#')[1]);
32
+ }
33
+
34
+ tab.addClass(settings.active_class).trigger('opened');
28
35
  siblings.removeClass(settings.active_class);
29
36
  target.siblings().removeClass(settings.active_class).end().addClass(settings.active_class);
37
+ settings.callback(tab);
38
+ tabs.trigger('toggled', [tab]);
30
39
  });
31
40
  },
32
41