foundation-rails 5.5.1.2 → 5.5.2.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.
- data/bower.json +2 -2
- data/lib/foundation/rails/version.rb +1 -1
- data/vendor/assets/javascripts/foundation.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.abide.js +96 -28
- data/vendor/assets/javascripts/foundation/foundation.accordion.js +28 -7
- data/vendor/assets/javascripts/foundation/foundation.alert.js +3 -3
- data/vendor/assets/javascripts/foundation/foundation.clearing.js +50 -20
- data/vendor/assets/javascripts/foundation/foundation.dropdown.js +26 -11
- data/vendor/assets/javascripts/foundation/foundation.equalizer.js +43 -16
- data/vendor/assets/javascripts/foundation/foundation.interchange.js +19 -14
- data/vendor/assets/javascripts/foundation/foundation.joyride.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.js +51 -29
- data/vendor/assets/javascripts/foundation/foundation.magellan.js +40 -28
- data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +3 -3
- data/vendor/assets/javascripts/foundation/foundation.orbit.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.reveal.js +70 -43
- data/vendor/assets/javascripts/foundation/foundation.slider.js +23 -5
- data/vendor/assets/javascripts/foundation/foundation.tab.js +30 -18
- data/vendor/assets/javascripts/foundation/foundation.tooltip.js +47 -15
- data/vendor/assets/javascripts/foundation/foundation.topbar.js +31 -25
- data/vendor/assets/stylesheets/foundation.scss +37 -38
- data/vendor/assets/stylesheets/foundation/_functions.scss +52 -42
- data/vendor/assets/stylesheets/foundation/_settings.scss +53 -34
- data/vendor/assets/stylesheets/foundation/components/_accordion.scss +7 -7
- data/vendor/assets/stylesheets/foundation/components/_alert-boxes.scss +11 -11
- data/vendor/assets/stylesheets/foundation/components/_block-grid.scss +13 -13
- data/vendor/assets/stylesheets/foundation/components/_breadcrumbs.scss +17 -18
- data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +29 -22
- data/vendor/assets/stylesheets/foundation/components/_buttons.scss +13 -17
- data/vendor/assets/stylesheets/foundation/components/_clearing.scss +51 -47
- data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +10 -11
- data/vendor/assets/stylesheets/foundation/components/_dropdown.scss +42 -36
- data/vendor/assets/stylesheets/foundation/components/_flex-video.scss +7 -7
- data/vendor/assets/stylesheets/foundation/components/_forms.scss +82 -50
- data/vendor/assets/stylesheets/foundation/components/_global.scss +86 -64
- data/vendor/assets/stylesheets/foundation/components/_grid.scss +24 -21
- data/vendor/assets/stylesheets/foundation/components/_icon-bar.scss +335 -234
- data/vendor/assets/stylesheets/foundation/components/_inline-lists.scss +8 -8
- data/vendor/assets/stylesheets/foundation/components/_joyride.scss +40 -42
- data/vendor/assets/stylesheets/foundation/components/_keystrokes.scss +2 -3
- data/vendor/assets/stylesheets/foundation/components/_labels.scss +6 -6
- data/vendor/assets/stylesheets/foundation/components/_magellan.scss +2 -2
- data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +178 -175
- data/vendor/assets/stylesheets/foundation/components/_orbit.scss +82 -62
- data/vendor/assets/stylesheets/foundation/components/_pagination.scss +15 -15
- data/vendor/assets/stylesheets/foundation/components/_panels.scss +21 -15
- data/vendor/assets/stylesheets/foundation/components/_pricing-tables.scss +16 -16
- data/vendor/assets/stylesheets/foundation/components/_progress-bars.scss +4 -4
- data/vendor/assets/stylesheets/foundation/components/_range-slider.scss +23 -16
- data/vendor/assets/stylesheets/foundation/components/_reveal.scss +27 -27
- data/vendor/assets/stylesheets/foundation/components/_side-nav.scss +15 -11
- data/vendor/assets/stylesheets/foundation/components/_split-buttons.scss +16 -16
- data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +14 -11
- data/vendor/assets/stylesheets/foundation/components/_switches.scss +22 -19
- data/vendor/assets/stylesheets/foundation/components/_tables.scss +8 -8
- data/vendor/assets/stylesheets/foundation/components/_tabs.scss +49 -32
- data/vendor/assets/stylesheets/foundation/components/_thumbs.scss +8 -8
- data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +25 -25
- data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +163 -122
- data/vendor/assets/stylesheets/foundation/components/_type.scss +19 -19
- data/vendor/assets/stylesheets/foundation/components/_visibility.scss +23 -5
- data/vendor/assets/stylesheets/normalize.scss +8 -11
- metadata +28 -20
- checksums.yaml +0 -7
- data/vendor/assets/stylesheets/foundation/components/_toolbar.scss +0 -72
@@ -4,7 +4,7 @@
|
|
4
4
|
Foundation.libs.dropdown = {
|
5
5
|
name : 'dropdown',
|
6
6
|
|
7
|
-
version : '5.5.
|
7
|
+
version : '5.5.2',
|
8
8
|
|
9
9
|
settings : {
|
10
10
|
active_class : 'open',
|
@@ -34,7 +34,7 @@
|
|
34
34
|
var settings = S(this).data(self.attr_name(true) + '-init') || self.settings;
|
35
35
|
if (!settings.is_hover || Modernizr.touch) {
|
36
36
|
e.preventDefault();
|
37
|
-
if (S(this).parent('[data-reveal-id]')) {
|
37
|
+
if (S(this).parent('[data-reveal-id]').length) {
|
38
38
|
e.stopPropagation();
|
39
39
|
}
|
40
40
|
self.toggle($(this));
|
@@ -131,8 +131,8 @@
|
|
131
131
|
|
132
132
|
close : function (dropdown) {
|
133
133
|
var self = this;
|
134
|
-
dropdown.each(function () {
|
135
|
-
var original_target = $('[' + self.attr_name() + '=' + dropdown[
|
134
|
+
dropdown.each(function (idx) {
|
135
|
+
var original_target = $('[' + self.attr_name() + '=' + dropdown[idx].id + ']') || $('aria-controls=' + dropdown[idx].id + ']');
|
136
136
|
original_target.attr('aria-expanded', 'false');
|
137
137
|
if (self.S(this).hasClass(self.settings.active_class)) {
|
138
138
|
self.S(this)
|
@@ -143,7 +143,7 @@
|
|
143
143
|
.removeClass(self.settings.active_class)
|
144
144
|
.removeData('target');
|
145
145
|
|
146
|
-
self.S(this).trigger('closed
|
146
|
+
self.S(this).trigger('closed.fndtn.dropdown', [dropdown]);
|
147
147
|
}
|
148
148
|
});
|
149
149
|
dropdown.removeClass('f-open-' + this.attr_name(true));
|
@@ -161,7 +161,7 @@
|
|
161
161
|
.css(dropdown
|
162
162
|
.addClass(this.settings.active_class), target);
|
163
163
|
dropdown.prev('[' + this.attr_name() + ']').addClass(this.settings.active_class);
|
164
|
-
dropdown.data('target', target.get(0)).trigger('opened
|
164
|
+
dropdown.data('target', target.get(0)).trigger('opened.fndtn.dropdown', [dropdown, target]);
|
165
165
|
dropdown.attr('aria-hidden', 'false');
|
166
166
|
target.attr('aria-expanded', 'true');
|
167
167
|
dropdown.focus();
|
@@ -209,10 +209,13 @@
|
|
209
209
|
|
210
210
|
css : function (dropdown, target) {
|
211
211
|
var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8),
|
212
|
-
settings = target.data(this.attr_name(true) + '-init') || this.settings
|
212
|
+
settings = target.data(this.attr_name(true) + '-init') || this.settings,
|
213
|
+
parentOverflow = dropdown.parent().css('overflow-y') || dropdown.parent().css('overflow');
|
213
214
|
|
214
215
|
this.clear_idx();
|
215
216
|
|
217
|
+
|
218
|
+
|
216
219
|
if (this.small()) {
|
217
220
|
var p = this.dirs.bottom.call(dropdown, target, settings);
|
218
221
|
|
@@ -224,7 +227,19 @@
|
|
224
227
|
});
|
225
228
|
|
226
229
|
dropdown.css(Foundation.rtl ? 'right' : 'left', left_offset);
|
227
|
-
}
|
230
|
+
}
|
231
|
+
// detect if dropdown is in an overflow container
|
232
|
+
else if (parentOverflow !== 'visible') {
|
233
|
+
var offset = target[0].offsetTop + target[0].offsetHeight;
|
234
|
+
|
235
|
+
dropdown.attr('style', '').css({
|
236
|
+
position : 'absolute',
|
237
|
+
top : offset
|
238
|
+
});
|
239
|
+
|
240
|
+
dropdown.css(Foundation.rtl ? 'right' : 'left', left_offset);
|
241
|
+
}
|
242
|
+
else {
|
228
243
|
|
229
244
|
this.style(dropdown, target, settings);
|
230
245
|
}
|
@@ -263,17 +278,17 @@
|
|
263
278
|
if (document.getElementsByClassName('row')[0]) {
|
264
279
|
actualBodyWidth = document.getElementsByClassName('row')[0].clientWidth;
|
265
280
|
} else {
|
266
|
-
actualBodyWidth = window.
|
281
|
+
actualBodyWidth = window.innerWidth;
|
267
282
|
}
|
268
283
|
|
269
|
-
var actualMarginWidth = (window.
|
284
|
+
var actualMarginWidth = (window.innerWidth - actualBodyWidth) / 2;
|
270
285
|
var actualBoundary = actualBodyWidth;
|
271
286
|
|
272
287
|
if (!this.hasClass('mega')) {
|
273
288
|
//miss top
|
274
289
|
if (t.offset().top <= this.outerHeight()) {
|
275
290
|
p.missTop = true;
|
276
|
-
actualBoundary = window.
|
291
|
+
actualBoundary = window.innerWidth - actualMarginWidth;
|
277
292
|
p.leftRightFlag = true;
|
278
293
|
}
|
279
294
|
|
@@ -4,13 +4,14 @@
|
|
4
4
|
Foundation.libs.equalizer = {
|
5
5
|
name : 'equalizer',
|
6
6
|
|
7
|
-
version : '5.5.
|
7
|
+
version : '5.5.2',
|
8
8
|
|
9
9
|
settings : {
|
10
10
|
use_tallest : true,
|
11
11
|
before_height_change : $.noop,
|
12
12
|
after_height_change : $.noop,
|
13
|
-
equalize_on_stack : false
|
13
|
+
equalize_on_stack : false,
|
14
|
+
act_on_hidden_el: false
|
14
15
|
},
|
15
16
|
|
16
17
|
init : function (scope, method, options) {
|
@@ -27,28 +28,38 @@
|
|
27
28
|
|
28
29
|
equalize : function (equalizer) {
|
29
30
|
var isStacked = false,
|
30
|
-
|
31
|
-
settings = equalizer.data(this.attr_name(true)
|
31
|
+
group = equalizer.data('equalizer'),
|
32
|
+
settings = equalizer.data(this.attr_name(true)+'-init') || this.settings,
|
33
|
+
vals,
|
34
|
+
firstTopOffset;
|
32
35
|
|
36
|
+
if (settings.act_on_hidden_el) {
|
37
|
+
vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]') : equalizer.find('['+this.attr_name()+'-watch]');
|
38
|
+
}
|
39
|
+
else {
|
40
|
+
vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]:visible') : equalizer.find('['+this.attr_name()+'-watch]:visible');
|
41
|
+
}
|
42
|
+
|
33
43
|
if (vals.length === 0) {
|
34
44
|
return;
|
35
45
|
}
|
36
|
-
|
46
|
+
|
37
47
|
settings.before_height_change();
|
38
|
-
equalizer.trigger('before-height-change
|
48
|
+
equalizer.trigger('before-height-change.fndth.equalizer');
|
39
49
|
vals.height('inherit');
|
40
|
-
vals.each(function () {
|
41
|
-
var el = $(this);
|
42
|
-
if (el.offset().top !== firstTopOffset) {
|
43
|
-
isStacked = true;
|
44
|
-
}
|
45
|
-
});
|
46
50
|
|
47
51
|
if (settings.equalize_on_stack === false) {
|
52
|
+
firstTopOffset = vals.first().offset().top;
|
53
|
+
vals.each(function () {
|
54
|
+
if ($(this).offset().top !== firstTopOffset) {
|
55
|
+
isStacked = true;
|
56
|
+
return false;
|
57
|
+
}
|
58
|
+
});
|
48
59
|
if (isStacked) {
|
49
60
|
return;
|
50
61
|
}
|
51
|
-
}
|
62
|
+
}
|
52
63
|
|
53
64
|
var heights = vals.map(function () { return $(this).outerHeight(false) }).get();
|
54
65
|
|
@@ -59,17 +70,33 @@
|
|
59
70
|
var min = Math.min.apply(null, heights);
|
60
71
|
vals.css('height', min);
|
61
72
|
}
|
73
|
+
|
62
74
|
settings.after_height_change();
|
63
|
-
equalizer.trigger('after-height-change
|
75
|
+
equalizer.trigger('after-height-change.fndtn.equalizer');
|
64
76
|
},
|
65
77
|
|
66
78
|
reflow : function () {
|
67
79
|
var self = this;
|
68
80
|
|
69
81
|
this.S('[' + this.attr_name() + ']', this.scope).each(function () {
|
70
|
-
var $eq_target = $(this)
|
82
|
+
var $eq_target = $(this),
|
83
|
+
media_query = $eq_target.data('equalizer-mq'),
|
84
|
+
ignore_media_query = true;
|
85
|
+
|
86
|
+
if (media_query) {
|
87
|
+
media_query = 'is_' + media_query.replace(/-/g, '_');
|
88
|
+
if (Foundation.utils.hasOwnProperty(media_query)) {
|
89
|
+
ignore_media_query = false;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
71
93
|
self.image_loaded(self.S('img', this), function () {
|
72
|
-
|
94
|
+
if (ignore_media_query || Foundation.utils[media_query]()) {
|
95
|
+
self.equalize($eq_target)
|
96
|
+
} else {
|
97
|
+
var vals = $eq_target.find('[' + self.attr_name() + '-watch]:visible');
|
98
|
+
vals.css('height', 'auto');
|
99
|
+
}
|
73
100
|
});
|
74
101
|
});
|
75
102
|
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
Foundation.libs.interchange = {
|
5
5
|
name : 'interchange',
|
6
6
|
|
7
|
-
version : '5.5.
|
7
|
+
version : '5.5.2',
|
8
8
|
|
9
9
|
cache : {},
|
10
10
|
|
@@ -48,14 +48,14 @@
|
|
48
48
|
// console.log($(this).html(), a, b, c);
|
49
49
|
// });
|
50
50
|
|
51
|
-
if (/IMG/.test(el[0].nodeName)) {
|
51
|
+
if (el !== null && /IMG/.test(el[0].nodeName)) {
|
52
52
|
var orig_path = el[0].src;
|
53
53
|
|
54
54
|
if (new RegExp(path, 'i').test(orig_path)) {
|
55
55
|
return;
|
56
56
|
}
|
57
57
|
|
58
|
-
el
|
58
|
+
el.attr("src", path);
|
59
59
|
|
60
60
|
return trigger(el[0].src);
|
61
61
|
}
|
@@ -88,8 +88,7 @@
|
|
88
88
|
this.data_attr = this.set_data_attr();
|
89
89
|
$.extend(true, this.settings, method, options);
|
90
90
|
this.bindings(method, options);
|
91
|
-
this.
|
92
|
-
this.load('nodes');
|
91
|
+
this.reflow();
|
93
92
|
},
|
94
93
|
|
95
94
|
get_media_hash : function () {
|
@@ -127,11 +126,10 @@
|
|
127
126
|
for (var uuid in cache) {
|
128
127
|
if (cache.hasOwnProperty(uuid)) {
|
129
128
|
var passed = this.results(uuid, cache[uuid]);
|
130
|
-
|
131
129
|
if (passed) {
|
132
130
|
this.settings.directives[passed
|
133
131
|
.scenario[1]].call(this, passed.el, passed.scenario[0], (function (passed) {
|
134
|
-
if (arguments[0] instanceof Array) {
|
132
|
+
if (arguments[0] instanceof Array) {
|
135
133
|
var args = arguments[0];
|
136
134
|
} else {
|
137
135
|
var args = Array.prototype.slice.call(arguments, 0);
|
@@ -241,7 +239,7 @@
|
|
241
239
|
this.object($(this['cached_' + type][i]));
|
242
240
|
}
|
243
241
|
|
244
|
-
return $(window).trigger('resize
|
242
|
+
return $(window).trigger('resize.fndtn.interchange');
|
245
243
|
},
|
246
244
|
|
247
245
|
convert_directive : function (directive) {
|
@@ -258,19 +256,25 @@
|
|
258
256
|
parse_scenario : function (scenario) {
|
259
257
|
// This logic had to be made more complex since some users were using commas in the url path
|
260
258
|
// So we cannot simply just split on a comma
|
259
|
+
|
261
260
|
var directive_match = scenario[0].match(/(.+),\s*(\w+)\s*$/),
|
262
|
-
|
261
|
+
// getting the mq has gotten a bit complicated since we started accounting for several use cases
|
262
|
+
// of URLs. For now we'll continue to match these scenarios, but we may consider having these scenarios
|
263
|
+
// as nested objects or arrays in F6.
|
264
|
+
// regex: match everything before close parenthesis for mq
|
265
|
+
media_query = scenario[1].match(/(.*)\)/);
|
263
266
|
|
264
267
|
if (directive_match) {
|
265
268
|
var path = directive_match[1],
|
266
269
|
directive = directive_match[2];
|
270
|
+
|
267
271
|
} else {
|
268
272
|
var cached_split = scenario[0].split(/,\s*$/),
|
269
273
|
path = cached_split[0],
|
270
274
|
directive = '';
|
271
275
|
}
|
272
276
|
|
273
|
-
return [this.trim(path), this.convert_directive(directive), this.trim(media_query)];
|
277
|
+
return [this.trim(path), this.convert_directive(directive), this.trim(media_query[1])];
|
274
278
|
},
|
275
279
|
|
276
280
|
object : function (el) {
|
@@ -280,10 +284,12 @@
|
|
280
284
|
|
281
285
|
if (i > 0) {
|
282
286
|
while (i--) {
|
283
|
-
|
287
|
+
// split array between comma delimited content and mq
|
288
|
+
// regex: comma, optional space, open parenthesis
|
289
|
+
var scenario = raw_arr[i].split(/,\s?\(/);
|
284
290
|
|
285
|
-
if (
|
286
|
-
var params = this.parse_scenario(
|
291
|
+
if (scenario.length > 1) {
|
292
|
+
var params = this.parse_scenario(scenario);
|
287
293
|
scenarios.push(params);
|
288
294
|
}
|
289
295
|
}
|
@@ -301,7 +307,6 @@
|
|
301
307
|
}
|
302
308
|
|
303
309
|
el.attr(this.add_namespace('data-uuid'), uuid);
|
304
|
-
|
305
310
|
return this.cache[uuid] = scenarios;
|
306
311
|
},
|
307
312
|
|
@@ -157,42 +157,52 @@
|
|
157
157
|
}
|
158
158
|
};
|
159
159
|
|
160
|
-
|
161
|
-
https://github.com/paulirish/matchMedia.js
|
162
|
-
*/
|
160
|
+
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
|
163
161
|
|
164
|
-
window.matchMedia
|
162
|
+
window.matchMedia || (window.matchMedia = function() {
|
163
|
+
"use strict";
|
165
164
|
|
166
|
-
|
165
|
+
// For browsers that support matchMedium api such as IE 9 and webkit
|
166
|
+
var styleMedia = (window.styleMedia || window.media);
|
167
167
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
div = doc.createElement( 'div' );
|
168
|
+
// For those that don't support matchMedium
|
169
|
+
if (!styleMedia) {
|
170
|
+
var style = document.createElement('style'),
|
171
|
+
script = document.getElementsByTagName('script')[0],
|
172
|
+
info = null;
|
174
173
|
|
175
|
-
|
176
|
-
|
177
|
-
fakeBody.style.background = 'none';
|
178
|
-
fakeBody.appendChild(div);
|
174
|
+
style.type = 'text/css';
|
175
|
+
style.id = 'matchmediajs-test';
|
179
176
|
|
180
|
-
|
177
|
+
script.parentNode.insertBefore(style, script);
|
181
178
|
|
182
|
-
|
179
|
+
// 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
|
180
|
+
info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
|
183
181
|
|
184
|
-
|
185
|
-
|
186
|
-
|
182
|
+
styleMedia = {
|
183
|
+
matchMedium: function(media) {
|
184
|
+
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
|
187
185
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
186
|
+
// 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
|
187
|
+
if (style.styleSheet) {
|
188
|
+
style.styleSheet.cssText = text;
|
189
|
+
} else {
|
190
|
+
style.textContent = text;
|
191
|
+
}
|
192
192
|
|
193
|
-
|
193
|
+
// Test if media query is true or false
|
194
|
+
return info.width === '1px';
|
195
|
+
}
|
196
|
+
};
|
197
|
+
}
|
194
198
|
|
195
|
-
|
199
|
+
return function(media) {
|
200
|
+
return {
|
201
|
+
matches: styleMedia.matchMedium(media || 'all'),
|
202
|
+
media: media || 'all'
|
203
|
+
};
|
204
|
+
};
|
205
|
+
}());
|
196
206
|
|
197
207
|
/*
|
198
208
|
* jquery.requestAnimationFrame
|
@@ -283,7 +293,7 @@
|
|
283
293
|
window.Foundation = {
|
284
294
|
name : 'Foundation',
|
285
295
|
|
286
|
-
version : '5.5.
|
296
|
+
version : '5.5.2',
|
287
297
|
|
288
298
|
media_queries : {
|
289
299
|
'small' : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
@@ -583,7 +593,7 @@
|
|
583
593
|
|
584
594
|
if (query !== undefined) {
|
585
595
|
Foundation.stylesheet.insertRule('@media ' +
|
586
|
-
Foundation.media_queries[media] + '{ ' + rule + ' }');
|
596
|
+
Foundation.media_queries[media] + '{ ' + rule + ' }', Foundation.stylesheet.cssRules.length);
|
587
597
|
}
|
588
598
|
}
|
589
599
|
},
|
@@ -599,7 +609,19 @@
|
|
599
609
|
var self = this,
|
600
610
|
unloaded = images.length;
|
601
611
|
|
602
|
-
|
612
|
+
function pictures_has_height(images) {
|
613
|
+
var pictures_number = images.length;
|
614
|
+
|
615
|
+
for (var i = pictures_number - 1; i >= 0; i--) {
|
616
|
+
if(images.attr('height') === undefined) {
|
617
|
+
return false;
|
618
|
+
};
|
619
|
+
};
|
620
|
+
|
621
|
+
return true;
|
622
|
+
}
|
623
|
+
|
624
|
+
if (unloaded === 0 || pictures_has_height(images)) {
|
603
625
|
callback(images);
|
604
626
|
}
|
605
627
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
Foundation.libs['magellan-expedition'] = {
|
5
5
|
name : 'magellan-expedition',
|
6
6
|
|
7
|
-
version : '5.5.
|
7
|
+
version : '5.5.2',
|
8
8
|
|
9
9
|
settings : {
|
10
10
|
active_class : 'active',
|
@@ -32,38 +32,42 @@
|
|
32
32
|
|
33
33
|
S(self.scope)
|
34
34
|
.off('.magellan')
|
35
|
-
.on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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);
|
41
50
|
|
42
|
-
|
43
|
-
target = $('#' + hash);
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
// Account for expedition height if fixed position
|
48
|
-
var scroll_top = target.offset().top - settings.destination_threshold + 1;
|
49
|
-
if (settings.offset_by_height) {
|
50
|
-
scroll_top = scroll_top - expedition.outerHeight();
|
51
|
-
}
|
51
|
+
}
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
history.pushState(null, null, '#' + hash);
|
58
|
-
} else {
|
59
|
-
location.hash = '#' + hash;
|
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();
|
60
57
|
}
|
61
|
-
|
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
|
+
}
|
62
69
|
})
|
63
70
|
.on('scroll.fndtn.magellan', self.throttle(this.check_for_arrivals.bind(this), settings.throttle_delay));
|
64
|
-
|
65
|
-
$(window)
|
66
|
-
.on('resize.fndtn.magellan', self.throttle(this.set_expedition_position.bind(this), settings.throttle_delay));
|
67
71
|
},
|
68
72
|
|
69
73
|
check_for_arrivals : function () {
|
@@ -194,6 +198,14 @@
|
|
194
198
|
this.S(window).off('.magellan');
|
195
199
|
},
|
196
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
|
+
|
197
209
|
reflow : function () {
|
198
210
|
var self = this;
|
199
211
|
// remove placeholder expeditions used for height calculation purposes
|