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.
- checksums.yaml +4 -4
- data/README.md +0 -4
- data/app/assets/js/va_common_main.js +16 -1
- data/lib/va_common/version.rb +1 -1
- data/lib/va_common.rb +4 -0
- data/va_common.gemspec +15 -0
- metadata +200 -177
- data/app/assets/js/foundation/foundation.abide.js +0 -408
- data/app/assets/js/foundation/foundation.accordion.js +0 -88
- data/app/assets/js/foundation/foundation.alert.js +0 -43
- data/app/assets/js/foundation/foundation.clearing.js +0 -586
- data/app/assets/js/foundation/foundation.dropdown.js +0 -463
- data/app/assets/js/foundation/foundation.equalizer.js +0 -104
- data/app/assets/js/foundation/foundation.interchange.js +0 -359
- data/app/assets/js/foundation/foundation.joyride.js +0 -932
- data/app/assets/js/foundation/foundation.js +0 -725
- data/app/assets/js/foundation/foundation.magellan.js +0 -215
- data/app/assets/js/foundation/foundation.offcanvas.js +0 -152
- data/app/assets/js/foundation/foundation.orbit.js +0 -476
- data/app/assets/js/foundation/foundation.reveal.js +0 -498
- data/app/assets/js/foundation/foundation.slider.js +0 -281
- data/app/assets/js/foundation/foundation.tab.js +0 -249
- data/app/assets/js/foundation/foundation.tooltip.js +0 -339
- data/app/assets/js/foundation/foundation.topbar.js +0 -458
- data/app/assets/js/foundation.min.js +0 -6376
- data/app/assets/js/vendor/html5shiv.js +0 -8
- data/app/assets/js/vendor/jquery-1.11.0.min.js +0 -4
- data/app/assets/js/vendor/jquery.js +0 -9789
- data/app/assets/js/vendor/jquery.smooth-scroll.js +0 -255
- data/app/assets/js/vendor/jquery.stellar.js +0 -651
- data/app/assets/js/vendor/jquery.tipsy.js +0 -258
- data/app/assets/js/vendor/menu.js +0 -40
- data/app/assets/js/vendor/modernizr.custom.js +0 -4
- data/app/assets/js/vendor/respond.min.js +0 -6
- data/app/assets/js/vendor/selectivizr-1.0.3b.js +0 -560
- data/app/assets/js/vendor/tota11y.min.js +0 -28
- data/app/assets/js/vendor/wow.min.js +0 -2
- data/app/assets/stylesheets/foundation/_functions.scss +0 -146
- data/app/assets/stylesheets/foundation/_settings.scss +0 -1467
- data/app/assets/stylesheets/foundation/_variables.scss +0 -1286
- data/app/assets/stylesheets/foundation/components/_accordion.scss +0 -157
- data/app/assets/stylesheets/foundation/components/_alert-boxes.scss +0 -128
- data/app/assets/stylesheets/foundation/components/_block-grid.scss +0 -132
- data/app/assets/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
- data/app/assets/stylesheets/foundation/components/_button-groups.scss +0 -200
- data/app/assets/stylesheets/foundation/components/_buttons.scss +0 -259
- data/app/assets/stylesheets/foundation/components/_clearing.scss +0 -256
- data/app/assets/stylesheets/foundation/components/_dropdown-buttons.scss +0 -131
- data/app/assets/stylesheets/foundation/components/_dropdown.scss +0 -262
- data/app/assets/stylesheets/foundation/components/_flex-video.scss +0 -51
- data/app/assets/stylesheets/foundation/components/_forms.scss +0 -570
- data/app/assets/stylesheets/foundation/components/_global.scss +0 -481
- data/app/assets/stylesheets/foundation/components/_grid.scss +0 -289
- data/app/assets/stylesheets/foundation/components/_icon-bar.scss +0 -358
- data/app/assets/stylesheets/foundation/components/_inline-lists.scss +0 -57
- data/app/assets/stylesheets/foundation/components/_joyride.scss +0 -222
- data/app/assets/stylesheets/foundation/components/_keystrokes.scss +0 -61
- data/app/assets/stylesheets/foundation/components/_labels.scss +0 -106
- data/app/assets/stylesheets/foundation/components/_magellan.scss +0 -34
- data/app/assets/stylesheets/foundation/components/_offcanvas.scss +0 -515
- data/app/assets/stylesheets/foundation/components/_orbit.scss +0 -368
- data/app/assets/stylesheets/foundation/components/_pagination.scss +0 -162
- data/app/assets/stylesheets/foundation/components/_panels.scss +0 -101
- data/app/assets/stylesheets/foundation/components/_pricing-tables.scss +0 -150
- data/app/assets/stylesheets/foundation/components/_progress-bars.scss +0 -79
- data/app/assets/stylesheets/foundation/components/_range-slider.scss +0 -169
- data/app/assets/stylesheets/foundation/components/_reveal.scss +0 -202
- data/app/assets/stylesheets/foundation/components/_side-nav.scss +0 -116
- data/app/assets/stylesheets/foundation/components/_split-buttons.scss +0 -199
- data/app/assets/stylesheets/foundation/components/_sub-nav.scss +0 -123
- data/app/assets/stylesheets/foundation/components/_switches.scss +0 -238
- data/app/assets/stylesheets/foundation/components/_tables.scss +0 -135
- data/app/assets/stylesheets/foundation/components/_tabs.scss +0 -123
- data/app/assets/stylesheets/foundation/components/_thumbs.scss +0 -66
- data/app/assets/stylesheets/foundation/components/_toolbar.scss +0 -70
- data/app/assets/stylesheets/foundation/components/_tooltips.scss +0 -142
- data/app/assets/stylesheets/foundation/components/_top-bar.scss +0 -691
- data/app/assets/stylesheets/foundation/components/_type.scss +0 -525
- data/app/assets/stylesheets/foundation/components/_visibility.scss +0 -408
- data/app/assets/stylesheets/lib/_normalize.scss +0 -427
- data/app/assets/stylesheets/lib/bourbon/_bourbon-deprecated-upcoming.scss +0 -411
- data/app/assets/stylesheets/lib/bourbon/_bourbon.scss +0 -87
- data/app/assets/stylesheets/lib/bourbon/addons/_border-color.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/addons/_border-radius.scss +0 -48
- data/app/assets/stylesheets/lib/bourbon/addons/_border-style.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/addons/_border-width.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/addons/_buttons.scss +0 -64
- data/app/assets/stylesheets/lib/bourbon/addons/_clearfix.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/addons/_ellipsis.scss +0 -30
- data/app/assets/stylesheets/lib/bourbon/addons/_font-stacks.scss +0 -31
- data/app/assets/stylesheets/lib/bourbon/addons/_hide-text.scss +0 -27
- data/app/assets/stylesheets/lib/bourbon/addons/_margin.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/addons/_padding.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/addons/_position.scss +0 -48
- data/app/assets/stylesheets/lib/bourbon/addons/_prefixer.scss +0 -66
- data/app/assets/stylesheets/lib/bourbon/addons/_retina-image.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/addons/_size.scss +0 -51
- data/app/assets/stylesheets/lib/bourbon/addons/_text-inputs.scss +0 -112
- data/app/assets/stylesheets/lib/bourbon/addons/_timing-functions.scss +0 -34
- data/app/assets/stylesheets/lib/bourbon/addons/_triangle.scss +0 -63
- data/app/assets/stylesheets/lib/bourbon/addons/_word-wrap.scss +0 -29
- data/app/assets/stylesheets/lib/bourbon/css3/_animation.scss +0 -43
- data/app/assets/stylesheets/lib/bourbon/css3/_appearance.scss +0 -3
- data/app/assets/stylesheets/lib/bourbon/css3/_backface-visibility.scss +0 -3
- data/app/assets/stylesheets/lib/bourbon/css3/_background-image.scss +0 -42
- data/app/assets/stylesheets/lib/bourbon/css3/_background.scss +0 -55
- data/app/assets/stylesheets/lib/bourbon/css3/_border-image.scss +0 -59
- data/app/assets/stylesheets/lib/bourbon/css3/_calc.scss +0 -4
- data/app/assets/stylesheets/lib/bourbon/css3/_columns.scss +0 -47
- data/app/assets/stylesheets/lib/bourbon/css3/_filter.scss +0 -4
- data/app/assets/stylesheets/lib/bourbon/css3/_flex-box.scss +0 -287
- data/app/assets/stylesheets/lib/bourbon/css3/_font-face.scss +0 -24
- data/app/assets/stylesheets/lib/bourbon/css3/_font-feature-settings.scss +0 -4
- data/app/assets/stylesheets/lib/bourbon/css3/_hidpi-media-query.scss +0 -10
- data/app/assets/stylesheets/lib/bourbon/css3/_hyphens.scss +0 -4
- data/app/assets/stylesheets/lib/bourbon/css3/_image-rendering.scss +0 -14
- data/app/assets/stylesheets/lib/bourbon/css3/_keyframes.scss +0 -36
- data/app/assets/stylesheets/lib/bourbon/css3/_linear-gradient.scss +0 -38
- data/app/assets/stylesheets/lib/bourbon/css3/_perspective.scss +0 -8
- data/app/assets/stylesheets/lib/bourbon/css3/_placeholder.scss +0 -8
- data/app/assets/stylesheets/lib/bourbon/css3/_radial-gradient.scss +0 -39
- data/app/assets/stylesheets/lib/bourbon/css3/_selection.scss +0 -42
- data/app/assets/stylesheets/lib/bourbon/css3/_text-decoration.scss +0 -19
- data/app/assets/stylesheets/lib/bourbon/css3/_transform.scss +0 -15
- data/app/assets/stylesheets/lib/bourbon/css3/_transition.scss +0 -71
- data/app/assets/stylesheets/lib/bourbon/css3/_user-select.scss +0 -3
- data/app/assets/stylesheets/lib/bourbon/functions/_assign-inputs.scss +0 -11
- data/app/assets/stylesheets/lib/bourbon/functions/_contains-falsy.scss +0 -20
- data/app/assets/stylesheets/lib/bourbon/functions/_contains.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/functions/_is-length.scss +0 -11
- data/app/assets/stylesheets/lib/bourbon/functions/_is-light.scss +0 -21
- data/app/assets/stylesheets/lib/bourbon/functions/_is-number.scss +0 -11
- data/app/assets/stylesheets/lib/bourbon/functions/_is-size.scss +0 -13
- data/app/assets/stylesheets/lib/bourbon/functions/_modular-scale.scss +0 -69
- data/app/assets/stylesheets/lib/bourbon/functions/_px-to-em.scss +0 -13
- data/app/assets/stylesheets/lib/bourbon/functions/_px-to-rem.scss +0 -15
- data/app/assets/stylesheets/lib/bourbon/functions/_shade.scss +0 -24
- data/app/assets/stylesheets/lib/bourbon/functions/_strip-units.scss +0 -17
- data/app/assets/stylesheets/lib/bourbon/functions/_tint.scss +0 -24
- data/app/assets/stylesheets/lib/bourbon/functions/_transition-property-name.scss +0 -22
- data/app/assets/stylesheets/lib/bourbon/functions/_unpack.scss +0 -27
- data/app/assets/stylesheets/lib/bourbon/helpers/_convert-units.scss +0 -21
- data/app/assets/stylesheets/lib/bourbon/helpers/_directional-values.scss +0 -96
- data/app/assets/stylesheets/lib/bourbon/helpers/_font-source-declaration.scss +0 -43
- data/app/assets/stylesheets/lib/bourbon/helpers/_gradient-positions-parser.scss +0 -13
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-angle-parser.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-gradient-parser.scss +0 -41
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-positions-parser.scss +0 -61
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-side-corner-parser.scss +0 -31
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-arg-parser.scss +0 -69
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-gradient-parser.scss +0 -50
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-positions-parser.scss +0 -18
- data/app/assets/stylesheets/lib/bourbon/helpers/_render-gradients.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/helpers/_shape-size-stripper.scss +0 -10
- data/app/assets/stylesheets/lib/bourbon/helpers/_str-to-num.scss +0 -50
- data/app/assets/stylesheets/lib/bourbon/settings/_asset-pipeline.scss +0 -7
- data/app/assets/stylesheets/lib/bourbon/settings/_prefixer.scss +0 -9
- data/app/assets/stylesheets/lib/bourbon/settings/_px-to-em.scss +0 -1
- data/app/assets/stylesheets/lib/neat/_neat-helpers.scss +0 -8
- data/app/assets/stylesheets/lib/neat/_neat.scss +0 -23
- data/app/assets/stylesheets/lib/neat/functions/_new-breakpoint.scss +0 -49
- data/app/assets/stylesheets/lib/neat/functions/_private.scss +0 -114
- data/app/assets/stylesheets/lib/neat/grid/_box-sizing.scss +0 -15
- data/app/assets/stylesheets/lib/neat/grid/_direction-context.scss +0 -33
- data/app/assets/stylesheets/lib/neat/grid/_display-context.scss +0 -28
- data/app/assets/stylesheets/lib/neat/grid/_fill-parent.scss +0 -22
- data/app/assets/stylesheets/lib/neat/grid/_media.scss +0 -92
- data/app/assets/stylesheets/lib/neat/grid/_omega.scss +0 -87
- data/app/assets/stylesheets/lib/neat/grid/_outer-container.scss +0 -38
- data/app/assets/stylesheets/lib/neat/grid/_pad.scss +0 -25
- data/app/assets/stylesheets/lib/neat/grid/_private.scss +0 -35
- data/app/assets/stylesheets/lib/neat/grid/_row.scss +0 -52
- data/app/assets/stylesheets/lib/neat/grid/_shift.scss +0 -50
- data/app/assets/stylesheets/lib/neat/grid/_span-columns.scss +0 -94
- data/app/assets/stylesheets/lib/neat/grid/_to-deprecate.scss +0 -97
- data/app/assets/stylesheets/lib/neat/grid/_visual-grid.scss +0 -42
- data/app/assets/stylesheets/lib/neat/settings/_disable-warnings.scss +0 -13
- data/app/assets/stylesheets/lib/neat/settings/_grid.scss +0 -51
- data/app/assets/stylesheets/lib/neat/settings/_visual-grid.scss +0 -27
- data/app/assets/stylesheets/va_common_main.css.scss +0 -18
- /data/app/assets/js/{vendor/scroll-settings.js → scroll-settings.js} +0 -0
- /data/app/assets/js/{vendor/stellar-settings.js → stellar-settings.js} +0 -0
@@ -1,215 +0,0 @@
|
|
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));
|
@@ -1,152 +0,0 @@
|
|
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));
|