foundation-rails 5.5.1.0 → 5.5.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/bower.json +2 -2
  2. data/lib/foundation/rails/version.rb +1 -1
  3. data/update-gem.sh +12 -7
  4. data/vendor/assets/javascripts/foundation.js +2 -2
  5. data/vendor/assets/javascripts/foundation/foundation.abide.js +62 -40
  6. data/vendor/assets/javascripts/foundation/foundation.accordion.js +7 -7
  7. data/vendor/assets/javascripts/foundation/foundation.alert.js +3 -3
  8. data/vendor/assets/javascripts/foundation/foundation.clearing.js +46 -48
  9. data/vendor/assets/javascripts/foundation/foundation.dropdown.js +71 -62
  10. data/vendor/assets/javascripts/foundation/foundation.equalizer.js +18 -14
  11. data/vendor/assets/javascripts/foundation/foundation.interchange.js +31 -25
  12. data/vendor/assets/javascripts/foundation/foundation.joyride.js +81 -73
  13. data/vendor/assets/javascripts/foundation/foundation.js +54 -41
  14. data/vendor/assets/javascripts/foundation/foundation.magellan.js +44 -39
  15. data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +19 -19
  16. data/vendor/assets/javascripts/foundation/foundation.orbit.js +133 -129
  17. data/vendor/assets/javascripts/foundation/foundation.reveal.js +73 -51
  18. data/vendor/assets/javascripts/foundation/foundation.slider.js +63 -67
  19. data/vendor/assets/javascripts/foundation/foundation.tab.js +39 -19
  20. data/vendor/assets/javascripts/foundation/foundation.tooltip.js +30 -23
  21. data/vendor/assets/javascripts/foundation/foundation.topbar.js +66 -59
  22. data/vendor/assets/stylesheets/foundation/_functions.scss +1 -1
  23. data/vendor/assets/stylesheets/foundation/_settings.scss +99 -77
  24. data/vendor/assets/stylesheets/foundation/components/_alert-boxes.scss +2 -2
  25. data/vendor/assets/stylesheets/foundation/components/_block-grid.scss +1 -0
  26. data/vendor/assets/stylesheets/foundation/components/_breadcrumbs.scss +1 -1
  27. data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +7 -4
  28. data/vendor/assets/stylesheets/foundation/components/_buttons.scss +2 -1
  29. data/vendor/assets/stylesheets/foundation/components/_clearing.scss +11 -2
  30. data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +1 -0
  31. data/vendor/assets/stylesheets/foundation/components/_forms.scss +13 -6
  32. data/vendor/assets/stylesheets/foundation/components/_global.scss +3 -3
  33. data/vendor/assets/stylesheets/foundation/components/_icon-bar.scss +32 -2
  34. data/vendor/assets/stylesheets/foundation/components/_range-slider.scss +6 -4
  35. data/vendor/assets/stylesheets/foundation/components/_reveal.scss +15 -29
  36. data/vendor/assets/stylesheets/foundation/components/_split-buttons.scss +12 -0
  37. data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +1 -2
  38. data/vendor/assets/stylesheets/foundation/components/_tabs.scss +3 -1
  39. data/vendor/assets/stylesheets/foundation/components/_toolbar.scss +3 -1
  40. data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +10 -3
  41. data/vendor/assets/stylesheets/foundation/components/_type.scss +1 -62
  42. data/vendor/assets/stylesheets/foundation/components/_visibility.scss +78 -12
  43. metadata +2 -3
  44. data/vendor/assets/_settings.scss +0 -1445
@@ -4,17 +4,17 @@
4
4
  Foundation.libs['magellan-expedition'] = {
5
5
  name : 'magellan-expedition',
6
6
 
7
- version : '5.5.0',
7
+ version : '5.5.1',
8
8
 
9
9
  settings : {
10
- active_class: 'active',
11
- threshold: 0, // pixels from the top of the expedition for it to become fixes
12
- destination_threshold: 20, // pixels from the top of destination for it to be considered active
13
- throttle_delay: 30, // calculation throttling to increase framerate
14
- fixed_top: 0, // top distance in pixels assigend to the fixed element on scroll
15
- offset_by_height: true, // whether to offset the destination by the expedition height. Usually you want this to be true, unless your expedition is on the side.
16
- duration: 700, // animation duration time
17
- easing: 'swing' // animation easing
10
+ active_class : 'active',
11
+ threshold : 0, // pixels from the top of the expedition for it to become fixes
12
+ destination_threshold : 20, // pixels from the top of destination for it to be considered active
13
+ throttle_delay : 30, // calculation throttling to increase framerate
14
+ fixed_top : 0, // top distance in pixels assigend to the fixed element on scroll
15
+ offset_by_height : true, // whether to offset the destination by the expedition height. Usually you want this to be true, unless your expedition is on the side.
16
+ duration : 700, // animation duration time
17
+ easing : 'swing' // animation easing
18
18
  },
19
19
 
20
20
  init : function (scope, method, options) {
@@ -37,14 +37,13 @@
37
37
  var expedition = $(this).closest('[' + self.attr_name() + ']'),
38
38
  settings = expedition.data('magellan-expedition-init'),
39
39
  hash = this.hash.split('#').join(''),
40
- target = $('a[name="'+hash+'"]');
40
+ target = $('a[name="' + hash + '"]');
41
41
 
42
42
  if (target.length === 0) {
43
- target = $('#'+hash);
43
+ target = $('#' + hash);
44
44
 
45
45
  }
46
46
 
47
-
48
47
  // Account for expedition height if fixed position
49
48
  var scroll_top = target.offset().top - settings.destination_threshold + 1;
50
49
  if (settings.offset_by_height) {
@@ -52,13 +51,12 @@
52
51
  }
53
52
 
54
53
  $('html, body').stop().animate({
55
- 'scrollTop': scroll_top
54
+ 'scrollTop' : scroll_top
56
55
  }, settings.duration, settings.easing, function () {
57
- if(history.pushState) {
58
- history.pushState(null, null, '#'+hash);
59
- }
60
- else {
61
- location.hash = '#'+hash;
56
+ if (history.pushState) {
57
+ history.pushState(null, null, '#' + hash);
58
+ } else {
59
+ location.hash = '#' + hash;
62
60
  }
63
61
  });
64
62
  })
@@ -68,15 +66,15 @@
68
66
  .on('resize.fndtn.magellan', self.throttle(this.set_expedition_position.bind(this), settings.throttle_delay));
69
67
  },
