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,458 +0,0 @@
|
|
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('« ' + $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));
|