va_common 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -4
  3. data/app/assets/js/va_common_main.js +16 -1
  4. data/lib/va_common/version.rb +1 -1
  5. data/lib/va_common.rb +4 -0
  6. data/va_common.gemspec +15 -0
  7. metadata +200 -177
  8. data/app/assets/js/foundation/foundation.abide.js +0 -408
  9. data/app/assets/js/foundation/foundation.accordion.js +0 -88
  10. data/app/assets/js/foundation/foundation.alert.js +0 -43
  11. data/app/assets/js/foundation/foundation.clearing.js +0 -586
  12. data/app/assets/js/foundation/foundation.dropdown.js +0 -463
  13. data/app/assets/js/foundation/foundation.equalizer.js +0 -104
  14. data/app/assets/js/foundation/foundation.interchange.js +0 -359
  15. data/app/assets/js/foundation/foundation.joyride.js +0 -932
  16. data/app/assets/js/foundation/foundation.js +0 -725
  17. data/app/assets/js/foundation/foundation.magellan.js +0 -215
  18. data/app/assets/js/foundation/foundation.offcanvas.js +0 -152
  19. data/app/assets/js/foundation/foundation.orbit.js +0 -476
  20. data/app/assets/js/foundation/foundation.reveal.js +0 -498
  21. data/app/assets/js/foundation/foundation.slider.js +0 -281
  22. data/app/assets/js/foundation/foundation.tab.js +0 -249
  23. data/app/assets/js/foundation/foundation.tooltip.js +0 -339
  24. data/app/assets/js/foundation/foundation.topbar.js +0 -458
  25. data/app/assets/js/foundation.min.js +0 -6376
  26. data/app/assets/js/vendor/html5shiv.js +0 -8
  27. data/app/assets/js/vendor/jquery-1.11.0.min.js +0 -4
  28. data/app/assets/js/vendor/jquery.js +0 -9789
  29. data/app/assets/js/vendor/jquery.smooth-scroll.js +0 -255
  30. data/app/assets/js/vendor/jquery.stellar.js +0 -651
  31. data/app/assets/js/vendor/jquery.tipsy.js +0 -258
  32. data/app/assets/js/vendor/menu.js +0 -40
  33. data/app/assets/js/vendor/modernizr.custom.js +0 -4
  34. data/app/assets/js/vendor/respond.min.js +0 -6
  35. data/app/assets/js/vendor/selectivizr-1.0.3b.js +0 -560
  36. data/app/assets/js/vendor/tota11y.min.js +0 -28
  37. data/app/assets/js/vendor/wow.min.js +0 -2
  38. data/app/assets/stylesheets/foundation/_functions.scss +0 -146
  39. data/app/assets/stylesheets/foundation/_settings.scss +0 -1467
  40. data/app/assets/stylesheets/foundation/_variables.scss +0 -1286
  41. data/app/assets/stylesheets/foundation/components/_accordion.scss +0 -157
  42. data/app/assets/stylesheets/foundation/components/_alert-boxes.scss +0 -128
  43. data/app/assets/stylesheets/foundation/components/_block-grid.scss +0 -132
  44. data/app/assets/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
  45. data/app/assets/stylesheets/foundation/components/_button-groups.scss +0 -200
  46. data/app/assets/stylesheets/foundation/components/_buttons.scss +0 -259
  47. data/app/assets/stylesheets/foundation/components/_clearing.scss +0 -256
  48. data/app/assets/stylesheets/foundation/components/_dropdown-buttons.scss +0 -131
  49. data/app/assets/stylesheets/foundation/components/_dropdown.scss +0 -262
  50. data/app/assets/stylesheets/foundation/components/_flex-video.scss +0 -51
  51. data/app/assets/stylesheets/foundation/components/_forms.scss +0 -570
  52. data/app/assets/stylesheets/foundation/components/_global.scss +0 -481
  53. data/app/assets/stylesheets/foundation/components/_grid.scss +0 -289
  54. data/app/assets/stylesheets/foundation/components/_icon-bar.scss +0 -358
  55. data/app/assets/stylesheets/foundation/components/_inline-lists.scss +0 -57
  56. data/app/assets/stylesheets/foundation/components/_joyride.scss +0 -222
  57. data/app/assets/stylesheets/foundation/components/_keystrokes.scss +0 -61
  58. data/app/assets/stylesheets/foundation/components/_labels.scss +0 -106
  59. data/app/assets/stylesheets/foundation/components/_magellan.scss +0 -34
  60. data/app/assets/stylesheets/foundation/components/_offcanvas.scss +0 -515
  61. data/app/assets/stylesheets/foundation/components/_orbit.scss +0 -368
  62. data/app/assets/stylesheets/foundation/components/_pagination.scss +0 -162
  63. data/app/assets/stylesheets/foundation/components/_panels.scss +0 -101
  64. data/app/assets/stylesheets/foundation/components/_pricing-tables.scss +0 -150
  65. data/app/assets/stylesheets/foundation/components/_progress-bars.scss +0 -79
  66. data/app/assets/stylesheets/foundation/components/_range-slider.scss +0 -169
  67. data/app/assets/stylesheets/foundation/components/_reveal.scss +0 -202
  68. data/app/assets/stylesheets/foundation/components/_side-nav.scss +0 -116
  69. data/app/assets/stylesheets/foundation/components/_split-buttons.scss +0 -199
  70. data/app/assets/stylesheets/foundation/components/_sub-nav.scss +0 -123
  71. data/app/assets/stylesheets/foundation/components/_switches.scss +0 -238
  72. data/app/assets/stylesheets/foundation/components/_tables.scss +0 -135
  73. data/app/assets/stylesheets/foundation/components/_tabs.scss +0 -123
  74. data/app/assets/stylesheets/foundation/components/_thumbs.scss +0 -66
  75. data/app/assets/stylesheets/foundation/components/_toolbar.scss +0 -70
  76. data/app/assets/stylesheets/foundation/components/_tooltips.scss +0 -142
  77. data/app/assets/stylesheets/foundation/components/_top-bar.scss +0 -691
  78. data/app/assets/stylesheets/foundation/components/_type.scss +0 -525
  79. data/app/assets/stylesheets/foundation/components/_visibility.scss +0 -408
  80. data/app/assets/stylesheets/lib/_normalize.scss +0 -427
  81. data/app/assets/stylesheets/lib/bourbon/_bourbon-deprecated-upcoming.scss +0 -411
  82. data/app/assets/stylesheets/lib/bourbon/_bourbon.scss +0 -87
  83. data/app/assets/stylesheets/lib/bourbon/addons/_border-color.scss +0 -26
  84. data/app/assets/stylesheets/lib/bourbon/addons/_border-radius.scss +0 -48
  85. data/app/assets/stylesheets/lib/bourbon/addons/_border-style.scss +0 -25
  86. data/app/assets/stylesheets/lib/bourbon/addons/_border-width.scss +0 -25
  87. data/app/assets/stylesheets/lib/bourbon/addons/_buttons.scss +0 -64
  88. data/app/assets/stylesheets/lib/bourbon/addons/_clearfix.scss +0 -25
  89. data/app/assets/stylesheets/lib/bourbon/addons/_ellipsis.scss +0 -30
  90. data/app/assets/stylesheets/lib/bourbon/addons/_font-stacks.scss +0 -31
  91. data/app/assets/stylesheets/lib/bourbon/addons/_hide-text.scss +0 -27
  92. data/app/assets/stylesheets/lib/bourbon/addons/_margin.scss +0 -26
  93. data/app/assets/stylesheets/lib/bourbon/addons/_padding.scss +0 -26
  94. data/app/assets/stylesheets/lib/bourbon/addons/_position.scss +0 -48
  95. data/app/assets/stylesheets/lib/bourbon/addons/_prefixer.scss +0 -66
  96. data/app/assets/stylesheets/lib/bourbon/addons/_retina-image.scss +0 -25
  97. data/app/assets/stylesheets/lib/bourbon/addons/_size.scss +0 -51
  98. data/app/assets/stylesheets/lib/bourbon/addons/_text-inputs.scss +0 -112
  99. data/app/assets/stylesheets/lib/bourbon/addons/_timing-functions.scss +0 -34
  100. data/app/assets/stylesheets/lib/bourbon/addons/_triangle.scss +0 -63
  101. data/app/assets/stylesheets/lib/bourbon/addons/_word-wrap.scss +0 -29
  102. data/app/assets/stylesheets/lib/bourbon/css3/_animation.scss +0 -43
  103. data/app/assets/stylesheets/lib/bourbon/css3/_appearance.scss +0 -3
  104. data/app/assets/stylesheets/lib/bourbon/css3/_backface-visibility.scss +0 -3
  105. data/app/assets/stylesheets/lib/bourbon/css3/_background-image.scss +0 -42
  106. data/app/assets/stylesheets/lib/bourbon/css3/_background.scss +0 -55
  107. data/app/assets/stylesheets/lib/bourbon/css3/_border-image.scss +0 -59
  108. data/app/assets/stylesheets/lib/bourbon/css3/_calc.scss +0 -4
  109. data/app/assets/stylesheets/lib/bourbon/css3/_columns.scss +0 -47
  110. data/app/assets/stylesheets/lib/bourbon/css3/_filter.scss +0 -4
  111. data/app/assets/stylesheets/lib/bourbon/css3/_flex-box.scss +0 -287
  112. data/app/assets/stylesheets/lib/bourbon/css3/_font-face.scss +0 -24
  113. data/app/assets/stylesheets/lib/bourbon/css3/_font-feature-settings.scss +0 -4
  114. data/app/assets/stylesheets/lib/bourbon/css3/_hidpi-media-query.scss +0 -10
  115. data/app/assets/stylesheets/lib/bourbon/css3/_hyphens.scss +0 -4
  116. data/app/assets/stylesheets/lib/bourbon/css3/_image-rendering.scss +0 -14
  117. data/app/assets/stylesheets/lib/bourbon/css3/_keyframes.scss +0 -36
  118. data/app/assets/stylesheets/lib/bourbon/css3/_linear-gradient.scss +0 -38
  119. data/app/assets/stylesheets/lib/bourbon/css3/_perspective.scss +0 -8
  120. data/app/assets/stylesheets/lib/bourbon/css3/_placeholder.scss +0 -8
  121. data/app/assets/stylesheets/lib/bourbon/css3/_radial-gradient.scss +0 -39
  122. data/app/assets/stylesheets/lib/bourbon/css3/_selection.scss +0 -42
  123. data/app/assets/stylesheets/lib/bourbon/css3/_text-decoration.scss +0 -19
  124. data/app/assets/stylesheets/lib/bourbon/css3/_transform.scss +0 -15
  125. data/app/assets/stylesheets/lib/bourbon/css3/_transition.scss +0 -71
  126. data/app/assets/stylesheets/lib/bourbon/css3/_user-select.scss +0 -3
  127. data/app/assets/stylesheets/lib/bourbon/functions/_assign-inputs.scss +0 -11
  128. data/app/assets/stylesheets/lib/bourbon/functions/_contains-falsy.scss +0 -20
  129. data/app/assets/stylesheets/lib/bourbon/functions/_contains.scss +0 -26
  130. data/app/assets/stylesheets/lib/bourbon/functions/_is-length.scss +0 -11
  131. data/app/assets/stylesheets/lib/bourbon/functions/_is-light.scss +0 -21
  132. data/app/assets/stylesheets/lib/bourbon/functions/_is-number.scss +0 -11
  133. data/app/assets/stylesheets/lib/bourbon/functions/_is-size.scss +0 -13
  134. data/app/assets/stylesheets/lib/bourbon/functions/_modular-scale.scss +0 -69
  135. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-em.scss +0 -13
  136. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-rem.scss +0 -15
  137. data/app/assets/stylesheets/lib/bourbon/functions/_shade.scss +0 -24
  138. data/app/assets/stylesheets/lib/bourbon/functions/_strip-units.scss +0 -17
  139. data/app/assets/stylesheets/lib/bourbon/functions/_tint.scss +0 -24
  140. data/app/assets/stylesheets/lib/bourbon/functions/_transition-property-name.scss +0 -22
  141. data/app/assets/stylesheets/lib/bourbon/functions/_unpack.scss +0 -27
  142. data/app/assets/stylesheets/lib/bourbon/helpers/_convert-units.scss +0 -21
  143. data/app/assets/stylesheets/lib/bourbon/helpers/_directional-values.scss +0 -96
  144. data/app/assets/stylesheets/lib/bourbon/helpers/_font-source-declaration.scss +0 -43
  145. data/app/assets/stylesheets/lib/bourbon/helpers/_gradient-positions-parser.scss +0 -13
  146. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-angle-parser.scss +0 -25
  147. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-gradient-parser.scss +0 -41
  148. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-positions-parser.scss +0 -61
  149. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-side-corner-parser.scss +0 -31
  150. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-arg-parser.scss +0 -69
  151. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-gradient-parser.scss +0 -50
  152. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-positions-parser.scss +0 -18
  153. data/app/assets/stylesheets/lib/bourbon/helpers/_render-gradients.scss +0 -26
  154. data/app/assets/stylesheets/lib/bourbon/helpers/_shape-size-stripper.scss +0 -10
  155. data/app/assets/stylesheets/lib/bourbon/helpers/_str-to-num.scss +0 -50
  156. data/app/assets/stylesheets/lib/bourbon/settings/_asset-pipeline.scss +0 -7
  157. data/app/assets/stylesheets/lib/bourbon/settings/_prefixer.scss +0 -9
  158. data/app/assets/stylesheets/lib/bourbon/settings/_px-to-em.scss +0 -1
  159. data/app/assets/stylesheets/lib/neat/_neat-helpers.scss +0 -8
  160. data/app/assets/stylesheets/lib/neat/_neat.scss +0 -23
  161. data/app/assets/stylesheets/lib/neat/functions/_new-breakpoint.scss +0 -49
  162. data/app/assets/stylesheets/lib/neat/functions/_private.scss +0 -114
  163. data/app/assets/stylesheets/lib/neat/grid/_box-sizing.scss +0 -15
  164. data/app/assets/stylesheets/lib/neat/grid/_direction-context.scss +0 -33
  165. data/app/assets/stylesheets/lib/neat/grid/_display-context.scss +0 -28
  166. data/app/assets/stylesheets/lib/neat/grid/_fill-parent.scss +0 -22
  167. data/app/assets/stylesheets/lib/neat/grid/_media.scss +0 -92
  168. data/app/assets/stylesheets/lib/neat/grid/_omega.scss +0 -87
  169. data/app/assets/stylesheets/lib/neat/grid/_outer-container.scss +0 -38
  170. data/app/assets/stylesheets/lib/neat/grid/_pad.scss +0 -25
  171. data/app/assets/stylesheets/lib/neat/grid/_private.scss +0 -35
  172. data/app/assets/stylesheets/lib/neat/grid/_row.scss +0 -52
  173. data/app/assets/stylesheets/lib/neat/grid/_shift.scss +0 -50
  174. data/app/assets/stylesheets/lib/neat/grid/_span-columns.scss +0 -94
  175. data/app/assets/stylesheets/lib/neat/grid/_to-deprecate.scss +0 -97
  176. data/app/assets/stylesheets/lib/neat/grid/_visual-grid.scss +0 -42
  177. data/app/assets/stylesheets/lib/neat/settings/_disable-warnings.scss +0 -13
  178. data/app/assets/stylesheets/lib/neat/settings/_grid.scss +0 -51
  179. data/app/assets/stylesheets/lib/neat/settings/_visual-grid.scss +0 -27
  180. data/app/assets/stylesheets/va_common_main.css.scss +0 -18
  181. /data/app/assets/js/{vendor/scroll-settings.js → scroll-settings.js} +0 -0
  182. /data/app/assets/js/{vendor/stellar-settings.js → stellar-settings.js} +0 -0
