locomotivecms_wagon 2.2.0.beta1 → 2.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/generators/blank/config/metafields_schema.yml +1 -1
- data/generators/bootstrap/config/metafields_schema.yml +1 -1
- data/generators/{foundation5 → foundation}/Gemfile.tt +1 -1
- data/generators/{foundation5 → foundation}/Guardfile +0 -0
- data/generators/foundation/app/content_types/.gitkeep +0 -0
- data/generators/foundation/app/views/pages/404.liquid +11 -0
- data/generators/{foundation5 → foundation}/app/views/pages/404.liquid.haml +4 -3
- data/generators/{foundation5 → foundation}/app/views/pages/index.liquid +54 -78
- data/generators/foundation/app/views/pages/index.liquid.haml +144 -0
- data/generators/foundation/app/views/snippets/.gitkeep +0 -0
- data/generators/{foundation5 → foundation}/config/deploy.yml +2 -1
- data/generators/{foundation5 → foundation}/config/metafields_schema.yml +1 -1
- data/generators/{foundation5/config/site.yml.tt → foundation/config/site.yml} +2 -2
- data/generators/{foundation5 → foundation}/config/translations.yml +0 -0
- data/generators/foundation/data/.gitkeep +0 -0
- data/generators/foundation/log/.gitkeep +0 -0
- data/generators/foundation/public/images/.gitkeep +0 -0
- data/generators/foundation/public/javascripts/app.js +1 -0
- data/generators/foundation/public/javascripts/vendor/foundation.js +7472 -0
- data/generators/foundation/public/javascripts/vendor/foundation.min.js +3 -0
- data/generators/foundation/public/javascripts/vendor/what-input.js +212 -0
- data/generators/foundation/public/javascripts/vendor/what-input.min.js +1 -0
- data/generators/foundation/public/stylesheets/_settings.scss +529 -0
- data/generators/foundation/public/stylesheets/app.css +3 -0
- data/generators/foundation/public/stylesheets/app.scss +43 -0
- data/generators/foundation/public/stylesheets/foundation.css +3499 -0
- data/generators/foundation/public/stylesheets/foundation6/_global.scss +197 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_accordion-menu.scss +28 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_accordion.scss +112 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_badge.scss +55 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_breadcrumbs.scss +94 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_button-group.scss +115 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_button.scss +264 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_callout.scss +115 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_close-button.scss +61 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_drilldown.scss +67 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_dropdown-menu.scss +123 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_dropdown.scss +64 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_flex-video.scss +68 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_float.scss +27 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_label.scss +56 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_media-object.scss +74 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_menu.scss +213 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_off-canvas.scss +170 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_orbit.scss +186 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_pagination.scss +161 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_progress-bar.scss +83 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_reveal.scss +155 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_slider.scss +158 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_sticky.scss +38 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_switch.scss +231 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_table.scss +212 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_tabs.scss +137 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_thumbnail.scss +54 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_title-bar.scss +44 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_tooltip.scss +110 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_top-bar.scss +57 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_visibility.scss +131 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_checkbox.scss +36 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_error.scss +81 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_fieldset.scss +53 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_forms.scss +32 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_help-text.scss +30 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_input-group.scss +70 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_label.scss +48 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_select.scss +64 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_text.scss +153 -0
- data/generators/foundation/public/stylesheets/foundation6/foundation.scss +91 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_classes.scss +132 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_column.scss +112 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_flex-grid.scss +191 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_grid.scss +33 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_gutter.scss +31 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_layout.scss +32 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_position.scss +71 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_row.scss +72 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_size.scss +24 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/_classes.scss +102 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/_settings.scss +61 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_fade.scss +29 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_hinge.scss +65 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_shake.scss +15 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_slide.scss +41 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_spin.scss +28 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_wiggle.scss +13 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_zoom.scss +15 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/motion-ui.scss +29 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_fade.scss +28 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_hinge.scss +43 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_slide.scss +42 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_spin.scss +39 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_zoom.scss +39 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_animation.scss +7 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_args.scss +15 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_keyframe.scss +136 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_selector.scss +23 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_series.scss +54 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_transition.scss +45 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_unit.scss +7 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui.scss +4 -0
- data/generators/foundation/public/stylesheets/foundation6/settings/_settings.scss +531 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_alignment.scss +21 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_base.scss +436 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_helpers.scss +77 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_print.scss +73 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_typography.scss +28 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_breakpoint.scss +182 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_color.scss +41 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_mixins.scss +190 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_selector.scss +39 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_unit.scss +69 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_util.scss +15 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_value.scss +117 -0
- data/generators/{foundation5/public/stylesheets/normalize.css.scss → foundation/public/stylesheets/foundation6/vendor/normalize.scss} +8 -11
- data/generators/site_metafields/schema.yml.tt +1 -1
- data/lib/locomotive/wagon/commands/push_command.rb +1 -0
- data/lib/locomotive/wagon/commands/serve_command.rb +1 -0
- data/lib/locomotive/wagon/decorators/concerns/persist_assets_concern.rb +3 -3
- data/lib/locomotive/wagon/decorators/content_type_decorator.rb +5 -1
- data/lib/locomotive/wagon/generators/site/{foundation5.rb → foundation.rb} +8 -12
- data/lib/locomotive/wagon/generators/site.rb +1 -1
- data/lib/locomotive/wagon/version.rb +1 -1
- data/locomotivecms_wagon.gemspec +3 -2
- data/spec/fixtures/cassettes/authenticate.yml +38 -38
- data/spec/fixtures/cassettes/delete.yml +211 -211
- data/spec/fixtures/cassettes/push.yml +1333 -1374
- data/spec/integration/cli_spec.rb +1 -1
- data/spec/unit/decorators/content_entry_decorator_spec.rb +23 -0
- metadata +133 -104
- data/generators/foundation5/app/content_types/.empty_directory +0 -1
- data/generators/foundation5/app/views/pages/404.liquid +0 -10
- data/generators/foundation5/app/views/pages/index.liquid.haml +0 -157
- data/generators/foundation5/data/.empty_directory +0 -1
- data/generators/foundation5/icon.png +0 -0
- data/generators/foundation5/public/fonts/.empty_directory +0 -1
- data/generators/foundation5/public/images/.empty_directory +0 -1
- data/generators/foundation5/public/javascripts/foundation/foundation.abide.js +0 -299
- data/generators/foundation5/public/javascripts/foundation/foundation.accordion.js +0 -59
- data/generators/foundation5/public/javascripts/foundation/foundation.alert.js +0 -43
- data/generators/foundation5/public/javascripts/foundation/foundation.clearing.js +0 -534
- data/generators/foundation5/public/javascripts/foundation/foundation.dropdown.js +0 -311
- data/generators/foundation5/public/javascripts/foundation/foundation.equalizer.js +0 -74
- data/generators/foundation5/public/javascripts/foundation/foundation.interchange.js +0 -331
- data/generators/foundation5/public/javascripts/foundation/foundation.joyride.js +0 -843
- data/generators/foundation5/public/javascripts/foundation/foundation.js +0 -611
- data/generators/foundation5/public/javascripts/foundation/foundation.magellan.js +0 -178
- data/generators/foundation5/public/javascripts/foundation/foundation.offcanvas.js +0 -108
- data/generators/foundation5/public/javascripts/foundation/foundation.orbit.js +0 -610
- data/generators/foundation5/public/javascripts/foundation/foundation.reveal.js +0 -437
- data/generators/foundation5/public/javascripts/foundation/foundation.slider.js +0 -199
- data/generators/foundation5/public/javascripts/foundation/foundation.tab.js +0 -167
- data/generators/foundation5/public/javascripts/foundation/foundation.tooltip.js +0 -298
- data/generators/foundation5/public/javascripts/foundation/foundation.topbar.js +0 -425
- data/generators/foundation5/public/javascripts/foundation.js +0 -4161
- data/generators/foundation5/public/javascripts/foundation.min.js +0 -10
- data/generators/foundation5/public/javascripts/vendor/custom.modernizr.js +0 -4
- data/generators/foundation5/public/javascripts/vendor/custom.modernizr.min.js +0 -1
- data/generators/foundation5/public/javascripts/vendor/fastclick.js +0 -9
- data/generators/foundation5/public/javascripts/vendor/fastclick.min.js +0 -11
- data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.js +0 -645
- data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.min.js +0 -1
- data/generators/foundation5/public/javascripts/vendor/jquery.cookie.js +0 -8
- data/generators/foundation5/public/javascripts/vendor/jquery.cookie.min.js +0 -8
- data/generators/foundation5/public/javascripts/vendor/jquery.js +0 -26
- data/generators/foundation5/public/javascripts/vendor/jquery.min.js +0 -27
- data/generators/foundation5/public/javascripts/vendor/modernizr.js +0 -8
- data/generators/foundation5/public/javascripts/vendor/modernizr.min.js +0 -1
- data/generators/foundation5/public/javascripts/vendor/placeholder.js +0 -2
- data/generators/foundation5/public/javascripts/vendor/placeholder.min.js +0 -1
- data/generators/foundation5/public/samples/.empty_directory +0 -1
- data/generators/foundation5/public/stylesheets/application.css +0 -2
- data/generators/foundation5/public/stylesheets/application.css.scss +0 -3
- data/generators/foundation5/public/stylesheets/foundation/_functions.scss +0 -102
- data/generators/foundation5/public/stylesheets/foundation/_settings.scss +0 -1441
- data/generators/foundation5/public/stylesheets/foundation/components/_accordion.scss +0 -157
- data/generators/foundation5/public/stylesheets/foundation/components/_alert-boxes.scss +0 -128
- data/generators/foundation5/public/stylesheets/foundation/components/_block-grid.scss +0 -132
- data/generators/foundation5/public/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
- data/generators/foundation5/public/stylesheets/foundation/components/_button-groups.scss +0 -197
- data/generators/foundation5/public/stylesheets/foundation/components/_buttons.scss +0 -259
- data/generators/foundation5/public/stylesheets/foundation/components/_clearing.scss +0 -247
- data/generators/foundation5/public/stylesheets/foundation/components/_dropdown-buttons.scss +0 -130
- data/generators/foundation5/public/stylesheets/foundation/components/_dropdown.scss +0 -262
- data/generators/foundation5/public/stylesheets/foundation/components/_flex-video.scss +0 -51
- data/generators/foundation5/public/stylesheets/foundation/components/_forms.scss +0 -585
- data/generators/foundation5/public/stylesheets/foundation/components/_global.scss +0 -460
- data/generators/foundation5/public/stylesheets/foundation/components/_grid.scss +0 -275
- data/generators/foundation5/public/stylesheets/foundation/components/_icon-bar.scss +0 -293
- data/generators/foundation5/public/stylesheets/foundation/components/_inline-lists.scss +0 -57
- data/generators/foundation5/public/stylesheets/foundation/components/_joyride.scss +0 -222
- data/generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss +0 -61
- data/generators/foundation5/public/stylesheets/foundation/components/_labels.scss +0 -106
- data/generators/foundation5/public/stylesheets/foundation/components/_magellan.scss +0 -34
- data/generators/foundation5/public/stylesheets/foundation/components/_offcanvas.scss +0 -513
- data/generators/foundation5/public/stylesheets/foundation/components/_orbit.scss +0 -368
- data/generators/foundation5/public/stylesheets/foundation/components/_pagination.scss +0 -162
- data/generators/foundation5/public/stylesheets/foundation/components/_panels.scss +0 -95
- data/generators/foundation5/public/stylesheets/foundation/components/_pricing-tables.scss +0 -150
- data/generators/foundation5/public/stylesheets/foundation/components/_progress-bars.scss +0 -79
- data/generators/foundation5/public/stylesheets/foundation/components/_range-slider.scss +0 -168
- data/generators/foundation5/public/stylesheets/foundation/components/_reveal.scss +0 -222
- data/generators/foundation5/public/stylesheets/foundation/components/_side-nav.scss +0 -116
- data/generators/foundation5/public/stylesheets/foundation/components/_split-buttons.scss +0 -191
- data/generators/foundation5/public/stylesheets/foundation/components/_sub-nav.scss +0 -123
- data/generators/foundation5/public/stylesheets/foundation/components/_switches.scss +0 -230
- data/generators/foundation5/public/stylesheets/foundation/components/_tables.scss +0 -135
- data/generators/foundation5/public/stylesheets/foundation/components/_tabs.scss +0 -123
- data/generators/foundation5/public/stylesheets/foundation/components/_thumbs.scss +0 -66
- data/generators/foundation5/public/stylesheets/foundation/components/_toolbar.scss +0 -70
- data/generators/foundation5/public/stylesheets/foundation/components/_tooltips.scss +0 -142
- data/generators/foundation5/public/stylesheets/foundation/components/_top-bar.scss +0 -685
- data/generators/foundation5/public/stylesheets/foundation/components/_type.scss +0 -525
- data/generators/foundation5/public/stylesheets/foundation/components/_visibility.scss +0 -408
- data/generators/foundation5/public/stylesheets/foundation.css +0 -6138
- data/generators/foundation5/public/stylesheets/foundation.css.scss +0 -45
- data/generators/foundation5/public/stylesheets/normalize.css +0 -357
- data/lib/locomotive/wagon/generators/site/foundation4.rb +0 -34
@@ -1,178 +0,0 @@
|
|
1
|
-
;(function ($, window, document, undefined) {
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
Foundation.libs['magellan-expedition'] = {
|
5
|
-
name : 'magellan-expedition',
|
6
|
-
|
7
|
-
version : '5.2.3',
|
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
|
-
},
|
16
|
-
|
17
|
-
init : function (scope, method, options) {
|
18
|
-
Foundation.inherit(this, 'throttle');
|
19
|
-
this.bindings(method, options);
|
20
|
-
},
|
21
|
-
|
22
|
-
events : function () {
|
23
|
-
var self = this,
|
24
|
-
S = self.S,
|
25
|
-
settings = self.settings;
|
26
|
-
|
27
|
-
// initialize expedition offset
|
28
|
-
self.set_expedition_position();
|
29
|
-
|
30
|
-
S(self.scope)
|
31
|
-
.off('.magellan')
|
32
|
-
.on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href^="#"]', function (e) {
|
33
|
-
e.preventDefault();
|
34
|
-
var expedition = $(this).closest('[' + self.attr_name() + ']'),
|
35
|
-
settings = expedition.data('magellan-expedition-init'),
|
36
|
-
hash = this.hash.split('#').join(''),
|
37
|
-
target = $("a[name='"+hash+"']");
|
38
|
-
|
39
|
-
if (target.length === 0) {
|
40
|
-
target = $('#'+hash);
|
41
|
-
}
|
42
|
-
|
43
|
-
// Account for expedition height if fixed position
|
44
|
-
var scroll_top = target.offset().top;
|
45
|
-
scroll_top = scroll_top - expedition.outerHeight();
|
46
|
-
|
47
|
-
$('html, body').stop().animate({
|
48
|
-
'scrollTop': scroll_top
|
49
|
-
}, 700, 'swing', function () {
|
50
|
-
if(history.pushState) {
|
51
|
-
history.pushState(null, null, '#'+hash);
|
52
|
-
}
|
53
|
-
else {
|
54
|
-
location.hash = '#'+hash;
|
55
|
-
}
|
56
|
-
});
|
57
|
-
})
|
58
|
-
.on('scroll.fndtn.magellan', self.throttle(this.check_for_arrivals.bind(this), settings.throttle_delay));
|
59
|
-
|
60
|
-
$(window)
|
61
|
-
.on('resize.fndtn.magellan', self.throttle(this.set_expedition_position.bind(this), settings.throttle_delay));
|
62
|
-
},
|
63
|
-
|
64
|
-
check_for_arrivals : function() {
|
65
|
-
var self = this;
|
66
|
-
self.update_arrivals();
|
67
|
-
self.update_expedition_positions();
|
68
|
-
},
|
69
|
-
|
70
|
-
set_expedition_position : function() {
|
71
|
-
var self = this;
|
72
|
-
$('[' + this.attr_name() + '=fixed]', self.scope).each(function(idx, el) {
|
73
|
-
var expedition = $(this),
|
74
|
-
styles = expedition.attr('styles'), // save styles
|
75
|
-
top_offset;
|
76
|
-
|
77
|
-
expedition.attr('style', '');
|
78
|
-
top_offset = expedition.offset().top + self.settings.threshold;
|
79
|
-
|
80
|
-
expedition.data(self.data_attr('magellan-top-offset'), top_offset);
|
81
|
-
expedition.attr('style', styles);
|
82
|
-
});
|
83
|
-
},
|
84
|
-
|
85
|
-
update_expedition_positions : function() {
|
86
|
-
var self = this,
|
87
|
-
window_top_offset = $(window).scrollTop();
|
88
|
-
|
89
|
-
$('[' + this.attr_name() + '=fixed]', self.scope).each(function() {
|
90
|
-
var expedition = $(this),
|
91
|
-
top_offset = expedition.data('magellan-top-offset');
|
92
|
-
|
93
|
-
if (window_top_offset >= top_offset) {
|
94
|
-
// Placeholder allows height calculations to be consistent even when
|
95
|
-
// appearing to switch between fixed/non-fixed placement
|
96
|
-
var placeholder = expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']');
|
97
|
-
if (placeholder.length === 0) {
|
98
|
-
placeholder = expedition.clone();
|
99
|
-
placeholder.removeAttr(self.attr_name());
|
100
|
-
placeholder.attr(self.add_namespace('data-magellan-expedition-clone'),'');
|
101
|
-
expedition.before(placeholder);
|
102
|
-
}
|
103
|
-
expedition.css({position:'fixed', top: self.settings.fixed_top});
|
104
|
-
} else {
|
105
|
-
expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']').remove();
|
106
|
-
expedition.attr('style','').removeClass('fixed');
|
107
|
-
}
|
108
|
-
});
|
109
|
-
},
|
110
|
-
|
111
|
-
update_arrivals : function() {
|
112
|
-
var self = this,
|
113
|
-
window_top_offset = $(window).scrollTop();
|
114
|
-
|
115
|
-
$('[' + this.attr_name() + ']', self.scope).each(function() {
|
116
|
-
var expedition = $(this),
|
117
|
-
settings = expedition.data(self.attr_name(true) + '-init'),
|
118
|
-
offsets = self.offsets(expedition, window_top_offset),
|
119
|
-
arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'),
|
120
|
-
active_item = false;
|
121
|
-
offsets.each(function(idx, item) {
|
122
|
-
if (item.viewport_offset >= item.top_offset) {
|
123
|
-
var arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']');
|
124
|
-
arrivals.not(item.arrival).removeClass(settings.active_class);
|
125
|
-
item.arrival.addClass(settings.active_class);
|
126
|
-
active_item = true;
|
127
|
-
return true;
|
128
|
-
}
|
129
|
-
});
|
130
|
-
|
131
|
-
if (!active_item) arrivals.removeClass(settings.active_class);
|
132
|
-
});
|
133
|
-
},
|
134
|
-
|
135
|
-
offsets : function(expedition, window_offset) {
|
136
|
-
var self = this,
|
137
|
-
settings = expedition.data(self.attr_name(true) + '-init'),
|
138
|
-
viewport_offset = window_offset;
|
139
|
-
|
140
|
-
return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function(idx, el) {
|
141
|
-
var name = $(this).data(self.data_attr('magellan-arrival')),
|
142
|
-
dest = $('[' + self.add_namespace('data-magellan-destination') + '=' + name + ']');
|
143
|
-
if (dest.length > 0) {
|
144
|
-
var top_offset = dest.offset().top - settings.destination_threshold - expedition.outerHeight();
|
145
|
-
return {
|
146
|
-
destination : dest,
|
147
|
-
arrival : $(this),
|
148
|
-
top_offset : top_offset,
|
149
|
-
viewport_offset : viewport_offset
|
150
|
-
}
|
151
|
-
}
|
152
|
-
}).sort(function(a, b) {
|
153
|
-
if (a.top_offset < b.top_offset) return -1;
|
154
|
-
if (a.top_offset > b.top_offset) return 1;
|
155
|
-
return 0;
|
156
|
-
});
|
157
|
-
},
|
158
|
-
|
159
|
-
data_attr: function (str) {
|
160
|
-
if (this.namespace.length > 0) {
|
161
|
-
return this.namespace + '-' + str;
|
162
|
-
}
|
163
|
-
|
164
|
-
return str;
|
165
|
-
},
|
166
|
-
|
167
|
-
off : function () {
|
168
|
-
this.S(this.scope).off('.magellan');
|
169
|
-
this.S(window).off('.magellan');
|
170
|
-
},
|
171
|
-
|
172
|
-
reflow : function () {
|
173
|
-
var self = this;
|
174
|
-
// remove placeholder expeditions used for height calculation purposes
|
175
|
-
$('[' + self.add_namespace('data-magellan-expedition-clone') + ']', self.scope).remove();
|
176
|
-
}
|
177
|
-
};
|
178
|
-
}(jQuery, window, window.document));
|
@@ -1,108 +0,0 @@
|
|
1
|
-
;(function ($, window, document, undefined) {
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
Foundation.libs.offcanvas = {
|
5
|
-
name : 'offcanvas',
|
6
|
-
|
7
|
-
version : '5.2.3',
|
8
|
-
|
9
|
-
settings : {
|
10
|
-
open_method: 'move',
|
11
|
-
close_on_click: true
|
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') {
|
30
|
-
move_class = 'offcanvas-overlap';
|
31
|
-
}
|
32
|
-
|
33
|
-
S(this.scope).off('.offcanvas')
|
34
|
-
.on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) {
|
35
|
-
self.click_toggle_class(e, move_class + right_postfix);
|
36
|
-
})
|
37
|
-
.on('click.fndtn.offcanvas', '.left-off-canvas-menu a', function (e) {
|
38
|
-
var settings = self.get_settings(e);
|
39
|
-
if (settings.close_on_click) {
|
40
|
-
self.hide.call(self, move_class + right_postfix, self.get_wrapper(e));
|
41
|
-
}
|
42
|
-
})
|
43
|
-
.on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) {
|
44
|
-
self.click_toggle_class(e, move_class + left_postfix);
|
45
|
-
})
|
46
|
-
.on('click.fndtn.offcanvas', '.right-off-canvas-menu a', function (e) {
|
47
|
-
var settings = self.get_settings(e);
|
48
|
-
if (settings.close_on_click) {
|
49
|
-
self.hide.call(self, move_class + left_postfix, self.get_wrapper(e));
|
50
|
-
}
|
51
|
-
})
|
52
|
-
.on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
|
53
|
-
self.click_remove_class(e, move_class + left_postfix);
|
54
|
-
if (right_postfix) self.click_remove_class(e, move_class + right_postfix);
|
55
|
-
});
|
56
|
-
|
57
|
-
},
|
58
|
-
|
59
|
-
toggle: function(class_name, $off_canvas) {
|
60
|
-
$off_canvas = $off_canvas || this.get_wrapper();
|
61
|
-
if ($off_canvas.is('.' + class_name)) {
|
62
|
-
this.hide(class_name, $off_canvas);
|
63
|
-
} else {
|
64
|
-
this.show(class_name, $off_canvas);
|
65
|
-
}
|
66
|
-
},
|
67
|
-
|
68
|
-
show: function(class_name, $off_canvas) {
|
69
|
-
$off_canvas = $off_canvas || this.get_wrapper();
|
70
|
-
$off_canvas.trigger('open');
|
71
|
-
$off_canvas.addClass(class_name);
|
72
|
-
},
|
73
|
-
|
74
|
-
hide: function(class_name, $off_canvas) {
|
75
|
-
$off_canvas = $off_canvas || this.get_wrapper();
|
76
|
-
$off_canvas.trigger('close');
|
77
|
-
$off_canvas.removeClass(class_name);
|
78
|
-
},
|
79
|
-
|
80
|
-
click_toggle_class: function(e, class_name) {
|
81
|
-
e.preventDefault();
|
82
|
-
var $off_canvas = this.get_wrapper(e);
|
83
|
-
this.toggle(class_name, $off_canvas);
|
84
|
-
},
|
85
|
-
|
86
|
-
click_remove_class: function(e, class_name) {
|
87
|
-
e.preventDefault();
|
88
|
-
var $off_canvas = this.get_wrapper(e);
|
89
|
-
this.hide(class_name, $off_canvas);
|
90
|
-
},
|
91
|
-
|
92
|
-
get_settings: function(e) {
|
93
|
-
var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']');
|
94
|
-
return offcanvas.data(this.attr_name(true) + '-init') || this.settings;
|
95
|
-
},
|
96
|
-
|
97
|
-
get_wrapper: function(e) {
|
98
|
-
var $off_canvas = this.S(e ? e.target : this.scope).closest('.off-canvas-wrap');
|
99
|
-
|
100
|
-
if ($off_canvas.length === 0) {
|
101
|
-
$off_canvas = this.S('.off-canvas-wrap');
|
102
|
-
}
|
103
|
-
return $off_canvas;
|
104
|
-
},
|
105
|
-
|
106
|
-
reflow : function () {}
|
107
|
-
};
|
108
|
-
}(jQuery, window, window.document));
|