va_common 0.1.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 (285) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +4 -0
  4. data/CODE_OF_CONDUCT.md +13 -0
  5. data/Gemfile +4 -0
  6. data/README.md +66 -0
  7. data/Rakefile +1 -0
  8. data/app/assets/fonts/merriweather-bold-webfont.eot +0 -0
  9. data/app/assets/fonts/merriweather-bold-webfont.svg +294 -0
  10. data/app/assets/fonts/merriweather-bold-webfont.ttf +0 -0
  11. data/app/assets/fonts/merriweather-bold-webfont.woff +0 -0
  12. data/app/assets/fonts/merriweather-bold-webfont.woff2 +0 -0
  13. data/app/assets/fonts/merriweather-italic-webfont.eot +0 -0
  14. data/app/assets/fonts/merriweather-italic-webfont.svg +283 -0
  15. data/app/assets/fonts/merriweather-italic-webfont.ttf +0 -0
  16. data/app/assets/fonts/merriweather-italic-webfont.woff +0 -0
  17. data/app/assets/fonts/merriweather-italic-webfont.woff2 +0 -0
  18. data/app/assets/fonts/merriweather-light-webfont.eot +0 -0
  19. data/app/assets/fonts/merriweather-light-webfont.svg +299 -0
  20. data/app/assets/fonts/merriweather-light-webfont.ttf +0 -0
  21. data/app/assets/fonts/merriweather-light-webfont.woff +0 -0
  22. data/app/assets/fonts/merriweather-light-webfont.woff2 +0 -0
  23. data/app/assets/fonts/merriweather-regular-webfont.eot +0 -0
  24. data/app/assets/fonts/merriweather-regular-webfont.svg +294 -0
  25. data/app/assets/fonts/merriweather-regular-webfont.ttf +0 -0
  26. data/app/assets/fonts/merriweather-regular-webfont.woff +0 -0
  27. data/app/assets/fonts/merriweather-regular-webfont.woff2 +0 -0
  28. data/app/assets/fonts/sourcesanspro-bold-webfont.eot +0 -0
  29. data/app/assets/fonts/sourcesanspro-bold-webfont.svg +965 -0
  30. data/app/assets/fonts/sourcesanspro-bold-webfont.ttf +0 -0
  31. data/app/assets/fonts/sourcesanspro-bold-webfont.woff +0 -0
  32. data/app/assets/fonts/sourcesanspro-bold-webfont.woff2 +0 -0
  33. data/app/assets/fonts/sourcesanspro-italic-webfont.eot +0 -0
  34. data/app/assets/fonts/sourcesanspro-italic-webfont.svg +853 -0
  35. data/app/assets/fonts/sourcesanspro-italic-webfont.ttf +0 -0
  36. data/app/assets/fonts/sourcesanspro-italic-webfont.woff +0 -0
  37. data/app/assets/fonts/sourcesanspro-italic-webfont.woff2 +0 -0
  38. data/app/assets/fonts/sourcesanspro-light-webfont.eot +0 -0
  39. data/app/assets/fonts/sourcesanspro-light-webfont.svg +915 -0
  40. data/app/assets/fonts/sourcesanspro-light-webfont.ttf +0 -0
  41. data/app/assets/fonts/sourcesanspro-light-webfont.woff +0 -0
  42. data/app/assets/fonts/sourcesanspro-light-webfont.woff2 +0 -0
  43. data/app/assets/fonts/sourcesanspro-regular-webfont.eot +0 -0
  44. data/app/assets/fonts/sourcesanspro-regular-webfont.svg +989 -0
  45. data/app/assets/fonts/sourcesanspro-regular-webfont.ttf +0 -0
  46. data/app/assets/fonts/sourcesanspro-regular-webfont.woff +0 -0
  47. data/app/assets/fonts/sourcesanspro-regular-webfont.woff2 +0 -0
  48. data/app/assets/images/design/background/thread.png +0 -0
  49. data/app/assets/images/design/logo/logo-alt-hover.png +0 -0
  50. data/app/assets/images/design/logo/logo-alt.png +0 -0
  51. data/app/assets/images/design/logo/logo-hover.png +0 -0
  52. data/app/assets/images/design/logo/logo-small.png +0 -0
  53. data/app/assets/images/design/logo/logo.png +0 -0
  54. data/app/assets/images/design/logo/og-image.jpg +0 -0
  55. data/app/assets/images/design/seal/seal-footer.png +0 -0
  56. data/app/assets/images/design/seal/seal-footer.svg +1 -0
  57. data/app/assets/images/design/seal/seal.png +0 -0
  58. data/app/assets/images/design/seal/stars.png +0 -0
  59. data/app/assets/images/icons/apple-touch-icon-114x114.png +0 -0
  60. data/app/assets/images/icons/apple-touch-icon-152x152.png +0 -0
  61. data/app/assets/images/icons/apple-touch-icon-72x72.png +0 -0
  62. data/app/assets/images/icons/apple-touch-icon.png +0 -0
  63. data/app/assets/images/icons/favicon.ico +0 -0
  64. data/app/assets/images/icons/va.png +0 -0
  65. data/app/assets/images/icons/watermark.png +0 -0
  66. data/app/assets/images/icons/wrench.png +0 -0
  67. data/app/assets/images/social-icons/png/facebook25.png +0 -0
  68. data/app/assets/images/social-icons/png/rss25.png +0 -0
  69. data/app/assets/images/social-icons/png/twitter16.png +0 -0
  70. data/app/assets/images/social-icons/png/youtube15.png +0 -0
  71. data/app/assets/images/social-icons/svg/facebook25.svg +11 -0
  72. data/app/assets/images/social-icons/svg/rss25.svg +1 -0
  73. data/app/assets/images/social-icons/svg/twitter16.svg +15 -0
  74. data/app/assets/images/social-icons/svg/youtube15.svg +1 -0
  75. data/app/assets/js/components.js +376 -0
  76. data/app/assets/js/foundation/foundation.abide.js +408 -0
  77. data/app/assets/js/foundation/foundation.accordion.js +88 -0
  78. data/app/assets/js/foundation/foundation.alert.js +43 -0
  79. data/app/assets/js/foundation/foundation.clearing.js +586 -0
  80. data/app/assets/js/foundation/foundation.dropdown.js +463 -0
  81. data/app/assets/js/foundation/foundation.equalizer.js +104 -0
  82. data/app/assets/js/foundation/foundation.interchange.js +359 -0
  83. data/app/assets/js/foundation/foundation.joyride.js +932 -0
  84. data/app/assets/js/foundation/foundation.js +725 -0
  85. data/app/assets/js/foundation/foundation.magellan.js +215 -0
  86. data/app/assets/js/foundation/foundation.offcanvas.js +152 -0
  87. data/app/assets/js/foundation/foundation.orbit.js +476 -0
  88. data/app/assets/js/foundation/foundation.reveal.js +498 -0
  89. data/app/assets/js/foundation/foundation.slider.js +281 -0
  90. data/app/assets/js/foundation/foundation.tab.js +249 -0
  91. data/app/assets/js/foundation/foundation.tooltip.js +339 -0
  92. data/app/assets/js/foundation/foundation.topbar.js +458 -0
  93. data/app/assets/js/foundation.min.js +6376 -0
  94. data/app/assets/js/scripts-no-touch.js +33 -0
  95. data/app/assets/js/scripts-touch.js +33 -0
  96. data/app/assets/js/va_common_main.js +1 -0
  97. data/app/assets/js/vendor/classie.js +80 -0
  98. data/app/assets/js/vendor/html5shiv.js +8 -0
  99. data/app/assets/js/vendor/jquery-1.11.0.min.js +4 -0
  100. data/app/assets/js/vendor/jquery.js +9789 -0
  101. data/app/assets/js/vendor/jquery.smooth-scroll.js +255 -0
  102. data/app/assets/js/vendor/jquery.stellar.js +651 -0
  103. data/app/assets/js/vendor/jquery.tipsy.js +258 -0
  104. data/app/assets/js/vendor/menu.js +40 -0
  105. data/app/assets/js/vendor/modernizr.custom.js +4 -0
  106. data/app/assets/js/vendor/nwmatcher-1.2.5-min.js +7 -0
  107. data/app/assets/js/vendor/respond.min.js +6 -0
  108. data/app/assets/js/vendor/scroll-settings.js +3 -0
  109. data/app/assets/js/vendor/selectivizr-1.0.3b.js +560 -0
  110. data/app/assets/js/vendor/stellar-settings.js +8 -0
  111. data/app/assets/js/vendor/svg-injector.js +450 -0
  112. data/app/assets/js/vendor/tota11y.min.js +28 -0
  113. data/app/assets/js/vendor/wow.min.js +2 -0
  114. data/app/assets/stylesheets/_va.scss +2377 -0
  115. data/app/assets/stylesheets/components/_accordions.scss +98 -0
  116. data/app/assets/stylesheets/core/_base.scss +20 -0
  117. data/app/assets/stylesheets/core/_defaults.scss +92 -0
  118. data/app/assets/stylesheets/core/_grid-settings.scss +10 -0
  119. data/app/assets/stylesheets/core/_grid.scss +116 -0
  120. data/app/assets/stylesheets/core/_utilities.scss +105 -0
  121. data/app/assets/stylesheets/core/_variables.scss +88 -0
  122. data/app/assets/stylesheets/elements/_buttons.scss +189 -0
  123. data/app/assets/stylesheets/elements/_figure.scss +9 -0
  124. data/app/assets/stylesheets/elements/_inputs.scss +328 -0
  125. data/app/assets/stylesheets/elements/_labels.scss +39 -0
  126. data/app/assets/stylesheets/elements/_list.scss +82 -0
  127. data/app/assets/stylesheets/elements/_table.scss +39 -0
  128. data/app/assets/stylesheets/elements/_typography.scss +220 -0
  129. data/app/assets/stylesheets/foundation/_functions.scss +146 -0
  130. data/app/assets/stylesheets/foundation/_settings.scss +1467 -0
  131. data/app/assets/stylesheets/foundation/_variables.scss +1286 -0
  132. data/app/assets/stylesheets/foundation/components/_accordion.scss +157 -0
  133. data/app/assets/stylesheets/foundation/components/_alert-boxes.scss +128 -0
  134. data/app/assets/stylesheets/foundation/components/_block-grid.scss +132 -0
  135. data/app/assets/stylesheets/foundation/components/_breadcrumbs.scss +132 -0
  136. data/app/assets/stylesheets/foundation/components/_button-groups.scss +200 -0
  137. data/app/assets/stylesheets/foundation/components/_buttons.scss +259 -0
  138. data/app/assets/stylesheets/foundation/components/_clearing.scss +256 -0
  139. data/app/assets/stylesheets/foundation/components/_dropdown-buttons.scss +131 -0
  140. data/app/assets/stylesheets/foundation/components/_dropdown.scss +262 -0
  141. data/app/assets/stylesheets/foundation/components/_flex-video.scss +51 -0
  142. data/app/assets/stylesheets/foundation/components/_forms.scss +570 -0
  143. data/app/assets/stylesheets/foundation/components/_global.scss +481 -0
  144. data/app/assets/stylesheets/foundation/components/_grid.scss +289 -0
  145. data/app/assets/stylesheets/foundation/components/_icon-bar.scss +358 -0
  146. data/app/assets/stylesheets/foundation/components/_inline-lists.scss +57 -0
  147. data/app/assets/stylesheets/foundation/components/_joyride.scss +222 -0
  148. data/app/assets/stylesheets/foundation/components/_keystrokes.scss +61 -0
  149. data/app/assets/stylesheets/foundation/components/_labels.scss +106 -0
  150. data/app/assets/stylesheets/foundation/components/_magellan.scss +34 -0
  151. data/app/assets/stylesheets/foundation/components/_offcanvas.scss +515 -0
  152. data/app/assets/stylesheets/foundation/components/_orbit.scss +368 -0
  153. data/app/assets/stylesheets/foundation/components/_pagination.scss +162 -0
  154. data/app/assets/stylesheets/foundation/components/_panels.scss +101 -0
  155. data/app/assets/stylesheets/foundation/components/_pricing-tables.scss +150 -0
  156. data/app/assets/stylesheets/foundation/components/_progress-bars.scss +79 -0
  157. data/app/assets/stylesheets/foundation/components/_range-slider.scss +169 -0
  158. data/app/assets/stylesheets/foundation/components/_reveal.scss +202 -0
  159. data/app/assets/stylesheets/foundation/components/_side-nav.scss +116 -0
  160. data/app/assets/stylesheets/foundation/components/_split-buttons.scss +199 -0
  161. data/app/assets/stylesheets/foundation/components/_sub-nav.scss +123 -0
  162. data/app/assets/stylesheets/foundation/components/_switches.scss +238 -0
  163. data/app/assets/stylesheets/foundation/components/_tables.scss +135 -0
  164. data/app/assets/stylesheets/foundation/components/_tabs.scss +123 -0
  165. data/app/assets/stylesheets/foundation/components/_thumbs.scss +66 -0
  166. data/app/assets/stylesheets/foundation/components/_toolbar.scss +70 -0
  167. data/app/assets/stylesheets/foundation/components/_tooltips.scss +142 -0
  168. data/app/assets/stylesheets/foundation/components/_top-bar.scss +691 -0
  169. data/app/assets/stylesheets/foundation/components/_type.scss +525 -0
  170. data/app/assets/stylesheets/foundation/components/_visibility.scss +408 -0
  171. data/app/assets/stylesheets/functions/_new-breakpoint.scss +49 -0
  172. data/app/assets/stylesheets/functions/_private.scss +114 -0
  173. data/app/assets/stylesheets/lib/_normalize.scss +427 -0
  174. data/app/assets/stylesheets/lib/bourbon/_bourbon-deprecated-upcoming.scss +411 -0
  175. data/app/assets/stylesheets/lib/bourbon/_bourbon.scss +87 -0
  176. data/app/assets/stylesheets/lib/bourbon/addons/_border-color.scss +26 -0
  177. data/app/assets/stylesheets/lib/bourbon/addons/_border-radius.scss +48 -0
  178. data/app/assets/stylesheets/lib/bourbon/addons/_border-style.scss +25 -0
  179. data/app/assets/stylesheets/lib/bourbon/addons/_border-width.scss +25 -0
  180. data/app/assets/stylesheets/lib/bourbon/addons/_buttons.scss +64 -0
  181. data/app/assets/stylesheets/lib/bourbon/addons/_clearfix.scss +25 -0
  182. data/app/assets/stylesheets/lib/bourbon/addons/_ellipsis.scss +30 -0
  183. data/app/assets/stylesheets/lib/bourbon/addons/_font-stacks.scss +31 -0
  184. data/app/assets/stylesheets/lib/bourbon/addons/_hide-text.scss +27 -0
  185. data/app/assets/stylesheets/lib/bourbon/addons/_margin.scss +26 -0
  186. data/app/assets/stylesheets/lib/bourbon/addons/_padding.scss +26 -0
  187. data/app/assets/stylesheets/lib/bourbon/addons/_position.scss +48 -0
  188. data/app/assets/stylesheets/lib/bourbon/addons/_prefixer.scss +66 -0
  189. data/app/assets/stylesheets/lib/bourbon/addons/_retina-image.scss +25 -0
  190. data/app/assets/stylesheets/lib/bourbon/addons/_size.scss +51 -0
  191. data/app/assets/stylesheets/lib/bourbon/addons/_text-inputs.scss +112 -0
  192. data/app/assets/stylesheets/lib/bourbon/addons/_timing-functions.scss +34 -0
  193. data/app/assets/stylesheets/lib/bourbon/addons/_triangle.scss +63 -0
  194. data/app/assets/stylesheets/lib/bourbon/addons/_word-wrap.scss +29 -0
  195. data/app/assets/stylesheets/lib/bourbon/css3/_animation.scss +43 -0
  196. data/app/assets/stylesheets/lib/bourbon/css3/_appearance.scss +3 -0
  197. data/app/assets/stylesheets/lib/bourbon/css3/_backface-visibility.scss +3 -0
  198. data/app/assets/stylesheets/lib/bourbon/css3/_background-image.scss +42 -0
  199. data/app/assets/stylesheets/lib/bourbon/css3/_background.scss +55 -0
  200. data/app/assets/stylesheets/lib/bourbon/css3/_border-image.scss +59 -0
  201. data/app/assets/stylesheets/lib/bourbon/css3/_calc.scss +4 -0
  202. data/app/assets/stylesheets/lib/bourbon/css3/_columns.scss +47 -0
  203. data/app/assets/stylesheets/lib/bourbon/css3/_filter.scss +4 -0
  204. data/app/assets/stylesheets/lib/bourbon/css3/_flex-box.scss +287 -0
  205. data/app/assets/stylesheets/lib/bourbon/css3/_font-face.scss +24 -0
  206. data/app/assets/stylesheets/lib/bourbon/css3/_font-feature-settings.scss +4 -0
  207. data/app/assets/stylesheets/lib/bourbon/css3/_hidpi-media-query.scss +10 -0
  208. data/app/assets/stylesheets/lib/bourbon/css3/_hyphens.scss +4 -0
  209. data/app/assets/stylesheets/lib/bourbon/css3/_image-rendering.scss +14 -0
  210. data/app/assets/stylesheets/lib/bourbon/css3/_keyframes.scss +36 -0
  211. data/app/assets/stylesheets/lib/bourbon/css3/_linear-gradient.scss +38 -0
  212. data/app/assets/stylesheets/lib/bourbon/css3/_perspective.scss +8 -0
  213. data/app/assets/stylesheets/lib/bourbon/css3/_placeholder.scss +8 -0
  214. data/app/assets/stylesheets/lib/bourbon/css3/_radial-gradient.scss +39 -0
  215. data/app/assets/stylesheets/lib/bourbon/css3/_selection.scss +42 -0
  216. data/app/assets/stylesheets/lib/bourbon/css3/_text-decoration.scss +19 -0
  217. data/app/assets/stylesheets/lib/bourbon/css3/_transform.scss +15 -0
  218. data/app/assets/stylesheets/lib/bourbon/css3/_transition.scss +71 -0
  219. data/app/assets/stylesheets/lib/bourbon/css3/_user-select.scss +3 -0
  220. data/app/assets/stylesheets/lib/bourbon/functions/_assign-inputs.scss +11 -0
  221. data/app/assets/stylesheets/lib/bourbon/functions/_contains-falsy.scss +20 -0
  222. data/app/assets/stylesheets/lib/bourbon/functions/_contains.scss +26 -0
  223. data/app/assets/stylesheets/lib/bourbon/functions/_is-length.scss +11 -0
  224. data/app/assets/stylesheets/lib/bourbon/functions/_is-light.scss +21 -0
  225. data/app/assets/stylesheets/lib/bourbon/functions/_is-number.scss +11 -0
  226. data/app/assets/stylesheets/lib/bourbon/functions/_is-size.scss +13 -0
  227. data/app/assets/stylesheets/lib/bourbon/functions/_modular-scale.scss +69 -0
  228. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-em.scss +13 -0
  229. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-rem.scss +15 -0
  230. data/app/assets/stylesheets/lib/bourbon/functions/_shade.scss +24 -0
  231. data/app/assets/stylesheets/lib/bourbon/functions/_strip-units.scss +17 -0
  232. data/app/assets/stylesheets/lib/bourbon/functions/_tint.scss +24 -0
  233. data/app/assets/stylesheets/lib/bourbon/functions/_transition-property-name.scss +22 -0
  234. data/app/assets/stylesheets/lib/bourbon/functions/_unpack.scss +27 -0
  235. data/app/assets/stylesheets/lib/bourbon/helpers/_convert-units.scss +21 -0
  236. data/app/assets/stylesheets/lib/bourbon/helpers/_directional-values.scss +96 -0
  237. data/app/assets/stylesheets/lib/bourbon/helpers/_font-source-declaration.scss +43 -0
  238. data/app/assets/stylesheets/lib/bourbon/helpers/_gradient-positions-parser.scss +13 -0
  239. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-angle-parser.scss +25 -0
  240. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-gradient-parser.scss +41 -0
  241. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-positions-parser.scss +61 -0
  242. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-side-corner-parser.scss +31 -0
  243. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-arg-parser.scss +69 -0
  244. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-gradient-parser.scss +50 -0
  245. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-positions-parser.scss +18 -0
  246. data/app/assets/stylesheets/lib/bourbon/helpers/_render-gradients.scss +26 -0
  247. data/app/assets/stylesheets/lib/bourbon/helpers/_shape-size-stripper.scss +10 -0
  248. data/app/assets/stylesheets/lib/bourbon/helpers/_str-to-num.scss +50 -0
  249. data/app/assets/stylesheets/lib/bourbon/settings/_asset-pipeline.scss +7 -0
  250. data/app/assets/stylesheets/lib/bourbon/settings/_prefixer.scss +9 -0
  251. data/app/assets/stylesheets/lib/bourbon/settings/_px-to-em.scss +1 -0
  252. data/app/assets/stylesheets/lib/neat/_neat-helpers.scss +8 -0
  253. data/app/assets/stylesheets/lib/neat/_neat.scss +23 -0
  254. data/app/assets/stylesheets/lib/neat/functions/_new-breakpoint.scss +49 -0
  255. data/app/assets/stylesheets/lib/neat/functions/_private.scss +114 -0
  256. data/app/assets/stylesheets/lib/neat/grid/_box-sizing.scss +15 -0
  257. data/app/assets/stylesheets/lib/neat/grid/_direction-context.scss +33 -0
  258. data/app/assets/stylesheets/lib/neat/grid/_display-context.scss +28 -0
  259. data/app/assets/stylesheets/lib/neat/grid/_fill-parent.scss +22 -0
  260. data/app/assets/stylesheets/lib/neat/grid/_media.scss +92 -0
  261. data/app/assets/stylesheets/lib/neat/grid/_omega.scss +87 -0
  262. data/app/assets/stylesheets/lib/neat/grid/_outer-container.scss +38 -0
  263. data/app/assets/stylesheets/lib/neat/grid/_pad.scss +25 -0
  264. data/app/assets/stylesheets/lib/neat/grid/_private.scss +35 -0
  265. data/app/assets/stylesheets/lib/neat/grid/_row.scss +52 -0
  266. data/app/assets/stylesheets/lib/neat/grid/_shift.scss +50 -0
  267. data/app/assets/stylesheets/lib/neat/grid/_span-columns.scss +94 -0
  268. data/app/assets/stylesheets/lib/neat/grid/_to-deprecate.scss +97 -0
  269. data/app/assets/stylesheets/lib/neat/grid/_visual-grid.scss +42 -0
  270. data/app/assets/stylesheets/lib/neat/settings/_disable-warnings.scss +13 -0
  271. data/app/assets/stylesheets/lib/neat/settings/_grid.scss +51 -0
  272. data/app/assets/stylesheets/lib/neat/settings/_visual-grid.scss +27 -0
  273. data/app/assets/stylesheets/va_common_main.css.scss +18 -0
  274. data/bin/console +14 -0
  275. data/bin/setup +7 -0
  276. data/lib/generators/files/_footer.html.erb +89 -0
  277. data/lib/generators/files/_header.html.erb +7 -0
  278. data/lib/generators/va_common_generator.rb +6 -0
  279. data/lib/generators/va_footer_generator.rb +7 -0
  280. data/lib/generators/va_header_generator.rb +7 -0
  281. data/lib/va_common/engine.rb +4 -0
  282. data/lib/va_common/version.rb +3 -0
  283. data/lib/va_common.rb +2 -0
  284. data/va_common.gemspec +22 -0
  285. metadata +354 -0