@@ -1,463 +0,0 @@
1
- ;(function ($, window, document, undefined) {
2
- 'use strict';
3
-
4
- Foundation.libs.dropdown = {
5
- name : 'dropdown',
6
-
7
- version : '5.5.2',
8
-
9
- settings : {
10
- active_class : 'open',
11
- disabled_class : 'disabled',
12
- mega_class : 'mega',
13
- align : 'bottom',
14
- is_hover : false,
15
- hover_timeout : 150,
16
- opened : function () {},
17
- closed : function () {}
18
- },
19
-
20
- init : function (scope, method, options) {
21
- Foundation.inherit(this, 'throttle');
22
-
23
- $.extend(true, this.settings, method, options);
24
- this.bindings(method, options);
25
- },
26
-
27
- events : function (scope) {
28
- var self = this,
29
- S = self.S;
30
-
31
- S(this.scope)
32
- .off('.dropdown')
33
- .on('click.fndtn.dropdown', '[' + this.attr_name() + ']', function (e) {
34
- var settings = S(this).data(self.attr_name(true) + '-init') || self.settings;
35
- if (!settings.is_hover || Modernizr.touch) {
36
- e.preventDefault();
37
- if (S(this).parent('[data-reveal-id]').length) {
38
- e.stopPropagation();
39
- }
40
- self.toggle($(this));
41
- }
42
- })
43
- .on('mouseenter.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) {
44
- var $this = S(this),
45
- dropdown,
46
- target;
47
-
48
- clearTimeout(self.timeout);
49
-
50
- if ($this.data(self.data_attr())) {
51
- dropdown = S('#' + $this.data(self.data_attr()));
52
- target = $this;
53
- } else {
54
- dropdown = $this;
55
- target = S('[' + self.attr_name() + '="' + dropdown.attr('id') + '"]');
56
- }
57
-
58
- var settings = target.data(self.attr_name(true) + '-init') || self.settings;
59
-
60
- if (S(e.currentTarget).data(self.data_attr()) && settings.is_hover) {
61
- self.closeall.call(self);
62
- }
63
-
64
- if (settings.is_hover) {
65
- self.open.apply(self, [dropdown, target]);
66
- }
67
- })
68
- .on('mouseleave.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) {
69
- var $this = S(this);
70
- var settings;
71
-
72
- if ($this.data(self.data_attr())) {
73
- settings = $this.data(self.data_attr(true) + '-init') || self.settings;
74
- } else {
75
- var target = S('[' + self.attr_name() + '="' + S(this).attr('id') + '"]'),
76
- settings = target.data(self.attr_name(true) + '-init') || self.settings;
77
- }
78
-
79
- self.timeout = setTimeout(function () {
80
- if ($this.data(self.data_attr())) {
81
- if (settings.is_hover) {
82
- self.close.call(self, S('#' + $this.data(self.data_attr())));
83
- }
84
- } else {
85
- if (settings.is_hover) {
86
- self.close.call(self, $this);
87
- }
88
- }
89
- }.bind(this), settings.hover_timeout);
90
- })
91
- .on('click.fndtn.dropdown', function (e) {
92
- var parent = S(e.target).closest('[' + self.attr_name() + '-content]');
93
- var links = parent.find('a');
94
-
95
- if (links.length > 0 && parent.attr('aria-autoclose') !== 'false') {
96
- self.close.call(self, S('[' + self.attr_name() + '-content]'));
97
- }
98
-
99
- if (e.target !== document && !$.contains(document.documentElement, e.target)) {
100
- return;
101
- }
102
-
103
- if (S(e.target).closest('[' + self.attr_name() + ']').length > 0) {
104
- return;
105
- }
106
-
107
- if (!(S(e.target).data('revealId')) &&
108
- (parent.length > 0 && (S(e.target).is('[' + self.attr_name() + '-content]') ||
109
- $.contains(parent.first()[0], e.target)))) {
110
- e.stopPropagation();
111
- return;
112
- }
113
-
114
- self.close.call(self, S('[' + self.attr_name() + '-content]'));
115
- })
116
- .on('opened.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () {
117
- self.settings.opened.call(this);
118
- })
119
- .on('closed.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () {
120
- self.settings.closed.call(this);
121
- });
122
-
123
- S(window)
124
- .off('.dropdown')
125
- .on('resize.fndtn.dropdown', self.throttle(function () {
126
- self.resize.call(self);
127
- }, 50));
128
-
129
- this.resize();
130
- },
131
-
132
- close : function (dropdown) {
133
- var self = this;
134
- dropdown.each(function (idx) {
135
- var original_target = $('[' + self.attr_name() + '=' + dropdown[idx].id + ']') || $('aria-controls=' + dropdown[idx].id + ']');
136
- original_target.attr('aria-expanded', 'false');
137
- if (self.S(this).hasClass(self.settings.active_class)) {
138
- self.S(this)
139
- .css(Foundation.rtl ? 'right' : 'left', '-99999px')
140
- .attr('aria-hidden', 'true')
141
- .removeClass(self.settings.active_class)
142
- .prev('[' + self.attr_name() + ']')
143
- .removeClass(self.settings.active_class)
144
- .removeData('target');
145
-
146
- self.S(this).trigger('closed.fndtn.dropdown', [dropdown]);
147
- }
148
- });
149
- dropdown.removeClass('f-open-' + this.attr_name(true));
150
- },
151
-
152
- closeall : function () {
153
- var self = this;
154
- $.each(self.S('.f-open-' + this.attr_name(true)), function () {
155
- self.close.call(self, self.S(this));
156
- });
157
- },
158
-
159
- open : function (dropdown, target) {
160
- this
161
- .css(dropdown
162
- .addClass(this.settings.active_class), target);
163
- dropdown.prev('[' + this.attr_name() + ']').addClass(this.settings.active_class);
164
- dropdown.data('target', target.get(0)).trigger('opened.fndtn.dropdown', [dropdown, target]);
165
- dropdown.attr('aria-hidden', 'false');
166
- target.attr('aria-expanded', 'true');
167
- dropdown.focus();
168
- dropdown.addClass('f-open-' + this.attr_name(true));
169
- },
170
-
171
- data_attr : function () {
172
- if (this.namespace.length > 0) {
173
- return this.namespace + '-' + this.name;
174
- }
175
-
176
- return this.name;
177
- },
178
-
179
- toggle : function (target) {
180
- if (target.hasClass(this.settings.disabled_class)) {
181
- return;
182
- }
183
- var dropdown = this.S('#' + target.data(this.data_attr()));
184
- if (dropdown.length === 0) {
185
- // No dropdown found, not continuing
186
- return;
187
- }
188
-
189
- this.close.call(this, this.S('[' + this.attr_name() + '-content]').not(dropdown));
190
-
191
- if (dropdown.hasClass(this.settings.active_class)) {
192
- this.close.call(this, dropdown);
193
- if (dropdown.data('target') !== target.get(0)) {
194
- this.open.call(this, dropdown, target);
195
- }
196
- } else {
197
- this.open.call(this, dropdown, target);
198
- }
199
- },
200
-
201
- resize : function () {
202
- var dropdown = this.S('[' + this.attr_name() + '-content].open');
203
- var target = $(dropdown.data("target"));
204
-
205
- if (dropdown.length && target.length) {
206
- this.css(dropdown, target);
207
- }
208
- },
209
-
210
- css : function (dropdown, target) {
211
- var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8),
212
- settings = target.data(this.attr_name(true) + '-init') || this.settings,
213
- parentOverflow = dropdown.parent().css('overflow-y') || dropdown.parent().css('overflow');
214
-
215
- this.clear_idx();
216
-
217
-
218
-
219
- if (this.small()) {
220
- var p = this.dirs.bottom.call(dropdown, target, settings);
221
-
222
- dropdown.attr('style', '').removeClass('drop-left drop-right drop-top').css({
223
- position : 'absolute',
224
- width : '95%',
225
- 'max-width' : 'none',
226
- top : p.top
227
- });
228
-
229
- dropdown.css(Foundation.rtl ? 'right' : 'left', left_offset);
230
- }
231
- // detect if dropdown is in an overflow container
232
- else if (parentOverflow !== 'visible') {
233
- var offset = target[0].offsetTop + target[0].offsetHeight;
234
-
235
- dropdown.attr('style', '').css({
236
- position : 'absolute',
237
- top : offset
238
- });
239
-
240
- dropdown.css(Foundation.rtl ? 'right' : 'left', left_offset);
241
- }
242
- else {
243
-
244
- this.style(dropdown, target, settings);
245
- }
246
-
247
- return dropdown;
248
- },
249
-
250
- style : function (dropdown, target, settings) {
251
- var css = $.extend({position : 'absolute'},
252
- this.dirs[settings.align].call(dropdown, target, settings));
253
-
254
- dropdown.attr('style', '').css(css);
255
- },
256
-
257
- // return CSS property object
258
- // `this` is the dropdown
259
- dirs : {
260
- // Calculate target offset
261
- _base : function (t) {
262
- var o_p = this.offsetParent(),
263
- o = o_p.offset(),
264
- p = t.offset();
265
-
266
- p.top -= o.top;
267
- p.left -= o.left;
268
-
269
- //set some flags on the p object to pass along
270
- p.missRight = false;
271
- p.missTop = false;
272
- p.missLeft = false;
273
- p.leftRightFlag = false;
274
-
275
- //lets see if the panel will be off the screen
276
- //get the actual width of the page and store it
277
- var actualBodyWidth;
278
- if (document.getElementsByClassName('row')[0]) {
279
- actualBodyWidth = document.getElementsByClassName('row')[0].clientWidth;
280
- } else {
281
- actualBodyWidth = window.innerWidth;
282
- }
283
-
284
- var actualMarginWidth = (window.innerWidth - actualBodyWidth) / 2;
285
- var actualBoundary = actualBodyWidth;
286
-
287
- if (!this.hasClass('mega')) {
288
- //miss top
289
- if (t.offset().top <= this.outerHeight()) {
290
- p.missTop = true;
291
- actualBoundary = window.innerWidth - actualMarginWidth;
292
- p.leftRightFlag = true;
293
- }
294
-
295
- //miss right
296
- if (t.offset().left + this.outerWidth() > t.offset().left + actualMarginWidth && t.offset().left - actualMarginWidth > this.outerWidth()) {
297
- p.missRight = true;
298
- p.missLeft = false;
299
- }
300
-
301
- //miss left
302
- if (t.offset().left - this.outerWidth() <= 0) {
303
- p.missLeft = true;
304
- p.missRight = false;
305
- }
306
- }
307
-
308
- return p;
309
- },
310
-
311
- top : function (t, s) {
312
- var self = Foundation.libs.dropdown,
313
- p = self.dirs._base.call(this, t);
314
-
315
- this.addClass('drop-top');
316
-
317
- if (p.missTop == true) {
318
- p.top = p.top + t.outerHeight() + this.outerHeight();
319
- this.removeClass('drop-top');
320
- }
321
-
322
- if (p.missRight == true) {
323
- p.left = p.left - this.outerWidth() + t.outerWidth();
324
- }
325
-
326
- if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
327
- self.adjust_pip(this, t, s, p);
328
- }
329
-
330
- if (Foundation.rtl) {
331
- return {left : p.left - this.outerWidth() + t.outerWidth(),
332
- top : p.top - this.outerHeight()};
333
- }
334
-
335
- return {left : p.left, top : p.top - this.outerHeight()};
336
- },
337
-
338
- bottom : function (t, s) {
339
- var self = Foundation.libs.dropdown,
340
- p = self.dirs._base.call(this, t);
341
-
342
- if (p.missRight == true) {
343
- p.left = p.left - this.outerWidth() + t.outerWidth();
344
- }
345
-
346
- if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
347
- self.adjust_pip(this, t, s, p);
348
- }
349
-
350
- if (self.rtl) {
351
- return {left : p.left - this.outerWidth() + t.outerWidth(), top : p.top + t.outerHeight()};
352
- }
353
-
354
- return {left : p.left, top : p.top + t.outerHeight()};
355
- },
356
-
357
- left : function (t, s) {
358
- var p = Foundation.libs.dropdown.dirs._base.call(this, t);
359
-
360
- this.addClass('drop-left');
361
-
362
- if (p.missLeft == true) {
363
- p.left = p.left + this.outerWidth();
364
- p.top = p.top + t.outerHeight();
365
- this.removeClass('drop-left');
366
- }
367
-
368
- return {left : p.left - this.outerWidth(), top : p.top};
369
- },
370
-
371
- right : function (t, s) {
372
- var p = Foundation.libs.dropdown.dirs._base.call(this, t);
373
-
374
- this.addClass('drop-right');
375
-
376
- if (p.missRight == true) {
377
- p.left = p.left - this.outerWidth();
378
- p.top = p.top + t.outerHeight();
379
- this.removeClass('drop-right');
380
- } else {
381
- p.triggeredRight = true;
382
- }
383
-
384
- var self = Foundation.libs.dropdown;
385
-
386
- if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
387
- self.adjust_pip(this, t, s, p);
388
- }
389
-
390
- return {left : p.left + t.outerWidth(), top : p.top};
391
- }
392
- },
393
-
394
- // Insert rule to style psuedo elements
395
- adjust_pip : function (dropdown, target, settings, position) {
396
- var sheet = Foundation.stylesheet,
397
- pip_offset_base = 8;
398
-
399
- if (dropdown.hasClass(settings.mega_class)) {
400
- pip_offset_base = position.left + (target.outerWidth() / 2) - 8;
401
- } else if (this.small()) {
402
- pip_offset_base += position.left - 8;
403
- }
404
-
405
- this.rule_idx = sheet.cssRules.length;
406
-
407
- //default
408
- var sel_before = '.f-dropdown.open:before',
409
- sel_after = '.f-dropdown.open:after',
410
- css_before = 'left: ' + pip_offset_base + 'px;',
411
- css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
412
-
413
- if (position.missRight == true) {
414
- pip_offset_base = dropdown.outerWidth() - 23;
415
- sel_before = '.f-dropdown.open:before',
416
- sel_after = '.f-dropdown.open:after',
417
- css_before = 'left: ' + pip_offset_base + 'px;',
418
- css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
419
- }
420
-
421
- //just a case where right is fired, but its not missing right
422
- if (position.triggeredRight == true) {
423
- sel_before = '.f-dropdown.open:before',
424
- sel_after = '.f-dropdown.open:after',
425
- css_before = 'left:-12px;',
426
- css_after = 'left:-14px;';
427
- }
428
-
429
- if (sheet.insertRule) {
430
- sheet.insertRule([sel_before, '{', css_before, '}'].join(' '), this.rule_idx);
431
- sheet.insertRule([sel_after, '{', css_after, '}'].join(' '), this.rule_idx + 1);
432
- } else {
433
- sheet.addRule(sel_before, css_before, this.rule_idx);
434
- sheet.addRule(sel_after, css_after, this.rule_idx + 1);
435
- }
436
- },
437
-
438
- // Remove old dropdown rule index
439
- clear_idx : function () {
440
- var sheet = Foundation.stylesheet;
441
-
442
- if (typeof this.rule_idx !== 'undefined') {
443
- sheet.deleteRule(this.rule_idx);
444
- sheet.deleteRule(this.rule_idx);
445
- delete this.rule_idx;
446
- }
447
- },
448
-
449
- small : function () {
450
- return matchMedia(Foundation.media_queries.small).matches &&
451
- !matchMedia(Foundation.media_queries.medium).matches;
452
- },
453
-
454
- off : function () {
455
- this.S(this.scope).off('.fndtn.dropdown');
456
- this.S('html, body').off('.fndtn.dropdown');
457
- this.S(window).off('.fndtn.dropdown');
458
- this.S('[data-dropdown-content]').off('.fndtn.dropdown');
459
- },
460
-
461
- reflow : function () {}
462
- };
463
- }(jQuery, window, window.document));
@@ -1,104 +0,0 @@
1
- ;(function ($, window, document, undefined) {
2
- 'use strict';
3
-
4
- Foundation.libs.equalizer = {
5
- name : 'equalizer',
6
-
7
- version : '5.5.2',
8
-
9
- settings : {
10
- use_tallest : true,
11
- before_height_change : $.noop,
12
- after_height_change : $.noop,
13
- equalize_on_stack : false,
14
- act_on_hidden_el: false
15
- },
16
-
17
- init : function (scope, method, options) {
18
- Foundation.inherit(this, 'image_loaded');
19
- this.bindings(method, options);
20
- this.reflow();
21
- },
22
-
23
- events : function () {
24
- this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function (e) {
25
- this.reflow();
26
- }.bind(this));
27
- },
28
-
29
- equalize : function (equalizer) {
30
- var isStacked = false,
31
- group = equalizer.data('equalizer'),
32
- settings = equalizer.data(this.attr_name(true)+'-init') || this.settings,
33
- vals,
34
- firstTopOffset;
35
-
36
- if (settings.act_on_hidden_el) {
37
- vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]') : equalizer.find('['+this.attr_name()+'-watch]');
38
- }
39
- else {
40
- vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]:visible') : equalizer.find('['+this.attr_name()+'-watch]:visible');
41
- }
42
-
43
- if (vals.length === 0) {
44
- return;
45
- }
46
-
47
- settings.before_height_change();
48
- equalizer.trigger('before-height-change.fndth.equalizer');
49
- vals.height('inherit');
50
-
51
- if (settings.equalize_on_stack === false) {
52
- firstTopOffset = vals.first().offset().top;
53
- vals.each(function () {
54
- if ($(this).offset().top !== firstTopOffset) {
55
- isStacked = true;
56
- return false;
57
- }
58
- });
59
- if (isStacked) {
60
- return;
61
- }
62
- }
63
-
64
- var heights = vals.map(function () { return $(this).outerHeight(false) }).get();
65
-
66
- if (settings.use_tallest) {
67
- var max = Math.max.apply(null, heights);
68
- vals.css('height', max);
69
- } else {
70
- var min = Math.min.apply(null, heights);
71
- vals.css('height', min);
72
- }
73
-
74
- settings.after_height_change();
75
- equalizer.trigger('after-height-change.fndtn.equalizer');
76
- },
77
-
78
- reflow : function () {
79
- var self = this;
80
-
81
- this.S('[' + this.attr_name() + ']', this.scope).each(function () {
82
- var $eq_target = $(this),
83
- media_query = $eq_target.data('equalizer-mq'),
84
- ignore_media_query = true;
85
-
86
- if (media_query) {
87
- media_query = 'is_' + media_query.replace(/-/g, '_');
88
- if (Foundation.utils.hasOwnProperty(media_query)) {
89
- ignore_media_query = false;
90
- }
91
- }
92
-
93
- self.image_loaded(self.S('img', this), function () {
94
- if (ignore_media_query || Foundation.utils[media_query]()) {
95
- self.equalize($eq_target)
96
- } else {
97
- var vals = $eq_target.find('[' + self.attr_name() + '-watch]:visible');
98
- vals.css('height', 'auto');
99
- }
100
- });
101
- });
102
- }
103
- };
104
- })(jQuery, window, window.document);