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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/README.md +66 -0
- data/Rakefile +1 -0
- data/app/assets/fonts/merriweather-bold-webfont.eot +0 -0
- data/app/assets/fonts/merriweather-bold-webfont.svg +294 -0
- data/app/assets/fonts/merriweather-bold-webfont.ttf +0 -0
- data/app/assets/fonts/merriweather-bold-webfont.woff +0 -0
- data/app/assets/fonts/merriweather-bold-webfont.woff2 +0 -0
- data/app/assets/fonts/merriweather-italic-webfont.eot +0 -0
- data/app/assets/fonts/merriweather-italic-webfont.svg +283 -0
- data/app/assets/fonts/merriweather-italic-webfont.ttf +0 -0
- data/app/assets/fonts/merriweather-italic-webfont.woff +0 -0
- data/app/assets/fonts/merriweather-italic-webfont.woff2 +0 -0
- data/app/assets/fonts/merriweather-light-webfont.eot +0 -0
- data/app/assets/fonts/merriweather-light-webfont.svg +299 -0
- data/app/assets/fonts/merriweather-light-webfont.ttf +0 -0
- data/app/assets/fonts/merriweather-light-webfont.woff +0 -0
- data/app/assets/fonts/merriweather-light-webfont.woff2 +0 -0
- data/app/assets/fonts/merriweather-regular-webfont.eot +0 -0
- data/app/assets/fonts/merriweather-regular-webfont.svg +294 -0
- data/app/assets/fonts/merriweather-regular-webfont.ttf +0 -0
- data/app/assets/fonts/merriweather-regular-webfont.woff +0 -0
- data/app/assets/fonts/merriweather-regular-webfont.woff2 +0 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.eot +0 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.svg +965 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.ttf +0 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.woff +0 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.woff2 +0 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.eot +0 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.svg +853 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.ttf +0 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.woff +0 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.woff2 +0 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.eot +0 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.svg +915 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.ttf +0 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.woff +0 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.woff2 +0 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.eot +0 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.svg +989 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.ttf +0 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.woff +0 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.woff2 +0 -0
- data/app/assets/images/design/background/thread.png +0 -0
- data/app/assets/images/design/logo/logo-alt-hover.png +0 -0
- data/app/assets/images/design/logo/logo-alt.png +0 -0
- data/app/assets/images/design/logo/logo-hover.png +0 -0
- data/app/assets/images/design/logo/logo-small.png +0 -0
- data/app/assets/images/design/logo/logo.png +0 -0
- data/app/assets/images/design/logo/og-image.jpg +0 -0
- data/app/assets/images/design/seal/seal-footer.png +0 -0
- data/app/assets/images/design/seal/seal-footer.svg +1 -0
- data/app/assets/images/design/seal/seal.png +0 -0
- data/app/assets/images/design/seal/stars.png +0 -0
- data/app/assets/images/icons/apple-touch-icon-114x114.png +0 -0
- data/app/assets/images/icons/apple-touch-icon-152x152.png +0 -0
- data/app/assets/images/icons/apple-touch-icon-72x72.png +0 -0
- data/app/assets/images/icons/apple-touch-icon.png +0 -0
- data/app/assets/images/icons/favicon.ico +0 -0
- data/app/assets/images/icons/va.png +0 -0
- data/app/assets/images/icons/watermark.png +0 -0
- data/app/assets/images/icons/wrench.png +0 -0
- data/app/assets/images/social-icons/png/facebook25.png +0 -0
- data/app/assets/images/social-icons/png/rss25.png +0 -0
- data/app/assets/images/social-icons/png/twitter16.png +0 -0
- data/app/assets/images/social-icons/png/youtube15.png +0 -0
- data/app/assets/images/social-icons/svg/facebook25.svg +11 -0
- data/app/assets/images/social-icons/svg/rss25.svg +1 -0
- data/app/assets/images/social-icons/svg/twitter16.svg +15 -0
- data/app/assets/images/social-icons/svg/youtube15.svg +1 -0
- data/app/assets/js/components.js +376 -0
- data/app/assets/js/foundation/foundation.abide.js +408 -0
- data/app/assets/js/foundation/foundation.accordion.js +88 -0
- data/app/assets/js/foundation/foundation.alert.js +43 -0
- data/app/assets/js/foundation/foundation.clearing.js +586 -0
- data/app/assets/js/foundation/foundation.dropdown.js +463 -0
- data/app/assets/js/foundation/foundation.equalizer.js +104 -0
- data/app/assets/js/foundation/foundation.interchange.js +359 -0
- data/app/assets/js/foundation/foundation.joyride.js +932 -0
- data/app/assets/js/foundation/foundation.js +725 -0
- data/app/assets/js/foundation/foundation.magellan.js +215 -0
- data/app/assets/js/foundation/foundation.offcanvas.js +152 -0
- data/app/assets/js/foundation/foundation.orbit.js +476 -0
- data/app/assets/js/foundation/foundation.reveal.js +498 -0
- data/app/assets/js/foundation/foundation.slider.js +281 -0
- data/app/assets/js/foundation/foundation.tab.js +249 -0
- data/app/assets/js/foundation/foundation.tooltip.js +339 -0
- data/app/assets/js/foundation/foundation.topbar.js +458 -0
- data/app/assets/js/foundation.min.js +6376 -0
- data/app/assets/js/scripts-no-touch.js +33 -0
- data/app/assets/js/scripts-touch.js +33 -0
- data/app/assets/js/va_common_main.js +1 -0
- data/app/assets/js/vendor/classie.js +80 -0
- data/app/assets/js/vendor/html5shiv.js +8 -0
- data/app/assets/js/vendor/jquery-1.11.0.min.js +4 -0
- data/app/assets/js/vendor/jquery.js +9789 -0
- data/app/assets/js/vendor/jquery.smooth-scroll.js +255 -0
- data/app/assets/js/vendor/jquery.stellar.js +651 -0
- data/app/assets/js/vendor/jquery.tipsy.js +258 -0
- data/app/assets/js/vendor/menu.js +40 -0
- data/app/assets/js/vendor/modernizr.custom.js +4 -0
- data/app/assets/js/vendor/nwmatcher-1.2.5-min.js +7 -0
- data/app/assets/js/vendor/respond.min.js +6 -0
- data/app/assets/js/vendor/scroll-settings.js +3 -0
- data/app/assets/js/vendor/selectivizr-1.0.3b.js +560 -0
- data/app/assets/js/vendor/stellar-settings.js +8 -0
- data/app/assets/js/vendor/svg-injector.js +450 -0
- data/app/assets/js/vendor/tota11y.min.js +28 -0
- data/app/assets/js/vendor/wow.min.js +2 -0
- data/app/assets/stylesheets/_va.scss +2377 -0
- data/app/assets/stylesheets/components/_accordions.scss +98 -0
- data/app/assets/stylesheets/core/_base.scss +20 -0
- data/app/assets/stylesheets/core/_defaults.scss +92 -0
- data/app/assets/stylesheets/core/_grid-settings.scss +10 -0
- data/app/assets/stylesheets/core/_grid.scss +116 -0
- data/app/assets/stylesheets/core/_utilities.scss +105 -0
- data/app/assets/stylesheets/core/_variables.scss +88 -0
- data/app/assets/stylesheets/elements/_buttons.scss +189 -0
- data/app/assets/stylesheets/elements/_figure.scss +9 -0
- data/app/assets/stylesheets/elements/_inputs.scss +328 -0
- data/app/assets/stylesheets/elements/_labels.scss +39 -0
- data/app/assets/stylesheets/elements/_list.scss +82 -0
- data/app/assets/stylesheets/elements/_table.scss +39 -0
- data/app/assets/stylesheets/elements/_typography.scss +220 -0
- data/app/assets/stylesheets/foundation/_functions.scss +146 -0
- data/app/assets/stylesheets/foundation/_settings.scss +1467 -0
- data/app/assets/stylesheets/foundation/_variables.scss +1286 -0
- data/app/assets/stylesheets/foundation/components/_accordion.scss +157 -0
- data/app/assets/stylesheets/foundation/components/_alert-boxes.scss +128 -0
- data/app/assets/stylesheets/foundation/components/_block-grid.scss +132 -0
- data/app/assets/stylesheets/foundation/components/_breadcrumbs.scss +132 -0
- data/app/assets/stylesheets/foundation/components/_button-groups.scss +200 -0
- data/app/assets/stylesheets/foundation/components/_buttons.scss +259 -0
- data/app/assets/stylesheets/foundation/components/_clearing.scss +256 -0
- data/app/assets/stylesheets/foundation/components/_dropdown-buttons.scss +131 -0
- data/app/assets/stylesheets/foundation/components/_dropdown.scss +262 -0
- data/app/assets/stylesheets/foundation/components/_flex-video.scss +51 -0
- data/app/assets/stylesheets/foundation/components/_forms.scss +570 -0
- data/app/assets/stylesheets/foundation/components/_global.scss +481 -0
- data/app/assets/stylesheets/foundation/components/_grid.scss +289 -0
- data/app/assets/stylesheets/foundation/components/_icon-bar.scss +358 -0
- data/app/assets/stylesheets/foundation/components/_inline-lists.scss +57 -0
- data/app/assets/stylesheets/foundation/components/_joyride.scss +222 -0
- data/app/assets/stylesheets/foundation/components/_keystrokes.scss +61 -0
- data/app/assets/stylesheets/foundation/components/_labels.scss +106 -0
- data/app/assets/stylesheets/foundation/components/_magellan.scss +34 -0
- data/app/assets/stylesheets/foundation/components/_offcanvas.scss +515 -0
- data/app/assets/stylesheets/foundation/components/_orbit.scss +368 -0
- data/app/assets/stylesheets/foundation/components/_pagination.scss +162 -0
- data/app/assets/stylesheets/foundation/components/_panels.scss +101 -0
- data/app/assets/stylesheets/foundation/components/_pricing-tables.scss +150 -0
- data/app/assets/stylesheets/foundation/components/_progress-bars.scss +79 -0
- data/app/assets/stylesheets/foundation/components/_range-slider.scss +169 -0
- data/app/assets/stylesheets/foundation/components/_reveal.scss +202 -0
- data/app/assets/stylesheets/foundation/components/_side-nav.scss +116 -0
- data/app/assets/stylesheets/foundation/components/_split-buttons.scss +199 -0
- data/app/assets/stylesheets/foundation/components/_sub-nav.scss +123 -0
- data/app/assets/stylesheets/foundation/components/_switches.scss +238 -0
- data/app/assets/stylesheets/foundation/components/_tables.scss +135 -0
- data/app/assets/stylesheets/foundation/components/_tabs.scss +123 -0
- data/app/assets/stylesheets/foundation/components/_thumbs.scss +66 -0
- data/app/assets/stylesheets/foundation/components/_toolbar.scss +70 -0
- data/app/assets/stylesheets/foundation/components/_tooltips.scss +142 -0
- data/app/assets/stylesheets/foundation/components/_top-bar.scss +691 -0
- data/app/assets/stylesheets/foundation/components/_type.scss +525 -0
- data/app/assets/stylesheets/foundation/components/_visibility.scss +408 -0
- data/app/assets/stylesheets/functions/_new-breakpoint.scss +49 -0
- data/app/assets/stylesheets/functions/_private.scss +114 -0
- data/app/assets/stylesheets/lib/_normalize.scss +427 -0
- data/app/assets/stylesheets/lib/bourbon/_bourbon-deprecated-upcoming.scss +411 -0
- data/app/assets/stylesheets/lib/bourbon/_bourbon.scss +87 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_border-color.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_border-radius.scss +48 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_border-style.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_border-width.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_buttons.scss +64 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_clearfix.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_ellipsis.scss +30 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_font-stacks.scss +31 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_hide-text.scss +27 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_margin.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_padding.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_position.scss +48 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_prefixer.scss +66 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_retina-image.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_size.scss +51 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_text-inputs.scss +112 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_timing-functions.scss +34 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_triangle.scss +63 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_word-wrap.scss +29 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_animation.scss +43 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_appearance.scss +3 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_backface-visibility.scss +3 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_background-image.scss +42 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_background.scss +55 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_border-image.scss +59 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_calc.scss +4 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_columns.scss +47 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_filter.scss +4 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_flex-box.scss +287 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_font-face.scss +24 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_font-feature-settings.scss +4 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_hidpi-media-query.scss +10 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_hyphens.scss +4 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_image-rendering.scss +14 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_keyframes.scss +36 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_linear-gradient.scss +38 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_perspective.scss +8 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_placeholder.scss +8 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_radial-gradient.scss +39 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_selection.scss +42 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_text-decoration.scss +19 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_transform.scss +15 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_transition.scss +71 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_user-select.scss +3 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_assign-inputs.scss +11 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_contains-falsy.scss +20 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_contains.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_is-length.scss +11 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_is-light.scss +21 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_is-number.scss +11 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_is-size.scss +13 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_modular-scale.scss +69 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_px-to-em.scss +13 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_px-to-rem.scss +15 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_shade.scss +24 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_strip-units.scss +17 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_tint.scss +24 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_transition-property-name.scss +22 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_unpack.scss +27 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_convert-units.scss +21 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_directional-values.scss +96 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_font-source-declaration.scss +43 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_gradient-positions-parser.scss +13 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-angle-parser.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-gradient-parser.scss +41 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-positions-parser.scss +61 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-side-corner-parser.scss +31 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-arg-parser.scss +69 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-gradient-parser.scss +50 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-positions-parser.scss +18 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_render-gradients.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_shape-size-stripper.scss +10 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_str-to-num.scss +50 -0
- data/app/assets/stylesheets/lib/bourbon/settings/_asset-pipeline.scss +7 -0
- data/app/assets/stylesheets/lib/bourbon/settings/_prefixer.scss +9 -0
- data/app/assets/stylesheets/lib/bourbon/settings/_px-to-em.scss +1 -0
- data/app/assets/stylesheets/lib/neat/_neat-helpers.scss +8 -0
- data/app/assets/stylesheets/lib/neat/_neat.scss +23 -0
- data/app/assets/stylesheets/lib/neat/functions/_new-breakpoint.scss +49 -0
- data/app/assets/stylesheets/lib/neat/functions/_private.scss +114 -0
- data/app/assets/stylesheets/lib/neat/grid/_box-sizing.scss +15 -0
- data/app/assets/stylesheets/lib/neat/grid/_direction-context.scss +33 -0
- data/app/assets/stylesheets/lib/neat/grid/_display-context.scss +28 -0
- data/app/assets/stylesheets/lib/neat/grid/_fill-parent.scss +22 -0
- data/app/assets/stylesheets/lib/neat/grid/_media.scss +92 -0
- data/app/assets/stylesheets/lib/neat/grid/_omega.scss +87 -0
- data/app/assets/stylesheets/lib/neat/grid/_outer-container.scss +38 -0
- data/app/assets/stylesheets/lib/neat/grid/_pad.scss +25 -0
- data/app/assets/stylesheets/lib/neat/grid/_private.scss +35 -0
- data/app/assets/stylesheets/lib/neat/grid/_row.scss +52 -0
- data/app/assets/stylesheets/lib/neat/grid/_shift.scss +50 -0
- data/app/assets/stylesheets/lib/neat/grid/_span-columns.scss +94 -0
- data/app/assets/stylesheets/lib/neat/grid/_to-deprecate.scss +97 -0
- data/app/assets/stylesheets/lib/neat/grid/_visual-grid.scss +42 -0
- data/app/assets/stylesheets/lib/neat/settings/_disable-warnings.scss +13 -0
- data/app/assets/stylesheets/lib/neat/settings/_grid.scss +51 -0
- data/app/assets/stylesheets/lib/neat/settings/_visual-grid.scss +27 -0
- data/app/assets/stylesheets/va_common_main.css.scss +18 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/generators/files/_footer.html.erb +89 -0
- data/lib/generators/files/_header.html.erb +7 -0
- data/lib/generators/va_common_generator.rb +6 -0
- data/lib/generators/va_footer_generator.rb +7 -0
- data/lib/generators/va_header_generator.rb +7 -0
- data/lib/va_common/engine.rb +4 -0
- data/lib/va_common/version.rb +3 -0
- data/lib/va_common.rb +2 -0
- data/va_common.gemspec +22 -0
- metadata +354 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
;(function ($, window, document, undefined) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Foundation.libs['magellan-expedition'] = {
|
|
5
|
+
name : 'magellan-expedition',
|
|
6
|
+
|
|
7
|
+
version : '5.5.2',
|
|
8
|
+
|
|
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
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
init : function (scope, method, options) {
|
|
21
|
+
Foundation.inherit(this, 'throttle');
|
|
22
|
+
this.bindings(method, options);
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
events : function () {
|
|
26
|
+
var self = this,
|
|
27
|
+
S = self.S,
|
|
28
|
+
settings = self.settings;
|
|
29
|
+
|
|
30
|
+
// initialize expedition offset
|
|
31
|
+
self.set_expedition_position();
|
|
32
|
+
|
|
33
|
+
S(self.scope)
|
|
34
|
+
.off('.magellan')
|
|
35
|
+
.on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href*=#]', function (e) {
|
|
36
|
+
var sameHost = ((this.hostname === location.hostname) || !this.hostname),
|
|
37
|
+
samePath = self.filterPathname(location.pathname) === self.filterPathname(this.pathname),
|
|
38
|
+
testHash = this.hash.replace(/(:|\.|\/)/g, '\\$1'),
|
|
39
|
+
anchor = this;
|
|
40
|
+
|
|
41
|
+
if (sameHost && samePath && testHash) {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
var expedition = $(this).closest('[' + self.attr_name() + ']'),
|
|
44
|
+
settings = expedition.data('magellan-expedition-init'),
|
|
45
|
+
hash = this.hash.split('#').join(''),
|
|
46
|
+
target = $('a[name="' + hash + '"]');
|
|
47
|
+
|
|
48
|
+
if (target.length === 0) {
|
|
49
|
+
target = $('#' + hash);
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Account for expedition height if fixed position
|
|
54
|
+
var scroll_top = target.offset().top - settings.destination_threshold + 1;
|
|
55
|
+
if (settings.offset_by_height) {
|
|
56
|
+
scroll_top = scroll_top - expedition.outerHeight();
|
|
57
|
+
}
|
|
58
|
+
$('html, body').stop().animate({
|
|
59
|
+
'scrollTop' : scroll_top
|
|
60
|
+
}, settings.duration, settings.easing, function () {
|
|
61
|
+
if (history.pushState) {
|
|
62
|
+
history.pushState(null, null, anchor.pathname + '#' + hash);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
location.hash = anchor.pathname + '#' + hash;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
.on('scroll.fndtn.magellan', self.throttle(this.check_for_arrivals.bind(this), settings.throttle_delay));
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
check_for_arrivals : function () {
|
|
74
|
+
var self = this;
|
|
75
|
+
self.update_arrivals();
|
|
76
|
+
self.update_expedition_positions();
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
set_expedition_position : function () {
|
|
80
|
+
var self = this;
|
|
81
|
+
$('[' + this.attr_name() + '=fixed]', self.scope).each(function (idx, el) {
|
|
82
|
+
var expedition = $(this),
|
|
83
|
+
settings = expedition.data('magellan-expedition-init'),
|
|
84
|
+
styles = expedition.attr('styles'), // save styles
|
|
85
|
+
top_offset, fixed_top;
|
|
86
|
+
|
|
87
|
+
expedition.attr('style', '');
|
|
88
|
+
top_offset = expedition.offset().top + settings.threshold;
|
|
89
|
+
|
|
90
|
+
//set fixed-top by attribute
|
|
91
|
+
fixed_top = parseInt(expedition.data('magellan-fixed-top'));
|
|
92
|
+
if (!isNaN(fixed_top)) {
|
|
93
|
+
self.settings.fixed_top = fixed_top;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
expedition.data(self.data_attr('magellan-top-offset'), top_offset);
|
|
97
|
+
expedition.attr('style', styles);
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
update_expedition_positions : function () {
|
|
102
|
+
var self = this,
|
|
103
|
+
window_top_offset = $(window).scrollTop();
|
|
104
|
+
|
|
105
|
+
$('[' + this.attr_name() + '=fixed]', self.scope).each(function () {
|
|
106
|
+
var expedition = $(this),
|
|
107
|
+
settings = expedition.data('magellan-expedition-init'),
|
|
108
|
+
styles = expedition.attr('style'), // save styles
|
|
109
|
+
top_offset = expedition.data('magellan-top-offset');
|
|
110
|
+
|
|
111
|
+
//scroll to the top distance
|
|
112
|
+
if (window_top_offset + self.settings.fixed_top >= top_offset) {
|
|
113
|
+
// Placeholder allows height calculations to be consistent even when
|
|
114
|
+
// appearing to switch between fixed/non-fixed placement
|
|
115
|
+
var placeholder = expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']');
|
|
116
|
+
if (placeholder.length === 0) {
|
|
117
|
+
placeholder = expedition.clone();
|
|
118
|
+
placeholder.removeAttr(self.attr_name());
|
|
119
|
+
placeholder.attr(self.add_namespace('data-magellan-expedition-clone'), '');
|
|
120
|
+
expedition.before(placeholder);
|
|
121
|
+
}
|
|
122
|
+
expedition.css({position :'fixed', top : settings.fixed_top}).addClass('fixed');
|
|
123
|
+
} else {
|
|
124
|
+
expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']').remove();
|
|
125
|
+
expedition.attr('style', styles).css('position', '').css('top', '').removeClass('fixed');
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
update_arrivals : function () {
|
|
131
|
+
var self = this,
|
|
132
|
+
window_top_offset = $(window).scrollTop();
|
|
133
|
+
|
|
134
|
+
$('[' + this.attr_name() + ']', self.scope).each(function () {
|
|
135
|
+
var expedition = $(this),
|
|
136
|
+
settings = expedition.data(self.attr_name(true) + '-init'),
|
|
137
|
+
offsets = self.offsets(expedition, window_top_offset),
|
|
138
|
+
arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'),
|
|
139
|
+
active_item = false;
|
|
140
|
+
offsets.each(function (idx, item) {
|
|
141
|
+
if (item.viewport_offset >= item.top_offset) {
|
|
142
|
+
var arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']');
|
|
143
|
+
arrivals.not(item.arrival).removeClass(settings.active_class);
|
|
144
|
+
item.arrival.addClass(settings.active_class);
|
|
145
|
+
active_item = true;
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
if (!active_item) {
|
|
151
|
+
arrivals.removeClass(settings.active_class);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
offsets : function (expedition, window_offset) {
|
|
157
|
+
var self = this,
|
|
158
|
+
settings = expedition.data(self.attr_name(true) + '-init'),
|
|
159
|
+
viewport_offset = window_offset;
|
|
160
|
+
|
|
161
|
+
return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function (idx, el) {
|
|
162
|
+
var name = $(this).data(self.data_attr('magellan-arrival')),
|
|
163
|
+
dest = $('[' + self.add_namespace('data-magellan-destination') + '=' + name + ']');
|
|
164
|
+
if (dest.length > 0) {
|
|
165
|
+
var top_offset = dest.offset().top - settings.destination_threshold;
|
|
166
|
+
if (settings.offset_by_height) {
|
|
167
|
+
top_offset = top_offset - expedition.outerHeight();
|
|
168
|
+
}
|
|
169
|
+
top_offset = Math.floor(top_offset);
|
|
170
|
+
return {
|
|
171
|
+
destination : dest,
|
|
172
|
+
arrival : $(this),
|
|
173
|
+
top_offset : top_offset,
|
|
174
|
+
viewport_offset : viewport_offset
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}).sort(function (a, b) {
|
|
178
|
+
if (a.top_offset < b.top_offset) {
|
|
179
|
+
return -1;
|
|
180
|
+
}
|
|
181
|
+
if (a.top_offset > b.top_offset) {
|
|
182
|
+
return 1;
|
|
183
|
+
}
|
|
184
|
+
return 0;
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
data_attr : function (str) {
|
|
189
|
+
if (this.namespace.length > 0) {
|
|
190
|
+
return this.namespace + '-' + str;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return str;
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
off : function () {
|
|
197
|
+
this.S(this.scope).off('.magellan');
|
|
198
|
+
this.S(window).off('.magellan');
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
filterPathname : function (pathname) {
|
|
202
|
+
pathname = pathname || '';
|
|
203
|
+
return pathname
|
|
204
|
+
.replace(/^\//,'')
|
|
205
|
+
.replace(/(?:index|default).[a-zA-Z]{3,4}$/,'')
|
|
206
|
+
.replace(/\/$/,'');
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
reflow : function () {
|
|
210
|
+
var self = this;
|
|
211
|
+
// remove placeholder expeditions used for height calculation purposes
|
|
212
|
+
$('[' + self.add_namespace('data-magellan-expedition-clone') + ']', self.scope).remove();
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}(jQuery, window, window.document));
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
;(function ($, window, document, undefined) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Foundation.libs.offcanvas = {
|
|
5
|
+
name : 'offcanvas',
|
|
6
|
+
|
|
7
|
+
version : '5.5.2',
|
|
8
|
+
|
|
9
|
+
settings : {
|
|
10
|
+
open_method : 'move',
|
|
11
|
+
close_on_click : false
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
init : function (scope, method, options) {
|
|
15
|
+
this.bindings(method, options);
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
events : function () {
|
|
19
|
+
var self = this,
|
|
20
|
+
S = self.S,
|
|
21
|
+
move_class = '',
|
|
22
|
+
right_postfix = '',
|
|
23
|
+
left_postfix = '';
|
|
24
|
+
|
|
25
|
+
if (this.settings.open_method === 'move') {
|
|
26
|
+
move_class = 'move-';
|
|
27
|
+
right_postfix = 'right';
|
|
28
|
+
left_postfix = 'left';
|
|
29
|
+
} else if (this.settings.open_method === 'overlap_single') {
|
|
30
|
+
move_class = 'offcanvas-overlap-';
|
|
31
|
+
right_postfix = 'right';
|
|
32
|
+
left_postfix = 'left';
|
|
33
|
+
} else if (this.settings.open_method === 'overlap') {
|
|
34
|
+
move_class = 'offcanvas-overlap';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
S(this.scope).off('.offcanvas')
|
|
38
|
+
.on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) {
|
|
39
|
+
self.click_toggle_class(e, move_class + right_postfix);
|
|
40
|
+
if (self.settings.open_method !== 'overlap') {
|
|
41
|
+
S('.left-submenu').removeClass(move_class + right_postfix);
|
|
42
|
+
}
|
|
43
|
+
$('.left-off-canvas-toggle').attr('aria-expanded', 'true');
|
|
44
|
+
})
|
|
45
|
+
.on('click.fndtn.offcanvas', '.left-off-canvas-menu a', function (e) {
|
|
46
|
+
var settings = self.get_settings(e);
|
|
47
|
+
var parent = S(this).parent();
|
|
48
|
+
|
|
49
|
+
if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
|
|
50
|
+
self.hide.call(self, move_class + right_postfix, self.get_wrapper(e));
|
|
51
|
+
parent.parent().removeClass(move_class + right_postfix);
|
|
52
|
+
} else if (S(this).parent().hasClass('has-submenu')) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
S(this).siblings('.left-submenu').toggleClass(move_class + right_postfix);
|
|
55
|
+
} else if (parent.hasClass('back')) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
parent.parent().removeClass(move_class + right_postfix);
|
|
58
|
+
}
|
|
59
|
+
$('.left-off-canvas-toggle').attr('aria-expanded', 'true');
|
|
60
|
+
})
|
|
61
|
+
.on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) {
|
|
62
|
+
self.click_toggle_class(e, move_class + left_postfix);
|
|
63
|
+
if (self.settings.open_method !== 'overlap') {
|
|
64
|
+
S('.right-submenu').removeClass(move_class + left_postfix);
|
|
65
|
+
}
|
|
66
|
+
$('.right-off-canvas-toggle').attr('aria-expanded', 'true');
|
|
67
|
+
})
|
|
68
|
+
.on('click.fndtn.offcanvas', '.right-off-canvas-menu a', function (e) {
|
|
69
|
+
var settings = self.get_settings(e);
|
|
70
|
+
var parent = S(this).parent();
|
|
71
|
+
|
|
72
|
+
if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
|
|
73
|
+
self.hide.call(self, move_class + left_postfix, self.get_wrapper(e));
|
|
74
|
+
parent.parent().removeClass(move_class + left_postfix);
|
|
75
|
+
} else if (S(this).parent().hasClass('has-submenu')) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
S(this).siblings('.right-submenu').toggleClass(move_class + left_postfix);
|
|
78
|
+
} else if (parent.hasClass('back')) {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
parent.parent().removeClass(move_class + left_postfix);
|
|
81
|
+
}
|
|
82
|
+
$('.right-off-canvas-toggle').attr('aria-expanded', 'true');
|
|
83
|
+
})
|
|
84
|
+
.on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
|
|
85
|
+
self.click_remove_class(e, move_class + left_postfix);
|
|
86
|
+
S('.right-submenu').removeClass(move_class + left_postfix);
|
|
87
|
+
if (right_postfix) {
|
|
88
|
+
self.click_remove_class(e, move_class + right_postfix);
|
|
89
|
+
S('.left-submenu').removeClass(move_class + left_postfix);
|
|
90
|
+
}
|
|
91
|
+
$('.right-off-canvas-toggle').attr('aria-expanded', 'true');
|
|
92
|
+
})
|
|
93
|
+
.on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
|
|
94
|
+
self.click_remove_class(e, move_class + left_postfix);
|
|
95
|
+
$('.left-off-canvas-toggle').attr('aria-expanded', 'false');
|
|
96
|
+
if (right_postfix) {
|
|
97
|
+
self.click_remove_class(e, move_class + right_postfix);
|
|
98
|
+
$('.right-off-canvas-toggle').attr('aria-expanded', 'false');
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
toggle : function (class_name, $off_canvas) {
|
|
104
|
+
$off_canvas = $off_canvas || this.get_wrapper();
|
|
105
|
+
if ($off_canvas.is('.' + class_name)) {
|
|
106
|
+
this.hide(class_name, $off_canvas);
|
|
107
|
+
} else {
|
|
108
|
+
this.show(class_name, $off_canvas);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
show : function (class_name, $off_canvas) {
|
|
113
|
+
$off_canvas = $off_canvas || this.get_wrapper();
|
|
114
|
+
$off_canvas.trigger('open.fndtn.offcanvas');
|
|
115
|
+
$off_canvas.addClass(class_name);
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
hide : function (class_name, $off_canvas) {
|
|
119
|
+
$off_canvas = $off_canvas || this.get_wrapper();
|
|
120
|
+
$off_canvas.trigger('close.fndtn.offcanvas');
|
|
121
|
+
$off_canvas.removeClass(class_name);
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
click_toggle_class : function (e, class_name) {
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
var $off_canvas = this.get_wrapper(e);
|
|
127
|
+
this.toggle(class_name, $off_canvas);
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
click_remove_class : function (e, class_name) {
|
|
131
|
+
e.preventDefault();
|
|
132
|
+
var $off_canvas = this.get_wrapper(e);
|
|
133
|
+
this.hide(class_name, $off_canvas);
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
get_settings : function (e) {
|
|
137
|
+
var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']');
|
|
138
|
+
return offcanvas.data(this.attr_name(true) + '-init') || this.settings;
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
get_wrapper : function (e) {
|
|
142
|
+
var $off_canvas = this.S(e ? e.target : this.scope).closest('.off-canvas-wrap');
|
|
143
|
+
|
|
144
|
+
if ($off_canvas.length === 0) {
|
|
145
|
+
$off_canvas = this.S('.off-canvas-wrap');
|
|
146
|
+
}
|
|
147
|
+
return $off_canvas;
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
reflow : function () {}
|
|
151
|
+
};
|
|
152
|
+
}(jQuery, window, window.document));
|