@@ -0,0 +1,458 @@
1
+ ;(function ($, window, document, undefined) {
2
+ 'use strict';
3
+
4
+ Foundation.libs.topbar = {
5
+ name : 'topbar',
6
+
7
+ version : '5.5.2',
8
+
9
+ settings : {
10
+ index : 0,
11
+ start_offset : 0,
12
+ sticky_class : 'sticky',
13
+ custom_back_text : true,
14
+ back_text : 'Back',
15
+ mobile_show_parent_link : true,
16
+ is_hover : true,
17
+ scrolltop : true, // jump to top when sticky nav menu toggle is clicked
18
+ sticky_on : 'all',
19
+ dropdown_autoclose: true
20
+ },
21
+
22
+ init : function (section, method, options) {
23
+ Foundation.inherit(this, 'add_custom_rule register_media throttle');
24
+ var self = this;
25
+
26
+ self.register_media('topbar', 'foundation-mq-topbar');
27
+
28
+ this.bindings(method, options);
29
+
30
+ self.S('[' + this.attr_name() + ']', this.scope).each(function () {
31
+ var topbar = $(this),
32
+ settings = topbar.data(self.attr_name(true) + '-init'),
33
+ section = self.S('section, .top-bar-section', this);
34
+ topbar.data('index', 0);
35
+ var topbarContainer = topbar.parent();
36
+ if (topbarContainer.hasClass('fixed') || self.is_sticky(topbar, topbarContainer, settings) ) {
37
+ self.settings.sticky_class = settings.sticky_class;
38
+ self.settings.sticky_topbar = topbar;
39
+ topbar.data('height', topbarContainer.outerHeight());
40
+ topbar.data('stickyoffset', topbarContainer.offset().top);
41
+ } else {
42
+ topbar.data('height', topbar.outerHeight());
43
+ }
44
+
45
+ if (!settings.assembled) {
46
+ self.assemble(topbar);
47
+ }
48
+
49
+ if (settings.is_hover) {
50
+ self.S('.has-dropdown', topbar).addClass('not-click');
51
+ } else {
52
+ self.S('.has-dropdown', topbar).removeClass('not-click');
53
+ }
54
+
55
+ // Pad body when sticky (scrolled) or fixed.
56
+ self.add_custom_rule('.f-topbar-fixed { padding-top: ' + topbar.data('height') + 'px }');
57
+
58
+ if (topbarContainer.hasClass('fixed')) {
59
+ self.S('body').addClass('f-topbar-fixed');
60
+ }
61
+ });
62
+
63
+ },
64
+
65
+ is_sticky : function (topbar, topbarContainer, settings) {
66
+ var sticky = topbarContainer.hasClass(settings.sticky_class);
67
+ var smallMatch = matchMedia(Foundation.media_queries.small).matches;
68
+ var medMatch = matchMedia(Foundation.media_queries.medium).matches;
69
+ var lrgMatch = matchMedia(Foundation.media_queries.large).matches;
70
+
71
+ if (sticky && settings.sticky_on === 'all') {
72
+ return true;
73
+ }
74
+ if (sticky && this.small() && settings.sticky_on.indexOf('small') !== -1) {
75
+ if (smallMatch && !medMatch && !lrgMatch) { return true; }
76
+ }
77
+ if (sticky && this.medium() && settings.sticky_on.indexOf('medium') !== -1) {
78
+ if (smallMatch && medMatch && !lrgMatch) { return true; }
79
+ }
80
+ if (sticky && this.large() && settings.sticky_on.indexOf('large') !== -1) {
81
+ if (smallMatch && medMatch && lrgMatch) { return true; }
82
+ }
83
+
84
+ return false;
85
+ },
86
+
87
+ toggle : function (toggleEl) {
88
+ var self = this,
89
+ topbar;
90
+
91
+ if (toggleEl) {
92
+ topbar = self.S(toggleEl).closest('[' + this.attr_name() + ']');
93
+ } else {
94
+ topbar = self.S('[' + this.attr_name() + ']');
95
+ }
96
+
97
+ var settings = topbar.data(this.attr_name(true) + '-init');
98
+
99
+ var section = self.S('section, .top-bar-section', topbar);
100
+
101
+ if (self.breakpoint()) {
102
+ if (!self.rtl) {
103
+ section.css({left : '0%'});
104
+ $('>.name', section).css({left : '100%'});
105
+ } else {
106
+ section.css({right : '0%'});
107
+ $('>.name', section).css({right : '100%'});
108
+ }
109
+
110
+ self.S('li.moved', section).removeClass('moved');
111
+ topbar.data('index', 0);
112
+
113
+ topbar
114
+ .toggleClass('expanded')
115
+ .css('height', '');
116
+ }
117
+
118
+ if (settings.scrolltop) {
119
+ if (!topbar.hasClass('expanded')) {
120
+ if (topbar.hasClass('fixed')) {
121
+ topbar.parent().addClass('fixed');
122
+ topbar.removeClass('fixed');
123
+ self.S('body').addClass('f-topbar-fixed');
124
+ }
125
+ } else if (topbar.parent().hasClass('fixed')) {
126
+ if (settings.scrolltop) {
127
+ topbar.parent().removeClass('fixed');
128
+ topbar.addClass('fixed');
129
+ self.S('body').removeClass('f-topbar-fixed');
130
+
131
+ window.scrollTo(0, 0);
132
+ } else {
133
+ topbar.parent().removeClass('expanded');
134
+ }
135
+ }
136
+ } else {
137
+ if (self.is_sticky(topbar, topbar.parent(), settings)) {
138
+ topbar.parent().addClass('fixed');
139
+ }
140
+
141
+ if (topbar.parent().hasClass('fixed')) {
142
+ if (!topbar.hasClass('expanded')) {
143
+ topbar.removeClass('fixed');
144
+ topbar.parent().removeClass('expanded');
145
+ self.update_sticky_positioning();
146
+ } else {
147
+ topbar.addClass('fixed');
148
+ topbar.parent().addClass('expanded');
149
+ self.S('body').addClass('f-topbar-fixed');
150
+ }
151
+ }
152
+ }
153
+ },
154
+
155
+ timer : null,
156
+
157
+ events : function (bar) {
158
+ var self = this,
159
+ S = this.S;
160
+
161
+ S(this.scope)
162
+ .off('.topbar')
163
+ .on('click.fndtn.topbar', '[' + this.attr_name() + '] .toggle-topbar', function (e) {
164
+ e.preventDefault();
165
+ self.toggle(this);
166
+ })
167
+ .on('click.fndtn.topbar contextmenu.fndtn.topbar', '.top-bar .top-bar-section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li a[href^="#"]', function (e) {
168
+ var li = $(this).closest('li'),
169
+ topbar = li.closest('[' + self.attr_name() + ']'),
170
+ settings = topbar.data(self.attr_name(true) + '-init');
171
+
172
+ if (settings.dropdown_autoclose && settings.is_hover) {
173
+ var hoverLi = $(this).closest('.hover');
174
+ hoverLi.removeClass('hover');
175
+ }
176
+ if (self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown')) {
177
+ self.toggle();
178
+ }
179
+
180
+ })
181
+ .on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) {
182
+ var li = S(this),
183
+ target = S(e.target),
184
+ topbar = li.closest('[' + self.attr_name() + ']'),
185
+ settings = topbar.data(self.attr_name(true) + '-init');
186
+
187
+ if (target.data('revealId')) {
188
+ self.toggle();
189
+ return;
190
+ }
191
+
192
+ if (self.breakpoint()) {
193
+ return;
194
+ }
195
+
196
+ if (settings.is_hover && !Modernizr.touch) {
197
+ return;
198
+ }
199
+
200
+ e.stopImmediatePropagation();
201
+
202
+ if (li.hasClass('hover')) {
203
+ li
204
+ .removeClass('hover')
205
+ .find('li')
206
+ .removeClass('hover');
207
+
208
+ li.parents('li.hover')
209
+ .removeClass('hover');
210
+ } else {
211
+ li.addClass('hover');
212
+
213
+ $(li).siblings().removeClass('hover');
214
+
215
+ if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) {
216
+ e.preventDefault();
217
+ }
218
+ }
219
+ })
220
+ .on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown>a', function (e) {
221
+ if (self.breakpoint()) {
222
+
223
+ e.preventDefault();
224
+
225
+ var $this = S(this),
226
+ topbar = $this.closest('[' + self.attr_name() + ']'),
227
+ section = topbar.find('section, .top-bar-section'),
228
+ dropdownHeight = $this.next('.dropdown').outerHeight(),
229
+ $selectedLi = $this.closest('li');
230
+
231
+ topbar.data('index', topbar.data('index') + 1);
232
+ $selectedLi.addClass('moved');
233
+
234
+ if (!self.rtl) {
235
+ section.css({left : -(100 * topbar.data('index')) + '%'});
236
+ section.find('>.name').css({left : 100 * topbar.data('index') + '%'});
237
+ } else {
238
+ section.css({right : -(100 * topbar.data('index')) + '%'});
239
+ section.find('>.name').css({right : 100 * topbar.data('index') + '%'});
240
+ }
241
+
242
+ topbar.css('height', $this.siblings('ul').outerHeight(true) + topbar.data('height'));
243
+ }
244
+ });
245
+
246
+ S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {
247
+ self.resize.call(self);
248
+ }, 50)).trigger('resize.fndtn.topbar').load(function () {
249
+ // Ensure that the offset is calculated after all of the pages resources have loaded
250
+ S(this).trigger('resize.fndtn.topbar');
251
+ });
252
+
253
+ S('body').off('.topbar').on('click.fndtn.topbar', function (e) {
254
+ var parent = S(e.target).closest('li').closest('li.hover');
255
+
256
+ if (parent.length > 0) {
257
+ return;
258
+ }
259
+
260
+ S('[' + self.attr_name() + '] li.hover').removeClass('hover');
261
+ });
262
+
263
+ // Go up a level on Click
264
+ S(this.scope).on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown .back', function (e) {
265
+ e.preventDefault();
266
+
267
+ var $this = S(this),
268
+ topbar = $this.closest('[' + self.attr_name() + ']'),
269
+ section = topbar.find('section, .top-bar-section'),
270
+ settings = topbar.data(self.attr_name(true) + '-init'),
271
+ $movedLi = $this.closest('li.moved'),
272
+ $previousLevelUl = $movedLi.parent();
273
+
274
+ topbar.data('index', topbar.data('index') - 1);
275
+
276
+ if (!self.rtl) {
277
+ section.css({left : -(100 * topbar.data('index')) + '%'});
278
+ section.find('>.name').css({left : 100 * topbar.data('index') + '%'});
279
+ } else {
280
+ section.css({right : -(100 * topbar.data('index')) + '%'});
281
+ section.find('>.name').css({right : 100 * topbar.data('index') + '%'});
282
+ }
283
+
284
+ if (topbar.data('index') === 0) {
285
+ topbar.css('height', '');
286
+ } else {
287
+ topbar.css('height', $previousLevelUl.outerHeight(true) + topbar.data('height'));
288
+ }
289
+
290
+ setTimeout(function () {
291
+ $movedLi.removeClass('moved');
292
+ }, 300);
293
+ });
294
+
295
+ // Show dropdown menus when their items are focused
296
+ S(this.scope).find('.dropdown a')
297
+ .focus(function () {
298
+ $(this).parents('.has-dropdown').addClass('hover');
299
+ })
300
+ .blur(function () {
301
+ $(this).parents('.has-dropdown').removeClass('hover');
302
+ });
303
+ },
304
+
305
+ resize : function () {
306
+ var self = this;
307
+ self.S('[' + this.attr_name() + ']').each(function () {
308
+ var topbar = self.S(this),
309
+ settings = topbar.data(self.attr_name(true) + '-init');
310
+
311
+ var stickyContainer = topbar.parent('.' + self.settings.sticky_class);
312
+ var stickyOffset;
313
+
314
+ if (!self.breakpoint()) {
315
+ var doToggle = topbar.hasClass('expanded');
316
+ topbar
317
+ .css('height', '')
318
+ .removeClass('expanded')
319
+ .find('li')
320
+ .removeClass('hover');
321
+
322
+ if (doToggle) {
323
+ self.toggle(topbar);
324
+ }
325
+ }
326
+
327
+ if (self.is_sticky(topbar, stickyContainer, settings)) {
328
+ if (stickyContainer.hasClass('fixed')) {
329
+ // Remove the fixed to allow for correct calculation of the offset.
330
+ stickyContainer.removeClass('fixed');
331
+
332
+ stickyOffset = stickyContainer.offset().top;
333
+ if (self.S(document.body).hasClass('f-topbar-fixed')) {
334
+ stickyOffset -= topbar.data('height');
335
+ }
336
+
337
+ topbar.data('stickyoffset', stickyOffset);
338
+ stickyContainer.addClass('fixed');
339
+ } else {
340
+ stickyOffset = stickyContainer.offset().top;
341
+ topbar.data('stickyoffset', stickyOffset);
342
+ }
343
+ }
344
+
345
+ });
346
+ },
347
+
348
+ breakpoint : function () {
349
+ return !matchMedia(Foundation.media_queries['topbar']).matches;
350
+ },
351
+
352
+ small : function () {
353
+ return matchMedia(Foundation.media_queries['small']).matches;
354
+ },
355
+
356
+ medium : function () {
357
+ return matchMedia(Foundation.media_queries['medium']).matches;
358
+ },
359
+
360
+ large : function () {
361
+ return matchMedia(Foundation.media_queries['large']).matches;
362
+ },
363
+
364
+ assemble : function (topbar) {
365
+ var self = this,
366
+ settings = topbar.data(this.attr_name(true) + '-init'),
367
+ section = self.S('section, .top-bar-section', topbar);
368
+
369
+ // Pull element out of the DOM for manipulation
370
+ section.detach();
371
+
372
+ self.S('.has-dropdown>a', section).each(function () {
373
+ var $link = self.S(this),
374
+ $dropdown = $link.siblings('.dropdown'),
375
+ url = $link.attr('href'),
376
+ $titleLi;
377
+
378
+ if (!$dropdown.find('.title.back').length) {
379
+
380
+ if (settings.mobile_show_parent_link == true && url) {
381
+ $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link hide-for-medium-up"><a class="parent-link js-generated" href="' + url + '">' + $link.html() +'</a></li>');
382
+ } else {
383
+ $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5>');
384
+ }
385
+
386
+ // Copy link to subnav
387
+ if (settings.custom_back_text == true) {
388
+ $('h5>a', $titleLi).html(settings.back_text);
389
+ } else {
390
+ $('h5>a', $titleLi).html('&laquo; ' + $link.html());
391
+ }
392
+ $dropdown.prepend($titleLi);
393
+ }
394
+ });
395
+
396
+ // Put element back in the DOM
397
+ section.appendTo(topbar);
398
+
399
+ // check for sticky
400
+ this.sticky();
401
+
402
+ this.assembled(topbar);
403
+ },
404
+
405
+ assembled : function (topbar) {
406
+ topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled : true}));
407
+ },
408
+
409
+ height : function (ul) {
410
+ var total = 0,
411
+ self = this;
412
+
413
+ $('> li', ul).each(function () {
414
+ total += self.S(this).outerHeight(true);
415
+ });
416
+
417
+ return total;
418
+ },
419
+
420
+ sticky : function () {
421
+ var self = this;
422
+
423
+ this.S(window).on('scroll', function () {
424
+ self.update_sticky_positioning();
425
+ });
426
+ },
427
+
428
+ update_sticky_positioning : function () {
429
+ var klass = '.' + this.settings.sticky_class,
430
+ $window = this.S(window),
431
+ self = this;
432
+
433
+ if (self.settings.sticky_topbar && self.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(), this.settings)) {
434
+ var distance = this.settings.sticky_topbar.data('stickyoffset') + this.settings.start_offset;
435
+ if (!self.S(klass).hasClass('expanded')) {
436
+ if ($window.scrollTop() > (distance)) {
437
+ if (!self.S(klass).hasClass('fixed')) {
438
+ self.S(klass).addClass('fixed');
439
+ self.S('body').addClass('f-topbar-fixed');
440
+ }
441
+ } else if ($window.scrollTop() <= distance) {
442
+ if (self.S(klass).hasClass('fixed')) {
443
+ self.S(klass).removeClass('fixed');
444
+ self.S('body').removeClass('f-topbar-fixed');
445
+ }
446
+ }
447
+ }
448
+ }
449
+ },
450
+
451
+ off : function () {
452
+ this.S(this.scope).off('.fndtn.topbar');
453
+ this.S(window).off('.fndtn.topbar');
454
+ },
455
+
456
+ reflow : function () {}
457
+ };
458
+ }(jQuery, window, window.document));