70
68
 
71
- check_for_arrivals : function() {
69
+ check_for_arrivals : function () {
72
70
  var self = this;
73
71
  self.update_arrivals();
74
72
  self.update_expedition_positions();
75
73
  },
76
74
 
77
- set_expedition_position : function() {
75
+ set_expedition_position : function () {
78
76
  var self = this;
79
- $('[' + this.attr_name() + '=fixed]', self.scope).each(function(idx, el) {
77
+ $('[' + this.attr_name() + '=fixed]', self.scope).each(function (idx, el) {
80
78
  var expedition = $(this),
81
79
  settings = expedition.data('magellan-expedition-init'),
82
80
  styles = expedition.attr('styles'), // save styles
@@ -87,54 +85,55 @@
87
85
 
88
86
  //set fixed-top by attribute
89
87
  fixed_top = parseInt(expedition.data('magellan-fixed-top'));
90
- if(!isNaN(fixed_top))
91
- self.settings.fixed_top = fixed_top;
88
+ if (!isNaN(fixed_top)) {
89
+ self.settings.fixed_top = fixed_top;
90
+ }
92
91
 
93
92
  expedition.data(self.data_attr('magellan-top-offset'), top_offset);
94
93
  expedition.attr('style', styles);
95
94
  });
96
95
  },
97
96
 
98
- update_expedition_positions : function() {
97
+ update_expedition_positions : function () {
99
98
  var self = this,
100
99
  window_top_offset = $(window).scrollTop();
101
100
 
102
- $('[' + this.attr_name() + '=fixed]', self.scope).each(function() {
101
+ $('[' + this.attr_name() + '=fixed]', self.scope).each(function () {
103
102
  var expedition = $(this),
104
103
  settings = expedition.data('magellan-expedition-init'),
105
104
  styles = expedition.attr('style'), // save styles
106
105
  top_offset = expedition.data('magellan-top-offset');
107
106
 
108
107
  //scroll to the top distance
109
- if (window_top_offset+self.settings.fixed_top >= top_offset) {
108
+ if (window_top_offset + self.settings.fixed_top >= top_offset) {
110
109
  // Placeholder allows height calculations to be consistent even when
111
110
  // appearing to switch between fixed/non-fixed placement
112
111
  var placeholder = expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']');
113
112
  if (placeholder.length === 0) {
114
113
  placeholder = expedition.clone();
115
114
  placeholder.removeAttr(self.attr_name());
116
- placeholder.attr(self.add_namespace('data-magellan-expedition-clone'),'');
115
+ placeholder.attr(self.add_namespace('data-magellan-expedition-clone'), '');
117
116
  expedition.before(placeholder);
118
117
  }
119
- expedition.css({position:'fixed', top: settings.fixed_top}).addClass('fixed');
118
+ expedition.css({position :'fixed', top : settings.fixed_top}).addClass('fixed');
120
119
  } else {
121
120
  expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']').remove();
122
- expedition.attr('style',styles).css('position','').css('top','').removeClass('fixed');
121
+ expedition.attr('style', styles).css('position', '').css('top', '').removeClass('fixed');
123
122
  }
124
123
  });
125
124
  },
126
125
 
127
- update_arrivals : function() {
126
+ update_arrivals : function () {
128
127
  var self = this,
129
128
  window_top_offset = $(window).scrollTop();
130
129
 
131
- $('[' + this.attr_name() + ']', self.scope).each(function() {
130
+ $('[' + this.attr_name() + ']', self.scope).each(function () {
132
131
  var expedition = $(this),
133
132
  settings = expedition.data(self.attr_name(true) + '-init'),
134
133
  offsets = self.offsets(expedition, window_top_offset),
135
134
  arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'),
136
135
  active_item = false;
137
- offsets.each(function(idx, item) {
136
+ offsets.each(function (idx, item) {
138
137
  if (item.viewport_offset >= item.top_offset) {
139
138
  var arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']');
140
139
  arrivals.not(item.arrival).removeClass(settings.active_class);
@@ -144,16 +143,18 @@
144
143
  }
145
144
  });
146
145
 
147
- if (!active_item) arrivals.removeClass(settings.active_class);
146
+ if (!active_item) {
147
+ arrivals.removeClass(settings.active_class);
148
+ }
148
149
  });
149
150
  },
150
151
 
151
- offsets : function(expedition, window_offset) {
152
+ offsets : function (expedition, window_offset) {
152
153
  var self = this,
153
154
  settings = expedition.data(self.attr_name(true) + '-init'),
154
155
  viewport_offset = window_offset;
155
156
 
156
- return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function(idx, el) {
157
+ return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function (idx, el) {
157
158
  var name = $(this).data(self.data_attr('magellan-arrival')),
158
159
  dest = $('[' + self.add_namespace('data-magellan-destination') + '=' + name + ']');
159
160
  if (dest.length > 0) {
@@ -169,14 +170,18 @@
169
170
  viewport_offset : viewport_offset
170
171
  }
171
172
  }
172
- }).sort(function(a, b) {
173
- if (a.top_offset < b.top_offset) return -1;
174
- if (a.top_offset > b.top_offset) return 1;
173
+ }).sort(function (a, b) {
174
+ if (a.top_offset < b.top_offset) {
175
+ return -1;
176
+ }
177
+ if (a.top_offset > b.top_offset) {
178
+ return 1;
179
+ }
175
180
  return 0;
176
181
  });
177
182
  },
178
183
 
179
- data_attr: function (str) {
184
+ data_attr : function (str) {
180
185
  if (this.namespace.length > 0) {
181
186
  return this.namespace + '-' + str;
182
187
  }
@@ -4,11 +4,11 @@
4
4
  Foundation.libs.offcanvas = {
5
5
  name : 'offcanvas',
6
6
 
7
- version : '5.5.0',
7
+ version : '5.5.1',
8
8
 
9
9
  settings : {
10
- open_method: 'move',
11
- close_on_click: false
10
+ open_method : 'move',
11
+ close_on_click : false
12
12
  },
13
13
 
14
14
  init : function (scope, method, options) {
@@ -37,7 +37,7 @@
37
37
  S(this.scope).off('.offcanvas')
38
38
  .on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) {
39
39
  self.click_toggle_class(e, move_class + right_postfix);
40
- if (self.settings.open_method !== 'overlap'){
40
+ if (self.settings.open_method !== 'overlap') {
41
41
  S('.left-submenu').removeClass(move_class + right_postfix);
42
42
  }
43
43
  $('.left-off-canvas-toggle').attr('aria-expanded', 'true');
@@ -46,13 +46,13 @@
46
46
  var settings = self.get_settings(e);
47
47
  var parent = S(this).parent();
48
48
 
49
- if(settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')){
49
+ if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
50
50
  self.hide.call(self, move_class + right_postfix, self.get_wrapper(e));
51
51
  parent.parent().removeClass(move_class + right_postfix);
52
- }else if(S(this).parent().hasClass('has-submenu')){
52
+ } else if (S(this).parent().hasClass('has-submenu')) {
53
53
  e.preventDefault();
54
54
  S(this).siblings('.left-submenu').toggleClass(move_class + right_postfix);
55
- }else if(parent.hasClass('back')){
55
+ } else if (parent.hasClass('back')) {
56
56
  e.preventDefault();
57
57
  parent.parent().removeClass(move_class + right_postfix);
58
58
  }
@@ -60,7 +60,7 @@
60
60
  })
61
61
  .on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) {
62
62
  self.click_toggle_class(e, move_class + left_postfix);
63
- if (self.settings.open_method !== 'overlap'){
63
+ if (self.settings.open_method !== 'overlap') {
64
64
  S('.right-submenu').removeClass(move_class + left_postfix);
65
65
  }
66
66
  $('.right-off-canvas-toggle').attr('aria-expanded', 'true');
@@ -69,13 +69,13 @@
69
69
  var settings = self.get_settings(e);
70
70
  var parent = S(this).parent();
71
71
 
72
- if(settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')){
72
+ if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
73
73
  self.hide.call(self, move_class + left_postfix, self.get_wrapper(e));
74
74
  parent.parent().removeClass(move_class + left_postfix);
75
- }else if(S(this).parent().hasClass('has-submenu')){
75
+ } else if (S(this).parent().hasClass('has-submenu')) {
76
76
  e.preventDefault();
77
77
  S(this).siblings('.right-submenu').toggleClass(move_class + left_postfix);
78
- }else if(parent.hasClass('back')){
78
+ } else if (parent.hasClass('back')) {
79
79
  e.preventDefault();
80
80
  parent.parent().removeClass(move_class + left_postfix);
81
81
  }
@@ -84,7 +84,7 @@
84
84
  .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
85
85
  self.click_remove_class(e, move_class + left_postfix);
86
86
  S('.right-submenu').removeClass(move_class + left_postfix);
87
- if (right_postfix){
87
+ if (right_postfix) {
88
88
  self.click_remove_class(e, move_class + right_postfix);
89
89
  S('.left-submenu').removeClass(move_class + left_postfix);
90
90
  }
@@ -100,7 +100,7 @@
100
100
  });
101
101
  },
102
102
 
103
- toggle: function(class_name, $off_canvas) {
103
+ toggle : function (class_name, $off_canvas) {
104
104
  $off_canvas = $off_canvas || this.get_wrapper();
105
105
  if ($off_canvas.is('.' + class_name)) {
106
106
  this.hide(class_name, $off_canvas);
@@ -109,36 +109,36 @@
109
109
  }
110
110
  },
111
111
 
112
- show: function(class_name, $off_canvas) {
112
+ show : function (class_name, $off_canvas) {
113
113
  $off_canvas = $off_canvas || this.get_wrapper();
114
114
  $off_canvas.trigger('open').trigger('open.fndtn.offcanvas');
115
115
  $off_canvas.addClass(class_name);
116
116
  },
117
117
 
118
- hide: function(class_name, $off_canvas) {
118
+ hide : function (class_name, $off_canvas) {
119
119
  $off_canvas = $off_canvas || this.get_wrapper();
120
120
  $off_canvas.trigger('close').trigger('close.fndtn.offcanvas');
121
121
  $off_canvas.removeClass(class_name);
122
122
  },
123
123
 
124
- click_toggle_class: function(e, class_name) {
124
+ click_toggle_class : function (e, class_name) {
125
125
  e.preventDefault();
126
126
  var $off_canvas = this.get_wrapper(e);
127
127
  this.toggle(class_name, $off_canvas);
128
128
  },
129
129
 
130
- click_remove_class: function(e, class_name) {
130
+ click_remove_class : function (e, class_name) {
131
131
  e.preventDefault();
132
132
  var $off_canvas = this.get_wrapper(e);
133
133
  this.hide(class_name, $off_canvas);
134
134
  },
135
135
 
136
- get_settings: function(e) {
136
+ get_settings : function (e) {
137
137
  var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']');
138
138
  return offcanvas.data(this.attr_name(true) + '-init') || this.settings;
139
139
  },
140
140
 
141
- get_wrapper: function(e) {
141
+ get_wrapper : function (e) {
142
142
  var $off_canvas = this.S(e ? e.target : this.scope).closest('.off-canvas-wrap');
143
143
 
144
144
  if ($off_canvas.length === 0) {
@@ -1,9 +1,9 @@
1
1
  ;(function ($, window, document, undefined) {
2
2
  'use strict';
3
3
 
4
- var noop = function() {};
4
+ var noop = function () {};
5
5
 
6
- var Orbit = function(el, settings) {
6
+ var Orbit = function (el, settings) {
7
7
  // Don't reinitialize plugin
8
8
  if (el.hasClass(settings.slides_container_class)) {
9
9
  return this;
@@ -21,16 +21,15 @@
21
21
  locked = false,
22
22
  adjust_height_after = false;
23
23
 
24
-
25
- self.slides = function() {
24
+ self.slides = function () {
26
25
  return slides_container.children(settings.slide_selector);
27
26
  };
28
27
 
29
28
  self.slides().first().addClass(settings.active_slide_class);
30
29
 
31
- self.update_slide_number = function(index) {
30
+ self.update_slide_number = function (index) {
32
31
  if (settings.slide_number) {
33
- number_container.find('span:first').text(parseInt(index)+1);
32
+ number_container.find('span:first').text(parseInt(index) + 1);
34
33
  number_container.find('span:last').text(self.slides().length);
35
34
  }
36
35
  if (settings.bullets) {
@@ -39,14 +38,14 @@
39
38
  }
40
39
  };
41
40
 
42
- self.update_active_link = function(index) {
43
- var link = $('[data-orbit-link="'+self.slides().eq(index).attr('data-orbit-slide')+'"]');
41
+ self.update_active_link = function (index) {
42
+ var link = $('[data-orbit-link="' + self.slides().eq(index).attr('data-orbit-slide') + '"]');
44
43
  link.siblings().removeClass(settings.bullets_active_class);
45
44
  link.addClass(settings.bullets_active_class);
46
45
  };
47
46
 
48
- self.build_markup = function() {
49
- slides_container.wrap('<div class="'+settings.container_class+'"></div>');
47
+ self.build_markup = function () {
48
+ slides_container.wrap('<div class="' + settings.container_class + '"></div>');
50
49
  container = slides_container.parent();
51
50
  slides_container.addClass(settings.slides_container_class);
52
51
 
@@ -77,7 +76,7 @@
77
76
  bullets_container = $('<ol>').addClass(settings.bullets_container_class);
78
77
  container.append(bullets_container);
79
78
  bullets_container.wrap('<div class="orbit-bullets-container"></div>');
80
- self.slides().each(function(idx, el) {
79
+ self.slides().each(function (idx, el) {
81
80
  var bullet = $('<li>').attr('data-orbit-slide', idx).on('click', self.link_bullet);;
82
81
  bullets_container.append(bullet);
83
82
  });
@@ -85,7 +84,7 @@
85
84
 
86
85
  };
87
86
 
88
- self._goto = function(next_idx, start_timer) {
87
+ self._goto = function (next_idx, start_timer) {
89
88
  // if (locked) {return false;}
90
89
  if (next_idx === idx) {return false;}
91
90
  if (typeof timer === 'object') {timer.restart();}
@@ -95,10 +94,14 @@
95
94
  locked = true;
96
95
  if (next_idx < idx) {dir = 'prev';}
97
96
  if (next_idx >= slides.length) {
98
- if (!settings.circular) return false;
97
+ if (!settings.circular) {
98
+ return false;
99
+ }
99
100
  next_idx = 0;
100
101
  } else if (next_idx < 0) {
101
- if (!settings.circular) return false;
102
+ if (!settings.circular) {
103
+ return false;
104
+ }
102
105
  next_idx = slides.length - 1;
103
106
  }
104
107
 
@@ -113,17 +116,17 @@
113
116
  settings.before_slide_change();
114
117
  self.update_active_link(next_idx);
115
118
 
116
- var callback = function() {
117
- var unlock = function() {
119
+ var callback = function () {
120
+ var unlock = function () {
118
121
  idx = next_idx;
119
122
  locked = false;
120
123
  if (start_timer === true) {timer = self.create_timer(); timer.start();}
121
124
  self.update_slide_number(idx);
122
- slides_container.trigger('after-slide-change.fndtn.orbit',[{slide_number: idx, total_slides: slides.length}]);
125
+ slides_container.trigger('after-slide-change.fndtn.orbit', [{slide_number : idx, total_slides : slides.length}]);
123
126
  settings.after_slide_change(idx, slides.length);
124
127
  };
125
- if (slides_container.height() != next.height() && settings.variable_height) {
126
- slides_container.animate({'height': next.height()}, 250, 'linear', unlock);
128
+ if (slides_container.outerHeight() != next.outerHeight() && settings.variable_height) {
129
+ slides_container.animate({'height': next.outerHeight()}, 250, 'linear', unlock);
127
130
  } else {
128
131
  unlock();
129
132
  }
@@ -131,129 +134,132 @@
131
134
 
132
135
  if (slides.length === 1) {callback(); return false;}
133
136
 
134
- var start_animation = function() {
137
+ var start_animation = function () {
135
138
  if (dir === 'next') {animate.next(current, next, callback);}
136
139
  if (dir === 'prev') {animate.prev(current, next, callback);}
137
140
  };
138
141
 
139
- if (next.height() > slides_container.height() && settings.variable_height) {
140
- slides_container.animate({'height': next.height()}, 250, 'linear', start_animation);
142
+ if (next.outerHeight() > slides_container.outerHeight() && settings.variable_height) {
143
+ slides_container.animate({'height': next.outerHeight()}, 250, 'linear', start_animation);
141
144
  } else {
142
145
  start_animation();
143
146
  }
144
147
  };
145
148
 
146
- self.next = function(e) {
149
+ self.next = function (e) {
147
150
  e.stopImmediatePropagation();
148
151
  e.preventDefault();
149
152
  self._goto(idx + 1);
150
153
  };
151
154
 
152
- self.prev = function(e) {
155
+ self.prev = function (e) {
153
156
  e.stopImmediatePropagation();
154
157
  e.preventDefault();
155
158
  self._goto(idx - 1);
156
159
  };
157
160
 
158
- self.link_custom = function(e) {
161
+ self.link_custom = function (e) {
159
162
  e.preventDefault();
160
163
  var link = $(this).attr('data-orbit-link');
161
164
  if ((typeof link === 'string') && (link = $.trim(link)) != '') {
162
- var slide = container.find('[data-orbit-slide='+link+']');
165
+ var slide = container.find('[data-orbit-slide=' + link + ']');
163
166
  if (slide.index() != -1) {self._goto(slide.index());}
164
167
  }
165
168
  };
166
169
 
167
- self.link_bullet = function(e) {
170
+ self.link_bullet = function (e) {
168
171
  var index = $(this).attr('data-orbit-slide');
169
172
  if ((typeof index === 'string') && (index = $.trim(index)) != '') {
170
- if(isNaN(parseInt(index)))
171
- {
172
- var slide = container.find('[data-orbit-slide='+index+']');
173
+ if (isNaN(parseInt(index))) {
174
+ var slide = container.find('[data-orbit-slide=' + index + ']');
173
175
  if (slide.index() != -1) {self._goto(slide.index() + 1);}
174
- }
175
- else
176
- {
176
+ } else {
177
177
  self._goto(parseInt(index));
178
178
  }
179
179
  }
180
180
 
181
181
  }
182
182
 
183
- self.timer_callback = function() {
183
+ self.timer_callback = function () {
184
184
  self._goto(idx + 1, true);
185
185
  }
186
186
 
187
- self.compute_dimensions = function() {
187
+ self.compute_dimensions = function () {
188
188
  var current = $(self.slides().get(idx));
189
- var h = current.height();
189
+ var h = current.outerHeight();
190
190
  if (!settings.variable_height) {
191
191
  self.slides().each(function(){
192
- if ($(this).height() > h) { h = $(this).height(); }
192
+ if ($(this).outerHeight() > h) { h = $(this).outerHeight(); }
193
193
  });
194
194
  }
195
195
  slides_container.height(h);
196
196
  };
197
197
 
198
- self.create_timer = function() {
198
+ self.create_timer = function () {
199
199
  var t = new Timer(
200
- container.find('.'+settings.timer_container_class),
200
+ container.find('.' + settings.timer_container_class),
201
201
  settings,
202
202
  self.timer_callback
203
203
  );
204
204
  return t;
205
205
  };
206
206
 
207
- self.stop_timer = function() {
208
- if (typeof timer === 'object') timer.stop();
207
+ self.stop_timer = function () {
208
+ if (typeof timer === 'object') {
209
+ timer.stop();
210
+ }
209
211
  };
210
212
 
211
- self.toggle_timer = function() {
212
- var t = container.find('.'+settings.timer_container_class);
213
+ self.toggle_timer = function () {
214
+ var t = container.find('.' + settings.timer_container_class);
213
215
  if (t.hasClass(settings.timer_paused_class)) {
214
216
  if (typeof timer === 'undefined') {timer = self.create_timer();}
215
217
  timer.start();
216
- }
217
- else {
218
+ } else {
218
219
  if (typeof timer === 'object') {timer.stop();}
219
220
  }
220
221
  };
221
222
 
222
- self.init = function() {
223
+ self.init = function () {
223
224
  self.build_markup();
224
225
  if (settings.timer) {
225
226
  timer = self.create_timer();
226
227
  Foundation.utils.image_loaded(this.slides().children('img'), timer.start);
227
228
  }
228
229
  animate = new FadeAnimation(settings, slides_container);
229
- if (settings.animation === 'slide')
230
+ if (settings.animation === 'slide') {
230
231
  animate = new SlideAnimation(settings, slides_container);
232
+ }
231
233
 
232
- container.on('click', '.'+settings.next_class, self.next);
233
- container.on('click', '.'+settings.prev_class, self.prev);
234
+ container.on('click', '.' + settings.next_class, self.next);
235
+ container.on('click', '.' + settings.prev_class, self.prev);
234
236
 
235
237
  if (settings.next_on_click) {
236
- container.on('click', '.'+settings.slides_container_class+' [data-orbit-slide]', self.link_bullet);
238
+ container.on('click', '.' + settings.slides_container_class + ' [data-orbit-slide]', self.link_bullet);
237
239
  }
238
240
 
239
241
  container.on('click', self.toggle_timer);
240
242
  if (settings.swipe) {
241
- container.on('touchstart.fndtn.orbit', function(e) {
243
+ container.on('touchstart.fndtn.orbit', function (e) {
242
244
  if (!e.touches) {e = e.originalEvent;}
243
245
  var data = {
244
- start_page_x: e.touches[0].pageX,
245
- start_page_y: e.touches[0].pageY,
246
- start_time: (new Date()).getTime(),
247
- delta_x: 0,
248
- is_scrolling: undefined
246
+ start_page_x : e.touches[0].pageX,
247
+ start_page_y : e.touches[0].pageY,
248
+ start_time : (new Date()).getTime(),
249
+ delta_x : 0,
250
+ is_scrolling : undefined
249
251
  };
250
252
  container.data('swipe-transition', data);
251
253
  e.stopPropagation();
252
254
  })
253
- .on('touchmove.fndtn.orbit', function(e) {
254
- if (!e.touches) { e = e.originalEvent; }
255
+ .on('touchmove.fndtn.orbit', function (e) {
256
+ if (!e.touches) {
257
+ e = e.originalEvent;
258
+ }
255
259
  // Ignore pinch/zoom events
256
- if(e.touches.length > 1 || e.scale && e.scale !== 1) return;
260
+ if (e.touches.length > 1 || e.scale && e.scale !== 1) {
261
+ return;
262
+ }
257
263
 
258
264
  var data = container.data('swipe-transition');
259
265
  if (typeof data === 'undefined') {data = {};}
@@ -266,22 +272,22 @@
266
272
 
267
273
  if (!data.is_scrolling && !data.active) {
268
274
  e.preventDefault();
269
- var direction = (data.delta_x < 0) ? (idx+1) : (idx-1);
275
+ var direction = (data.delta_x < 0) ? (idx + 1) : (idx - 1);
270
276
  data.active = true;
271
277
  self._goto(direction);
272
278
  }
273
279
  })
274
- .on('touchend.fndtn.orbit', function(e) {
280
+ .on('touchend.fndtn.orbit', function (e) {
275
281
  container.data('swipe-transition', {});
276
282
  e.stopPropagation();
277
283
  })
278
284
  }
279
- container.on('mouseenter.fndtn.orbit', function(e) {
285
+ container.on('mouseenter.fndtn.orbit', function (e) {
280
286
  if (settings.timer && settings.pause_on_hover) {
281
287
  self.stop_timer();
282
288
  }
283
289
  })
284
- .on('mouseleave.fndtn.orbit', function(e) {
290
+ .on('mouseleave.fndtn.orbit', function (e) {
285
291
  if (settings.timer && settings.resume_on_mouseout) {
286
292
  timer.start();
287
293
  }
@@ -290,8 +296,8 @@
290
296
  $(document).on('click', '[data-orbit-link]', self.link_custom);
291
297
  $(window).on('load resize', self.compute_dimensions);
292
298
  Foundation.utils.image_loaded(this.slides().children('img'), self.compute_dimensions);
293
- Foundation.utils.image_loaded(this.slides().children('img'), function() {
294
- container.prev('.'+settings.preloader_class).css('display', 'none');
299
+ Foundation.utils.image_loaded(this.slides().children('img'), function () {
300
+ container.prev('.' + settings.preloader_class).css('display', 'none');
295
301
  self.update_slide_number(0);
296
302
  self.update_active_link(0);
297
303
  slides_container.trigger('ready.fndtn.orbit');
@@ -301,43 +307,43 @@
301
307
  self.init();
302
308
  };
303
309
 
304
- var Timer = function(el, settings, callback) {
310
+ var Timer = function (el, settings, callback) {
305
311
  var self = this,
306
312
  duration = settings.timer_speed,
307
- progress = el.find('.'+settings.timer_progress_class),
313
+ progress = el.find('.' + settings.timer_progress_class),
308
314
  start,
309
315
  timeout,
310
316
  left = -1;
311
317
 
312
- this.update_progress = function(w) {
318
+ this.update_progress = function (w) {
313
319
  var new_progress = progress.clone();
314
320
  new_progress.attr('style', '');
315
- new_progress.css('width', w+'%');
321
+ new_progress.css('width', w + '%');
316
322
  progress.replaceWith(new_progress);
317
323
  progress = new_progress;
318
324
  };
319
325
 
320
- this.restart = function() {
326
+ this.restart = function () {
321
327
  clearTimeout(timeout);
322
328
  el.addClass(settings.timer_paused_class);
323
329
  left = -1;
324
330
  self.update_progress(0);
325
331
  };
326
332
 
327
- this.start = function() {
333
+ this.start = function () {
328
334
  if (!el.hasClass(settings.timer_paused_class)) {return true;}
329
335
  left = (left === -1) ? duration : left;
330
336
  el.removeClass(settings.timer_paused_class);
331
337
  start = new Date().getTime();
332
- progress.animate({'width': '100%'}, left, 'linear');
333
- timeout = setTimeout(function() {
338
+ progress.animate({'width' : '100%'}, left, 'linear');
339
+ timeout = setTimeout(function () {
334
340
  self.restart();
335
341
  callback();
336
342
  }, left);
337
343
  el.trigger('timer-started.fndtn.orbit')
338
344
  };
339
345
 
340
- this.stop = function() {
346
+ this.stop = function () {
341
347
  if (el.hasClass(settings.timer_paused_class)) {return true;}
342
348
  clearTimeout(timeout);
343
349
  el.addClass(settings.timer_paused_class);
@@ -349,95 +355,94 @@
349
355
  };
350
356
  };
351
357
 
352
- var SlideAnimation = function(settings, container) {
358
+ var SlideAnimation = function (settings, container) {
353
359
  var duration = settings.animation_speed;
354
360
  var is_rtl = ($('html[dir=rtl]').length === 1);
355
361
  var margin = is_rtl ? 'marginRight' : 'marginLeft';
356
362
  var animMargin = {};
357
363
  animMargin[margin] = '0%';
358
364
 
359
- this.next = function(current, next, callback) {
360
- current.animate({marginLeft:'-100%'}, duration);
361
- next.animate(animMargin, duration, function() {
365
+ this.next = function (current, next, callback) {
366
+ current.animate({marginLeft : '-100%'}, duration);
367
+ next.animate(animMargin, duration, function () {
362
368
  current.css(margin, '100%');
363
369
  callback();
364
370
  });
365
371
  };
366
372
 
367
- this.prev = function(current, prev, callback) {
368
- current.animate({marginLeft:'100%'}, duration);
373
+ this.prev = function (current, prev, callback) {
374
+ current.animate({marginLeft : '100%'}, duration);
369
375
  prev.css(margin, '-100%');
370
- prev.animate(animMargin, duration, function() {
376
+ prev.animate(animMargin, duration, function () {
371
377
  current.css(margin, '100%');
372
378
  callback();
373
379
  });
374
380
  };
375
381
  };
376
382
 
377
- var FadeAnimation = function(settings, container) {
383
+ var FadeAnimation = function (settings, container) {
378
384
  var duration = settings.animation_speed;
379
385
  var is_rtl = ($('html[dir=rtl]').length === 1);
380
386
  var margin = is_rtl ? 'marginRight' : 'marginLeft';
381
387
 
382
- this.next = function(current, next, callback) {
383
- next.css({'margin':'0%', 'opacity':'0.01'});
384
- next.animate({'opacity':'1'}, duration, 'linear', function() {
388
+ this.next = function (current, next, callback) {
389
+ next.css({'margin' : '0%', 'opacity' : '0.01'});
390
+ next.animate({'opacity' :'1'}, duration, 'linear', function () {
385
391
  current.css('margin', '100%');
386
392
  callback();
387
393
  });
388
394
  };
389
395
 
390
- this.prev = function(current, prev, callback) {
391
- prev.css({'margin':'0%', 'opacity':'0.01'});
392
- prev.animate({'opacity':'1'}, duration, 'linear', function() {
396
+ this.prev = function (current, prev, callback) {
397
+ prev.css({'margin' : '0%', 'opacity' : '0.01'});
398
+ prev.animate({'opacity' : '1'}, duration, 'linear', function () {
393
399
  current.css('margin', '100%');
394
400
  callback();
395
401
  });
396
402
  };
397
403
  };
398
404
 
399
-
400
405
  Foundation.libs = Foundation.libs || {};
401
406
 
402
407
  Foundation.libs.orbit = {
403
- name: 'orbit',
404
-
405
- version: '5.5.0',
406
-
407
- settings: {
408
- animation: 'slide',
409
- timer_speed: 10000,
410
- pause_on_hover: true,
411
- resume_on_mouseout: false,
412
- next_on_click: true,
413
- animation_speed: 500,
414
- stack_on_small: false,
415
- navigation_arrows: true,
416
- slide_number: true,
417
- slide_number_text: 'of',
418
- container_class: 'orbit-container',
419
- stack_on_small_class: 'orbit-stack-on-small',
420
- next_class: 'orbit-next',
421
- prev_class: 'orbit-prev',
422
- timer_container_class: 'orbit-timer',
423
- timer_paused_class: 'paused',
424
- timer_progress_class: 'orbit-progress',
425
- slides_container_class: 'orbit-slides-container',
426
- preloader_class: 'preloader',
427
- slide_selector: '*',
428
- bullets_container_class: 'orbit-bullets',
429
- bullets_active_class: 'active',
430
- slide_number_class: 'orbit-slide-number',
431
- caption_class: 'orbit-caption',
432
- active_slide_class: 'active',
433
- orbit_transition_class: 'orbit-transitioning',
434
- bullets: true,
435
- circular: true,
436
- timer: true,
437
- variable_height: false,
438
- swipe: true,
439
- before_slide_change: noop,
440
- after_slide_change: noop
408
+ name : 'orbit',
409
+
410
+ version : '5.5.1',
411
+
412
+ settings : {
413
+ animation : 'slide',
414
+ timer_speed : 10000,
415
+ pause_on_hover : true,
416
+ resume_on_mouseout : false,
417
+ next_on_click : true,
418
+ animation_speed : 500,
419
+ stack_on_small : false,
420
+ navigation_arrows : true,
421
+ slide_number : true,
422
+ slide_number_text : 'of',
423
+ container_class : 'orbit-container',
424
+ stack_on_small_class : 'orbit-stack-on-small',
425
+ next_class : 'orbit-next',
426
+ prev_class : 'orbit-prev',
427
+ timer_container_class : 'orbit-timer',
428
+ timer_paused_class : 'paused',
429
+ timer_progress_class : 'orbit-progress',
430
+ slides_container_class : 'orbit-slides-container',
431
+ preloader_class : 'preloader',
432
+ slide_selector : '*',
433
+ bullets_container_class : 'orbit-bullets',
434
+ bullets_active_class : 'active',
435
+ slide_number_class : 'orbit-slide-number',
436
+ caption_class : 'orbit-caption',
437
+ active_slide_class : 'active',
438
+ orbit_transition_class : 'orbit-transitioning',
439
+ bullets : true,
440
+ circular : true,
441
+ timer : true,
442
+ variable_height : false,
443
+ swipe : true,
444
+ before_slide_change : noop,
445
+ after_slide_change : noop
441
446
  },
442
447
 
443
448
  init : function (scope, method, options) {
@@ -458,7 +463,7 @@
458
463
  var instance = $el.data(self.name + '-instance');
459
464
  instance.compute_dimensions();
460
465
  } else {
461
- self.S('[data-orbit]', self.scope).each(function(idx, el) {
466
+ self.S('[data-orbit]', self.scope).each(function (idx, el) {
462
467
  var $el = self.S(el);
463
468
  var opts = self.data_options($el);
464
469
  var instance = $el.data(self.name + '-instance');
@@ -468,5 +473,4 @@
468
473
  }
469
474
  };
470
475
 
471
-
472
476
  }(jQuery, window, window.document));