catscope 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/bower.json +1 -0
- data/assets/bower_components/foundation/LICENSE +22 -0
- data/assets/bower_components/foundation/README.md +46 -0
- data/assets/bower_components/foundation/bower.json +2 -4
- data/assets/bower_components/foundation/css/foundation.css +1695 -1230
- data/assets/bower_components/foundation/css/foundation.css.map +1 -1
- data/assets/bower_components/foundation/css/foundation.min.css +1 -0
- data/assets/bower_components/foundation/css/normalize.css +9 -12
- data/assets/bower_components/foundation/css/normalize.css.map +1 -1
- data/assets/bower_components/foundation/css/normalize.min.css +1 -0
- data/assets/bower_components/foundation/js/foundation/foundation.abide.js +171 -75
- data/assets/bower_components/foundation/js/foundation/foundation.accordion.js +70 -12
- data/assets/bower_components/foundation/js/foundation/foundation.alert.js +5 -5
- data/assets/bower_components/foundation/js/foundation/foundation.clearing.js +84 -40
- data/assets/bower_components/foundation/js/foundation/foundation.dropdown.js +104 -79
- data/assets/bower_components/foundation/js/foundation/foundation.equalizer.js +57 -26
- data/assets/bower_components/foundation/js/foundation/foundation.interchange.js +50 -38
- data/assets/bower_components/foundation/js/foundation/foundation.joyride.js +121 -110
- data/assets/bower_components/foundation/js/foundation/foundation.js +121 -79
- data/assets/bower_components/foundation/js/foundation/foundation.magellan.js +75 -59
- data/assets/bower_components/foundation/js/foundation/foundation.offcanvas.js +95 -22
- data/assets/bower_components/foundation/js/foundation/foundation.orbit.js +127 -123
- data/assets/bower_components/foundation/js/foundation/foundation.reveal.js +147 -69
- data/assets/bower_components/foundation/js/foundation/foundation.slider.js +101 -72
- data/assets/bower_components/foundation/js/foundation/foundation.tab.js +52 -39
- data/assets/bower_components/foundation/js/foundation/foundation.tooltip.js +97 -49
- data/assets/bower_components/foundation/js/foundation/foundation.topbar.js +70 -57
- data/assets/bower_components/foundation/js/foundation.js +1544 -951
- data/assets/bower_components/foundation/js/foundation.min.js +5 -4
- data/assets/bower_components/foundation/js/vendor/fastclick.js +8 -9
- data/assets/bower_components/foundation/js/vendor/jquery.js +6 -6
- data/assets/bower_components/foundation/js/vendor/modernizr.js +1 -1
- data/assets/bower_components/foundation/package.json +57 -0
- data/assets/bower_components/foundation/scss/foundation/_functions.scss +53 -43
- data/assets/bower_components/foundation/scss/foundation/_settings.scss +59 -37
- data/assets/bower_components/foundation/scss/foundation/components/_accordion.scss +12 -8
- data/assets/bower_components/foundation/scss/foundation/components/_alert-boxes.scss +12 -12
- data/assets/bower_components/foundation/scss/foundation/components/_block-grid.scss +14 -13
- data/assets/bower_components/foundation/scss/foundation/components/_breadcrumbs.scss +19 -19
- data/assets/bower_components/foundation/scss/foundation/components/_button-groups.scss +33 -25
- data/assets/bower_components/foundation/scss/foundation/components/_buttons.scss +30 -28
- data/assets/bower_components/foundation/scss/foundation/components/_clearing.scss +51 -47
- data/assets/bower_components/foundation/scss/foundation/components/_dropdown-buttons.scss +10 -11
- data/assets/bower_components/foundation/scss/foundation/components/_dropdown.scss +45 -38
- data/assets/bower_components/foundation/scss/foundation/components/_flex-video.scss +7 -7
- data/assets/bower_components/foundation/scss/foundation/components/_forms.scss +99 -62
- data/assets/bower_components/foundation/scss/foundation/components/_global.scss +152 -67
- data/assets/bower_components/foundation/scss/foundation/components/_grid.scss +39 -36
- data/assets/bower_components/foundation/scss/foundation/components/_icon-bar.scss +337 -235
- data/assets/bower_components/foundation/scss/foundation/components/_inline-lists.scss +9 -8
- data/assets/bower_components/foundation/scss/foundation/components/_joyride.scss +40 -42
- data/assets/bower_components/foundation/scss/foundation/components/_keystrokes.scss +2 -3
- data/assets/bower_components/foundation/scss/foundation/components/_labels.scss +6 -6
- data/assets/bower_components/foundation/scss/foundation/components/_magellan.scss +2 -2
- data/assets/bower_components/foundation/scss/foundation/components/_offcanvas.scss +259 -168
- data/assets/bower_components/foundation/scss/foundation/components/_orbit.scss +82 -62
- data/assets/bower_components/foundation/scss/foundation/components/_pagination.scss +16 -15
- data/assets/bower_components/foundation/scss/foundation/components/_panels.scss +21 -15
- data/assets/bower_components/foundation/scss/foundation/components/_pricing-tables.scss +16 -16
- data/assets/bower_components/foundation/scss/foundation/components/_progress-bars.scss +10 -4
- data/assets/bower_components/foundation/scss/foundation/components/_range-slider.scss +28 -20
- data/assets/bower_components/foundation/scss/foundation/components/_reveal.scss +38 -28
- data/assets/bower_components/foundation/scss/foundation/components/_side-nav.scss +15 -11
- data/assets/bower_components/foundation/scss/foundation/components/_split-buttons.scss +22 -18
- data/assets/bower_components/foundation/scss/foundation/components/_sub-nav.scss +14 -12
- data/assets/bower_components/foundation/scss/foundation/components/_switches.scss +22 -19
- data/assets/bower_components/foundation/scss/foundation/components/_tables.scss +8 -8
- data/assets/bower_components/foundation/scss/foundation/components/_tabs.scss +50 -31
- data/assets/bower_components/foundation/scss/foundation/components/_thumbs.scss +8 -8
- data/assets/bower_components/foundation/scss/foundation/components/_tooltips.scss +25 -25
- data/assets/bower_components/foundation/scss/foundation/components/_top-bar.scss +176 -122
- data/assets/bower_components/foundation/scss/foundation/components/_type.scss +38 -38
- data/assets/bower_components/foundation/scss/foundation/components/_visibility.scss +33 -16
- data/assets/bower_components/foundation/scss/foundation.scss +37 -40
- data/assets/bower_components/foundation/scss/normalize.scss +8 -11
- data/assets/bower_components/jquery/bower.json +2 -1
- data/assets/bower_components/jquery/dist/jquery.js +9 -4
- data/assets/bower_components/jquery/dist/jquery.min.js +4 -4
- data/assets/bower_components/jquery/dist/jquery.min.map +1 -1
- data/assets/bower_components/jquery/src/core.js +6 -1
- data/assets/scss/_settings.scss +2 -0
- data/assets/stylesheets/app.css +3066 -2429
- data/lib/catscope/version.rb +1 -1
- data/lib/catscope/views/layout.erb +6 -2
- metadata +8 -4
- data/assets/bower_components/foundation/scss/foundation/components/_toolbar.scss +0 -70
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* Foundation Responsive Library
|
3
3
|
* http://foundation.zurb.com
|
4
|
-
* Copyright
|
4
|
+
* Copyright 2015, ZURB
|
5
5
|
* Free to use under the MIT license.
|
6
6
|
* http://www.opensource.org/licenses/mit-license.php
|
7
7
|
*/
|
@@ -10,14 +10,12 @@
|
|
10
10
|
'use strict';
|
11
11
|
|
12
12
|
var header_helpers = function (class_array) {
|
13
|
-
var i = class_array.length;
|
14
13
|
var head = $('head');
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
head.append('<meta class="' + class_array[i] + '" />');
|
14
|
+
head.prepend($.map(class_array, function (class_name) {
|
15
|
+
if (head.has('.' + class_name).length === 0) {
|
16
|
+
return '<meta class="' + class_name + '" />';
|
19
17
|
}
|
20
|
-
}
|
18
|
+
}));
|
21
19
|
};
|
22
20
|
|
23
21
|
header_helpers([
|
@@ -34,7 +32,7 @@
|
|
34
32
|
|
35
33
|
// Enable FastClick if present
|
36
34
|
|
37
|
-
$(function() {
|
35
|
+
$(function () {
|
38
36
|
if (typeof FastClick !== 'undefined') {
|
39
37
|
// Don't attach to body if undefined
|
40
38
|
if (typeof document.body !== 'undefined') {
|
@@ -52,7 +50,9 @@
|
|
52
50
|
var cont;
|
53
51
|
if (context.jquery) {
|
54
52
|
cont = context[0];
|
55
|
-
if (!cont)
|
53
|
+
if (!cont) {
|
54
|
+
return context;
|
55
|
+
}
|
56
56
|
} else {
|
57
57
|
cont = context;
|
58
58
|
}
|
@@ -69,8 +69,12 @@
|
|
69
69
|
|
70
70
|
var attr_name = function (init) {
|
71
71
|
var arr = [];
|
72
|
-
if (!init)
|
73
|
-
|
72
|
+
if (!init) {
|
73
|
+
arr.push('data');
|
74
|
+
}
|
75
|
+
if (this.namespace.length > 0) {
|
76
|
+
arr.push(this.namespace);
|
77
|
+
}
|
74
78
|
arr.push(this.name);
|
75
79
|
|
76
80
|
return arr.join('-');
|
@@ -100,24 +104,20 @@
|
|
100
104
|
|
101
105
|
var bindings = function (method, options) {
|
102
106
|
var self = this,
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
+
bind = function(){
|
108
|
+
var $this = S(this),
|
109
|
+
should_bind_events = !$this.data(self.attr_name(true) + '-init');
|
110
|
+
$this.data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options($this)));
|
107
111
|
|
108
|
-
|
109
|
-
|
110
|
-
|
112
|
+
if (should_bind_events) {
|
113
|
+
self.events(this);
|
114
|
+
}
|
115
|
+
};
|
111
116
|
|
117
|
+
if (S(this.scope).is('[' + this.attr_name() +']')) {
|
118
|
+
bind.call(this.scope);
|
112
119
|
} else {
|
113
|
-
S('[' + this.attr_name() +']', this.scope).each(
|
114
|
-
var should_bind_events = !S(this).data(self.attr_name(true) + '-init');
|
115
|
-
S(this).data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options(S(this))));
|
116
|
-
|
117
|
-
if (should_bind_events) {
|
118
|
-
self.events(this);
|
119
|
-
}
|
120
|
-
});
|
120
|
+
S('[' + this.attr_name() +']', this.scope).each(bind);
|
121
121
|
}
|
122
122
|
// # Patch to fix #5043 to move this *after* the if/else clause in order for Backbone and similar frameworks to have improved control over event binding and data-options updating.
|
123
123
|
if (typeof method === 'string') {
|
@@ -155,42 +155,52 @@
|
|
155
155
|
}
|
156
156
|
};
|
157
157
|
|
158
|
-
|
159
|
-
https://github.com/paulirish/matchMedia.js
|
160
|
-
*/
|
158
|
+
/*! 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 */
|
161
159
|
|
162
|
-
window.matchMedia
|
160
|
+
window.matchMedia || (window.matchMedia = function() {
|
161
|
+
"use strict";
|
163
162
|
|
164
|
-
|
163
|
+
// For browsers that support matchMedium api such as IE 9 and webkit
|
164
|
+
var styleMedia = (window.styleMedia || window.media);
|
165
165
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
div = doc.createElement( 'div' );
|
166
|
+
// For those that don't support matchMedium
|
167
|
+
if (!styleMedia) {
|
168
|
+
var style = document.createElement('style'),
|
169
|
+
script = document.getElementsByTagName('script')[0],
|
170
|
+
info = null;
|
172
171
|
|
173
|
-
|
174
|
-
|
175
|
-
fakeBody.style.background = 'none';
|
176
|
-
fakeBody.appendChild(div);
|
172
|
+
style.type = 'text/css';
|
173
|
+
style.id = 'matchmediajs-test';
|
177
174
|
|
178
|
-
|
175
|
+
script.parentNode.insertBefore(style, script);
|
179
176
|
|
180
|
-
|
177
|
+
// 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
|
178
|
+
info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
|
181
179
|
|
182
|
-
|
183
|
-
|
184
|
-
|
180
|
+
styleMedia = {
|
181
|
+
matchMedium: function(media) {
|
182
|
+
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
|
185
183
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
184
|
+
// 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
|
185
|
+
if (style.styleSheet) {
|
186
|
+
style.styleSheet.cssText = text;
|
187
|
+
} else {
|
188
|
+
style.textContent = text;
|
189
|
+
}
|
190
190
|
|
191
|
-
|
191
|
+
// Test if media query is true or false
|
192
|
+
return info.width === '1px';
|
193
|
+
}
|
194
|
+
};
|
195
|
+
}
|
192
196
|
|
193
|
-
|
197
|
+
return function(media) {
|
198
|
+
return {
|
199
|
+
matches: styleMedia.matchMedium(media || 'all'),
|
200
|
+
media: media || 'all'
|
201
|
+
};
|
202
|
+
};
|
203
|
+
}());
|
194
204
|
|
195
205
|
/*
|
196
206
|
* jquery.requestAnimationFrame
|
@@ -203,6 +213,7 @@
|
|
203
213
|
|
204
214
|
(function(jQuery) {
|
205
215
|
|
216
|
+
|
206
217
|
// requestAnimationFrame polyfill adapted from Erik Möller
|
207
218
|
// fixes from Paul Irish and Tino Zijdel
|
208
219
|
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
@@ -269,7 +280,6 @@
|
|
269
280
|
|
270
281
|
}( $ ));
|
271
282
|
|
272
|
-
|
273
283
|
function removeQuotes (string) {
|
274
284
|
if (typeof string === 'string' || string instanceof String) {
|
275
285
|
string = string.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g, '');
|
@@ -278,27 +288,36 @@
|
|
278
288
|
return string;
|
279
289
|
}
|
280
290
|
|
291
|
+
function MediaQuery(selector) {
|
292
|
+
this.selector = selector;
|
293
|
+
this.query = '';
|
294
|
+
}
|
295
|
+
|
296
|
+
MediaQuery.prototype.toString = function () {
|
297
|
+
return this.query || (this.query = S(this.selector).css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''));
|
298
|
+
};
|
299
|
+
|
281
300
|
window.Foundation = {
|
282
301
|
name : 'Foundation',
|
283
302
|
|
284
|
-
version : '5.5.
|
303
|
+
version : '5.5.3',
|
285
304
|
|
286
305
|
media_queries : {
|
287
|
-
'small' :
|
288
|
-
'small-only' :
|
289
|
-
'medium' :
|
290
|
-
'medium-only' :
|
291
|
-
'large' :
|
292
|
-
'large-only' :
|
293
|
-
'xlarge' :
|
294
|
-
'xlarge-only' :
|
295
|
-
'xxlarge' :
|
306
|
+
'small' : new MediaQuery('.foundation-mq-small'),
|
307
|
+
'small-only' : new MediaQuery('.foundation-mq-small-only'),
|
308
|
+
'medium' : new MediaQuery('.foundation-mq-medium'),
|
309
|
+
'medium-only' : new MediaQuery('.foundation-mq-medium-only'),
|
310
|
+
'large' : new MediaQuery('.foundation-mq-large'),
|
311
|
+
'large-only' : new MediaQuery('.foundation-mq-large-only'),
|
312
|
+
'xlarge' : new MediaQuery('.foundation-mq-xlarge'),
|
313
|
+
'xlarge-only' : new MediaQuery('.foundation-mq-xlarge-only'),
|
314
|
+
'xxlarge' : new MediaQuery('.foundation-mq-xxlarge')
|
296
315
|
},
|
297
316
|
|
298
317
|
stylesheet : $('<style></style>').appendTo('head')[0].sheet,
|
299
318
|
|
300
|
-
global: {
|
301
|
-
namespace: undefined
|
319
|
+
global : {
|
320
|
+
namespace : undefined
|
302
321
|
},
|
303
322
|
|
304
323
|
init : function (scope, libraries, method, options, response) {
|
@@ -323,7 +342,7 @@
|
|
323
342
|
}
|
324
343
|
}
|
325
344
|
|
326
|
-
S(window).load(function(){
|
345
|
+
S(window).load(function () {
|
327
346
|
S(window)
|
328
347
|
.trigger('resize.fndtn.clearing')
|
329
348
|
.trigger('resize.fndtn.dropdown')
|
@@ -345,8 +364,7 @@
|
|
345
364
|
if (args && args.hasOwnProperty(lib)) {
|
346
365
|
if (typeof this.libs[lib].settings !== 'undefined') {
|
347
366
|
$.extend(true, this.libs[lib].settings, args[lib]);
|
348
|
-
}
|
349
|
-
else if (typeof this.libs[lib].defaults !== 'undefined') {
|
367
|
+
} else if (typeof this.libs[lib].defaults !== 'undefined') {
|
350
368
|
$.extend(true, this.libs[lib].defaults, args[lib]);
|
351
369
|
}
|
352
370
|
return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]);
|
@@ -381,7 +399,7 @@
|
|
381
399
|
}
|
382
400
|
},
|
383
401
|
|
384
|
-
set_namespace: function () {
|
402
|
+
set_namespace : function () {
|
385
403
|
|
386
404
|
// Description:
|
387
405
|
// Don't bother reading the namespace out of the meta tag
|
@@ -469,12 +487,16 @@
|
|
469
487
|
var context = this, args = arguments;
|
470
488
|
var later = function () {
|
471
489
|
timeout = null;
|
472
|
-
if (!immediate)
|
490
|
+
if (!immediate) {
|
491
|
+
result = func.apply(context, args);
|
492
|
+
}
|
473
493
|
};
|
474
494
|
var callNow = immediate && !timeout;
|
475
495
|
clearTimeout(timeout);
|
476
496
|
timeout = setTimeout(later, delay);
|
477
|
-
if (callNow)
|
497
|
+
if (callNow) {
|
498
|
+
result = func.apply(context, args);
|
499
|
+
}
|
478
500
|
return result;
|
479
501
|
};
|
480
502
|
},
|
@@ -511,11 +533,13 @@
|
|
511
533
|
ii = opts_arr.length;
|
512
534
|
|
513
535
|
function isNumber (o) {
|
514
|
-
return !
|
536
|
+
return !isNaN (o - 0) && o !== null && o !== '' && o !== false && o !== true;
|
515
537
|
}
|
516
538
|
|
517
539
|
function trim (str) {
|
518
|
-
if (typeof str === 'string')
|
540
|
+
if (typeof str === 'string') {
|
541
|
+
return $.trim(str);
|
542
|
+
}
|
519
543
|
return str;
|
520
544
|
}
|
521
545
|
|
@@ -523,8 +547,12 @@
|
|
523
547
|
p = opts_arr[ii].split(':');
|
524
548
|
p = [p[0], p.slice(1).join(':')];
|
525
549
|
|
526
|
-
if (/true/i.test(p[1]))
|
527
|
-
|
550
|
+
if (/true/i.test(p[1])) {
|
551
|
+
p[1] = true;
|
552
|
+
}
|
553
|
+
if (/false/i.test(p[1])) {
|
554
|
+
p[1] = false;
|
555
|
+
}
|
528
556
|
if (isNumber(p[1])) {
|
529
557
|
if (p[1].indexOf('.') === -1) {
|
530
558
|
p[1] = parseInt(p[1], 10);
|
@@ -550,7 +578,7 @@
|
|
550
578
|
//
|
551
579
|
// Class (String): Class name for the generated <meta> tag
|
552
580
|
register_media : function (media, media_class) {
|
553
|
-
if(Foundation.media_queries[media] === undefined) {
|
581
|
+
if (Foundation.media_queries[media] === undefined) {
|
554
582
|
$('head').append('<meta class="' + media_class + '"/>');
|
555
583
|
Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family'));
|
556
584
|
}
|
@@ -572,7 +600,7 @@
|
|
572
600
|
|
573
601
|
if (query !== undefined) {
|
574
602
|
Foundation.stylesheet.insertRule('@media ' +
|
575
|
-
Foundation.media_queries[media] + '{ ' + rule + ' }');
|
603
|
+
Foundation.media_queries[media] + '{ ' + rule + ' }', Foundation.stylesheet.cssRules.length);
|
576
604
|
}
|
577
605
|
}
|
578
606
|
},
|
@@ -588,7 +616,19 @@
|
|
588
616
|
var self = this,
|
589
617
|
unloaded = images.length;
|
590
618
|
|
591
|
-
|
619
|
+
function pictures_has_height(images) {
|
620
|
+
var pictures_number = images.length;
|
621
|
+
|
622
|
+
for (var i = pictures_number - 1; i >= 0; i--) {
|
623
|
+
if(images.attr('height') === undefined) {
|
624
|
+
return false;
|
625
|
+
};
|
626
|
+
};
|
627
|
+
|
628
|
+
return true;
|
629
|
+
}
|
630
|
+
|
631
|
+
if (unloaded === 0 || pictures_has_height(images)) {
|
592
632
|
callback(images);
|
593
633
|
}
|
594
634
|
|
@@ -612,7 +652,9 @@
|
|
612
652
|
// Returns:
|
613
653
|
// Rand (String): Pseudo-random, alphanumeric string.
|
614
654
|
random_str : function () {
|
615
|
-
if (!this.fidx)
|
655
|
+
if (!this.fidx) {
|
656
|
+
this.fidx = 0;
|
657
|
+
}
|
616
658
|
this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-');
|
617
659
|
|
618
660
|
return this.prefix + (this.fidx++).toString(36);
|
@@ -695,20 +737,24 @@
|
|
695
737
|
Foundation.libs.abide = {
|
696
738
|
name : 'abide',
|
697
739
|
|
698
|
-
version : '5.5.
|
740
|
+
version : '5.5.3',
|
699
741
|
|
700
742
|
settings : {
|
701
|
-
live_validate : true,
|
702
|
-
validate_on_blur: true,
|
703
|
-
|
704
|
-
|
705
|
-
|
743
|
+
live_validate : true, // validate the form as you go
|
744
|
+
validate_on_blur : true, // validate whenever you focus/blur on an input field
|
745
|
+
// validate_on: 'tab', // tab (when user tabs between fields), change (input changes), manual (call custom events)
|
746
|
+
|
747
|
+
focus_on_invalid : true, // automatically bring the focus to an invalid input field
|
748
|
+
error_labels : true, // labels with a for="inputId" will receive an `error` class
|
749
|
+
error_class : 'error', // labels with a for="inputId" will receive an `error` class
|
750
|
+
// the amount of time Abide will take before it validates the form (in ms).
|
751
|
+
// smaller time will result in faster validation
|
706
752
|
timeout : 1000,
|
707
753
|
patterns : {
|
708
|
-
alpha: /^[a-zA-Z]+$/,
|
754
|
+
alpha : /^[a-zA-Z]+$/,
|
709
755
|
alpha_numeric : /^[a-zA-Z0-9]+$/,
|
710
|
-
integer: /^[-+]?\d+$/,
|
711
|
-
number: /^[-+]?\d*(?:[\.\,]\d+)?$/,
|
756
|
+
integer : /^[-+]?\d+$/,
|
757
|
+
number : /^[-+]?\d*(?:[\.\,]\d+)?$/,
|
712
758
|
|
713
759
|
// amex, visa, diners
|
714
760
|
card : /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
|
@@ -717,26 +763,27 @@
|
|
717
763
|
// http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
|
718
764
|
email : /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,
|
719
765
|
|
720
|
-
|
766
|
+
// http://blogs.lse.ac.uk/lti/2008/04/23/a-regular-expression-to-match-any-url/
|
767
|
+
url: /^(https?|ftp|file|ssh):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?(\d+)?((\/[-\+~%\/\.\w]+)?\??([-\+=&;%@\.\w]+)?#?([\w]+)?)?/,
|
721
768
|
// abc.de
|
722
|
-
domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
|
769
|
+
domain : /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
|
723
770
|
|
724
|
-
datetime: /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
|
771
|
+
datetime : /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
|
725
772
|
// YYYY-MM-DD
|
726
|
-
date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
|
773
|
+
date : /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
|
727
774
|
// HH:MM:SS
|
728
775
|
time : /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
|
729
|
-
dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
|
776
|
+
dateISO : /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
|
730
777
|
// MM/DD/YYYY
|
731
778
|
month_day_year : /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
|
732
779
|
// DD/MM/YYYY
|
733
780
|
day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
|
734
781
|
|
735
782
|
// #FFF or #FFFFFF
|
736
|
-
color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
|
783
|
+
color : /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
|
737
784
|
},
|
738
785
|
validators : {
|
739
|
-
equalTo: function(el, required, parent) {
|
786
|
+
equalTo : function (el, required, parent) {
|
740
787
|
var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value,
|
741
788
|
to = el.value,
|
742
789
|
valid = (from === to);
|
@@ -759,36 +806,82 @@
|
|
759
806
|
|
760
807
|
this.invalid_attr = this.add_namespace('data-invalid');
|
761
808
|
|
809
|
+
function validate(originalSelf, e) {
|
810
|
+
clearTimeout(self.timer);
|
811
|
+
self.timer = setTimeout(function () {
|
812
|
+
self.validate([originalSelf], e);
|
813
|
+
}.bind(originalSelf), settings.timeout);
|
814
|
+
}
|
815
|
+
|
762
816
|
form
|
763
817
|
.off('.abide')
|
764
|
-
.on('submit.fndtn.abide
|
818
|
+
.on('submit.fndtn.abide', function (e) {
|
765
819
|
var is_ajax = /ajax/i.test(self.S(this).attr(self.attr_name()));
|
766
|
-
return self.validate(self.S(this).find('input, textarea, select').get(), e, is_ajax);
|
820
|
+
return self.validate(self.S(this).find('input, textarea, select').not(":hidden, [data-abide-ignore]").get(), e, is_ajax);
|
767
821
|
})
|
768
|
-
.on('
|
769
|
-
|
822
|
+
.on('validate.fndtn.abide', function (e) {
|
823
|
+
if (settings.validate_on === 'manual') {
|
824
|
+
self.validate([e.target], e);
|
825
|
+
}
|
826
|
+
})
|
827
|
+
.on('reset', function (e) {
|
828
|
+
return self.reset($(this), e);
|
770
829
|
})
|
771
|
-
.find('input, textarea, select')
|
830
|
+
.find('input, textarea, select').not(":hidden, [data-abide-ignore]")
|
772
831
|
.off('.abide')
|
773
832
|
.on('blur.fndtn.abide change.fndtn.abide', function (e) {
|
774
|
-
|
775
|
-
|
833
|
+
var id = this.getAttribute('id'),
|
834
|
+
eqTo = form.find('[data-equalto="'+ id +'"]');
|
835
|
+
// old settings fallback
|
836
|
+
// will be deprecated with F6 release
|
837
|
+
if (settings.validate_on_blur && settings.validate_on_blur === true) {
|
838
|
+
validate(this, e);
|
839
|
+
}
|
840
|
+
// checks if there is an equalTo equivalent related by id
|
841
|
+
if(typeof eqTo.get(0) !== "undefined" && eqTo.val().length){
|
842
|
+
validate(eqTo.get(0),e);
|
843
|
+
}
|
844
|
+
// new settings combining validate options into one setting
|
845
|
+
if (settings.validate_on === 'change') {
|
846
|
+
validate(this, e);
|
776
847
|
}
|
777
848
|
})
|
778
849
|
.on('keydown.fndtn.abide', function (e) {
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
850
|
+
var id = this.getAttribute('id'),
|
851
|
+
eqTo = form.find('[data-equalto="'+ id +'"]');
|
852
|
+
// old settings fallback
|
853
|
+
// will be deprecated with F6 release
|
854
|
+
if (settings.live_validate && settings.live_validate === true && e.which != 9) {
|
855
|
+
validate(this, e);
|
856
|
+
}
|
857
|
+
// checks if there is an equalTo equivalent related by id
|
858
|
+
if(typeof eqTo.get(0) !== "undefined" && eqTo.val().length){
|
859
|
+
validate(eqTo.get(0),e);
|
860
|
+
}
|
861
|
+
// new settings combining validate options into one setting
|
862
|
+
if (settings.validate_on === 'tab' && e.which === 9) {
|
863
|
+
validate(this, e);
|
864
|
+
}
|
865
|
+
else if (settings.validate_on === 'change') {
|
866
|
+
validate(this, e);
|
867
|
+
}
|
868
|
+
})
|
869
|
+
.on('focus', function (e) {
|
870
|
+
if (navigator.userAgent.match(/iPad|iPhone|Android|BlackBerry|Windows Phone|webOS/i)) {
|
871
|
+
$('html, body').animate({
|
872
|
+
scrollTop: $(e.target).offset().top
|
873
|
+
}, 100);
|
784
874
|
}
|
785
875
|
});
|
786
876
|
},
|
787
877
|
|
788
|
-
reset : function (form) {
|
789
|
-
|
790
|
-
|
791
|
-
|
878
|
+
reset : function (form, e) {
|
879
|
+
var self = this;
|
880
|
+
form.removeAttr(self.invalid_attr);
|
881
|
+
|
882
|
+
$('[' + self.invalid_attr + ']', form).removeAttr(self.invalid_attr);
|
883
|
+
$('.' + self.settings.error_class, form).not('small').removeClass(self.settings.error_class);
|
884
|
+
$(':input', form).not(':button, :submit, :reset, :hidden, [data-abide-ignore]').val('').removeAttr(self.invalid_attr);
|
792
885
|
},
|
793
886
|
|
794
887
|
validate : function (els, e, is_ajax) {
|
@@ -798,22 +891,26 @@
|
|
798
891
|
submit_event = /submit/.test(e.type);
|
799
892
|
|
800
893
|
// Has to count up to make sure the focus gets applied to the top error
|
801
|
-
for (var i=0; i < validation_count; i++) {
|
894
|
+
for (var i = 0; i < validation_count; i++) {
|
802
895
|
if (!validations[i] && (submit_event || is_ajax)) {
|
803
|
-
if (this.settings.focus_on_invalid)
|
804
|
-
|
896
|
+
if (this.settings.focus_on_invalid) {
|
897
|
+
els[i].focus();
|
898
|
+
}
|
899
|
+
form.trigger('invalid.fndtn.abide');
|
805
900
|
this.S(els[i]).closest('form').attr(this.invalid_attr, '');
|
806
901
|
return false;
|
807
902
|
}
|
808
903
|
}
|
809
904
|
|
810
905
|
if (submit_event || is_ajax) {
|
811
|
-
form.trigger('valid
|
906
|
+
form.trigger('valid.fndtn.abide');
|
812
907
|
}
|
813
908
|
|
814
909
|
form.removeAttr(this.invalid_attr);
|
815
910
|
|
816
|
-
if (is_ajax)
|
911
|
+
if (is_ajax) {
|
912
|
+
return false;
|
913
|
+
}
|
817
914
|
|
818
915
|
return true;
|
819
916
|
},
|
@@ -853,8 +950,11 @@
|
|
853
950
|
// TODO: Break this up into smaller methods, getting hard to read.
|
854
951
|
check_validation_and_apply_styles : function (el_patterns) {
|
855
952
|
var i = el_patterns.length,
|
856
|
-
validations = []
|
857
|
-
|
953
|
+
validations = [];
|
954
|
+
if (i == 0) {
|
955
|
+
return validations;
|
956
|
+
}
|
957
|
+
var form = this.S(el_patterns[0][0]).closest('[data-' + this.attr_name(true) + ']'),
|
858
958
|
settings = form.data(this.attr_name(true) + '-init') || {};
|
859
959
|
while (i--) {
|
860
960
|
var el = el_patterns[i][0],
|
@@ -862,8 +962,8 @@
|
|
862
962
|
value = el.value.trim(),
|
863
963
|
direct_parent = this.S(el).parent(),
|
864
964
|
validator = el.getAttribute(this.add_namespace('data-abide-validator')),
|
865
|
-
is_radio = el.type ===
|
866
|
-
is_checkbox = el.type ===
|
965
|
+
is_radio = el.type === 'radio',
|
966
|
+
is_checkbox = el.type === 'checkbox',
|
867
967
|
label = this.S('label[for="' + el.getAttribute('id') + '"]'),
|
868
968
|
valid_length = (required) ? (el.value.length > 0) : true,
|
869
969
|
el_validations = [];
|
@@ -871,7 +971,7 @@
|
|
871
971
|
var parent, valid;
|
872
972
|
|
873
973
|
// support old way to do equalTo validations
|
874
|
-
if(el.getAttribute(this.add_namespace('data-equalto'))) { validator =
|
974
|
+
if (el.getAttribute(this.add_namespace('data-equalto'))) { validator = 'equalTo' }
|
875
975
|
|
876
976
|
if (!direct_parent.is('label')) {
|
877
977
|
parent = direct_parent;
|
@@ -879,15 +979,36 @@
|
|
879
979
|
parent = direct_parent.parent();
|
880
980
|
}
|
881
981
|
|
882
|
-
if (validator) {
|
883
|
-
valid = this.settings.validators[validator].apply(this, [el, required, parent]);
|
884
|
-
el_validations.push(valid);
|
885
|
-
}
|
886
|
-
|
887
982
|
if (is_radio && required) {
|
888
983
|
el_validations.push(this.valid_radio(el, required));
|
889
984
|
} else if (is_checkbox && required) {
|
890
985
|
el_validations.push(this.valid_checkbox(el, required));
|
986
|
+
|
987
|
+
} else if (validator) {
|
988
|
+
// Validate using each of the specified (space-delimited) validators.
|
989
|
+
var validators = validator.split(' ');
|
990
|
+
var last_valid = true, all_valid = true;
|
991
|
+
for (var iv = 0; iv < validators.length; iv++) {
|
992
|
+
valid = this.settings.validators[validators[iv]].apply(this, [el, required, parent])
|
993
|
+
el_validations.push(valid);
|
994
|
+
all_valid = valid && last_valid;
|
995
|
+
last_valid = valid;
|
996
|
+
}
|
997
|
+
if (all_valid) {
|
998
|
+
this.S(el).removeAttr(this.invalid_attr);
|
999
|
+
parent.removeClass('error');
|
1000
|
+
if (label.length > 0 && this.settings.error_labels) {
|
1001
|
+
label.removeClass(this.settings.error_class).removeAttr('role');
|
1002
|
+
}
|
1003
|
+
$(el).triggerHandler('valid');
|
1004
|
+
} else {
|
1005
|
+
this.S(el).attr(this.invalid_attr, '');
|
1006
|
+
parent.addClass('error');
|
1007
|
+
if (label.length > 0 && this.settings.error_labels) {
|
1008
|
+
label.addClass(this.settings.error_class).attr('role', 'alert');
|
1009
|
+
}
|
1010
|
+
$(el).triggerHandler('invalid');
|
1011
|
+
}
|
891
1012
|
} else {
|
892
1013
|
|
893
1014
|
if (el_patterns[i][1].test(value) && valid_length ||
|
@@ -897,9 +1018,8 @@
|
|
897
1018
|
el_validations.push(false);
|
898
1019
|
}
|
899
1020
|
|
900
|
-
el_validations = [el_validations.every(function(valid){return valid;})];
|
901
|
-
|
902
|
-
if(el_validations[0]){
|
1021
|
+
el_validations = [el_validations.every(function (valid) {return valid;})];
|
1022
|
+
if (el_validations[0]) {
|
903
1023
|
this.S(el).removeAttr(this.invalid_attr);
|
904
1024
|
el.setAttribute('aria-invalid', 'false');
|
905
1025
|
el.removeAttribute('aria-describedby');
|
@@ -913,9 +1033,11 @@
|
|
913
1033
|
el.setAttribute('aria-invalid', 'true');
|
914
1034
|
|
915
1035
|
// Try to find the error associated with the input
|
916
|
-
var errorElem = parent.find('small.'+this.settings.error_class, 'span.'+this.settings.error_class);
|
917
|
-
var errorID = errorElem.length > 0 ? errorElem[0].id :
|
918
|
-
if (errorID.length > 0)
|
1036
|
+
var errorElem = parent.find('small.' + this.settings.error_class, 'span.' + this.settings.error_class);
|
1037
|
+
var errorID = errorElem.length > 0 ? errorElem[0].id : '';
|
1038
|
+
if (errorID.length > 0) {
|
1039
|
+
el.setAttribute('aria-describedby', errorID);
|
1040
|
+
}
|
919
1041
|
|
920
1042
|
// el.setAttribute('aria-describedby', $(el).find('.error')[0].id);
|
921
1043
|
parent.addClass(this.settings.error_class);
|
@@ -925,20 +1047,22 @@
|
|
925
1047
|
$(el).triggerHandler('invalid');
|
926
1048
|
}
|
927
1049
|
}
|
928
|
-
validations.
|
1050
|
+
validations = validations.concat(el_validations);
|
929
1051
|
}
|
930
|
-
|
1052
|
+
|
931
1053
|
return validations;
|
932
1054
|
},
|
933
1055
|
|
934
|
-
valid_checkbox : function(el, required) {
|
1056
|
+
valid_checkbox : function (el, required) {
|
935
1057
|
var el = this.S(el),
|
936
1058
|
valid = (el.is(':checked') || !required || el.get(0).getAttribute('disabled'));
|
937
1059
|
|
938
1060
|
if (valid) {
|
939
1061
|
el.removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
|
1062
|
+
$(el).triggerHandler('valid');
|
940
1063
|
} else {
|
941
1064
|
el.attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
|
1065
|
+
$(el).triggerHandler('invalid');
|
942
1066
|
}
|
943
1067
|
|
944
1068
|
return valid;
|
@@ -946,40 +1070,42 @@
|
|
946
1070
|
|
947
1071
|
valid_radio : function (el, required) {
|
948
1072
|
var name = el.getAttribute('name'),
|
949
|
-
group = this.S(el).closest('[data-' + this.attr_name(true) + ']').find("[name='"+name+"']"),
|
1073
|
+
group = this.S(el).closest('[data-' + this.attr_name(true) + ']').find("[name='" + name + "']"),
|
950
1074
|
count = group.length,
|
951
1075
|
valid = false,
|
952
1076
|
disabled = false;
|
953
1077
|
|
954
1078
|
// Has to count up to make sure the focus gets applied to the top error
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
}
|
966
|
-
}
|
1079
|
+
for (var i=0; i < count; i++) {
|
1080
|
+
if( group[i].getAttribute('disabled') ){
|
1081
|
+
disabled=true;
|
1082
|
+
valid=true;
|
1083
|
+
} else {
|
1084
|
+
if (group[i].checked){
|
1085
|
+
valid = true;
|
1086
|
+
} else {
|
1087
|
+
if( disabled ){
|
1088
|
+
valid = false;
|
967
1089
|
}
|
1090
|
+
}
|
968
1091
|
}
|
1092
|
+
}
|
969
1093
|
|
970
1094
|
// Has to count up to make sure the focus gets applied to the top error
|
971
|
-
for (var i=0; i < count; i++) {
|
1095
|
+
for (var i = 0; i < count; i++) {
|
972
1096
|
if (valid) {
|
973
1097
|
this.S(group[i]).removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
|
1098
|
+
$(group[i]).triggerHandler('valid');
|
974
1099
|
} else {
|
975
1100
|
this.S(group[i]).attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
|
1101
|
+
$(group[i]).triggerHandler('invalid');
|
976
1102
|
}
|
977
1103
|
}
|
978
1104
|
|
979
1105
|
return valid;
|
980
1106
|
},
|
981
1107
|
|
982
|
-
valid_equal: function(el, required, parent) {
|
1108
|
+
valid_equal : function (el, required, parent) {
|
983
1109
|
var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value,
|
984
1110
|
to = el.value,
|
985
1111
|
valid = (from === to);
|
@@ -987,17 +1113,21 @@
|
|
987
1113
|
if (valid) {
|
988
1114
|
this.S(el).removeAttr(this.invalid_attr);
|
989
1115
|
parent.removeClass(this.settings.error_class);
|
990
|
-
if (label.length > 0 && settings.error_labels)
|
1116
|
+
if (label.length > 0 && settings.error_labels) {
|
1117
|
+
label.removeClass(this.settings.error_class);
|
1118
|
+
}
|
991
1119
|
} else {
|
992
1120
|
this.S(el).attr(this.invalid_attr, '');
|
993
1121
|
parent.addClass(this.settings.error_class);
|
994
|
-
if (label.length > 0 && settings.error_labels)
|
1122
|
+
if (label.length > 0 && settings.error_labels) {
|
1123
|
+
label.addClass(this.settings.error_class);
|
1124
|
+
}
|
995
1125
|
}
|
996
1126
|
|
997
1127
|
return valid;
|
998
1128
|
},
|
999
1129
|
|
1000
|
-
valid_oneof: function(el, required, parent, doNotValidateOthers) {
|
1130
|
+
valid_oneof : function (el, required, parent, doNotValidateOthers) {
|
1001
1131
|
var el = this.S(el),
|
1002
1132
|
others = this.S('[' + this.add_namespace('data-oneof') + ']'),
|
1003
1133
|
valid = others.filter(':checked').length > 0;
|
@@ -1010,12 +1140,20 @@
|
|
1010
1140
|
|
1011
1141
|
if (!doNotValidateOthers) {
|
1012
1142
|
var _this = this;
|
1013
|
-
others.each(function() {
|
1143
|
+
others.each(function () {
|
1014
1144
|
_this.valid_oneof.call(_this, this, null, null, true);
|
1015
1145
|
});
|
1016
1146
|
}
|
1017
1147
|
|
1018
1148
|
return valid;
|
1149
|
+
},
|
1150
|
+
|
1151
|
+
reflow : function(scope, options) {
|
1152
|
+
var self = this,
|
1153
|
+
form = self.S('[' + this.attr_name() + ']').attr('novalidate', 'novalidate');
|
1154
|
+
self.S(form).each(function (idx, el) {
|
1155
|
+
self.events(el);
|
1156
|
+
});
|
1019
1157
|
}
|
1020
1158
|
};
|
1021
1159
|
}(jQuery, window, window.document));
|
@@ -1026,13 +1164,13 @@
|
|
1026
1164
|
Foundation.libs.accordion = {
|
1027
1165
|
name : 'accordion',
|
1028
1166
|
|
1029
|
-
version : '5.5.
|
1167
|
+
version : '5.5.3',
|
1030
1168
|
|
1031
1169
|
settings : {
|
1032
|
-
content_class: 'content',
|
1033
|
-
active_class: 'active',
|
1034
|
-
multi_expand: false,
|
1035
|
-
toggleable: true,
|
1170
|
+
content_class : 'content',
|
1171
|
+
active_class : 'active',
|
1172
|
+
multi_expand : false,
|
1173
|
+
toggleable : true,
|
1036
1174
|
callback : function () {}
|
1037
1175
|
},
|
1038
1176
|
|
@@ -1040,30 +1178,35 @@
|
|
1040
1178
|
this.bindings(method, options);
|
1041
1179
|
},
|
1042
1180
|
|
1043
|
-
events : function () {
|
1181
|
+
events : function (instance) {
|
1044
1182
|
var self = this;
|
1045
1183
|
var S = this.S;
|
1184
|
+
self.create(this.S(instance));
|
1185
|
+
|
1046
1186
|
S(this.scope)
|
1047
1187
|
.off('.fndtn.accordion')
|
1048
|
-
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > .
|
1188
|
+
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a, [' + this.attr_name() + '] > li > a', function (e) {
|
1049
1189
|
var accordion = S(this).closest('[' + self.attr_name() + ']'),
|
1050
1190
|
groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
|
1051
1191
|
settings = accordion.data(self.attr_name(true) + '-init') || self.settings,
|
1052
1192
|
target = S('#' + this.href.split('#')[1]),
|
1053
|
-
aunts = $('>
|
1054
|
-
siblings = aunts.children('.'+settings.content_class),
|
1193
|
+
aunts = $('> dd, > li', accordion),
|
1194
|
+
siblings = aunts.children('.' + settings.content_class),
|
1055
1195
|
active_content = siblings.filter('.' + settings.active_class);
|
1056
1196
|
|
1057
1197
|
e.preventDefault();
|
1058
1198
|
|
1059
1199
|
if (accordion.attr(self.attr_name())) {
|
1060
|
-
siblings = siblings.add('[' + groupSelector + '] dd > '+'.'+settings.content_class);
|
1061
|
-
aunts = aunts.add('[' + groupSelector + ']
|
1200
|
+
siblings = siblings.add('[' + groupSelector + '] dd > ' + '.' + settings.content_class + ', [' + groupSelector + '] li > ' + '.' + settings.content_class);
|
1201
|
+
aunts = aunts.add('[' + groupSelector + '] dd, [' + groupSelector + '] li');
|
1062
1202
|
}
|
1063
1203
|
|
1064
1204
|
if (settings.toggleable && target.is(active_content)) {
|
1065
|
-
target.parent('
|
1205
|
+
target.parent('dd, li').toggleClass(settings.active_class, false);
|
1066
1206
|
target.toggleClass(settings.active_class, false);
|
1207
|
+
S(this).attr('aria-expanded', function(i, attr){
|
1208
|
+
return attr === 'true' ? 'false' : 'true';
|
1209
|
+
});
|
1067
1210
|
settings.callback(target);
|
1068
1211
|
target.triggerHandler('toggled', [accordion]);
|
1069
1212
|
accordion.triggerHandler('toggled', [target]);
|
@@ -1073,15 +1216,68 @@
|
|
1073
1216
|
if (!settings.multi_expand) {
|
1074
1217
|
siblings.removeClass(settings.active_class);
|
1075
1218
|
aunts.removeClass(settings.active_class);
|
1219
|
+
aunts.children('a').attr('aria-expanded','false');
|
1076
1220
|
}
|
1077
1221
|
|
1078
1222
|
target.addClass(settings.active_class).parent().addClass(settings.active_class);
|
1079
1223
|
settings.callback(target);
|
1080
1224
|
target.triggerHandler('toggled', [accordion]);
|
1081
1225
|
accordion.triggerHandler('toggled', [target]);
|
1226
|
+
S(this).attr('aria-expanded','true');
|
1082
1227
|
});
|
1083
1228
|
},
|
1084
1229
|
|
1230
|
+
create: function($instance) {
|
1231
|
+
var self = this,
|
1232
|
+
accordion = $instance,
|
1233
|
+
aunts = $('> .accordion-navigation', accordion),
|
1234
|
+
settings = accordion.data(self.attr_name(true) + '-init') || self.settings;
|
1235
|
+
|
1236
|
+
aunts.children('a').attr('aria-expanded','false');
|
1237
|
+
aunts.has('.' + settings.content_class + '.' + settings.active_class).addClass(settings.active_class).children('a').attr('aria-expanded','true');
|
1238
|
+
|
1239
|
+
if (settings.multi_expand) {
|
1240
|
+
$instance.attr('aria-multiselectable','true');
|
1241
|
+
}
|
1242
|
+
},
|
1243
|
+
|
1244
|
+
toggle : function(options) {
|
1245
|
+
var options = typeof options !== 'undefined' ? options : {};
|
1246
|
+
var selector = typeof options.selector !== 'undefined' ? options.selector : '';
|
1247
|
+
var toggle_state = typeof options.toggle_state !== 'undefined' ? options.toggle_state : '';
|
1248
|
+
var $accordion = typeof options.$accordion !== 'undefined' ? options.$accordion : this.S(this.scope).closest('[' + this.attr_name() + ']');
|
1249
|
+
|
1250
|
+
var $items = $accordion.find('> dd' + selector + ', > li' + selector);
|
1251
|
+
if ( $items.length < 1 ) {
|
1252
|
+
if ( window.console ) {
|
1253
|
+
console.error('Selection not found.', selector);
|
1254
|
+
}
|
1255
|
+
return false;
|
1256
|
+
}
|
1257
|
+
|
1258
|
+
var S = this.S;
|
1259
|
+
var active_class = this.settings.active_class;
|
1260
|
+
$items.each(function() {
|
1261
|
+
var $item = S(this);
|
1262
|
+
var is_active = $item.hasClass(active_class);
|
1263
|
+
if ( ( is_active && toggle_state === 'close' ) || ( !is_active && toggle_state === 'open' ) || toggle_state === '' ) {
|
1264
|
+
$item.find('> a').trigger('click.fndtn.accordion');
|
1265
|
+
}
|
1266
|
+
});
|
1267
|
+
},
|
1268
|
+
|
1269
|
+
open : function(options) {
|
1270
|
+
var options = typeof options !== 'undefined' ? options : {};
|
1271
|
+
options.toggle_state = 'open';
|
1272
|
+
this.toggle(options);
|
1273
|
+
},
|
1274
|
+
|
1275
|
+
close : function(options) {
|
1276
|
+
var options = typeof options !== 'undefined' ? options : {};
|
1277
|
+
options.toggle_state = 'close';
|
1278
|
+
this.toggle(options);
|
1279
|
+
},
|
1280
|
+
|
1085
1281
|
off : function () {},
|
1086
1282
|
|
1087
1283
|
reflow : function () {}
|
@@ -1094,10 +1290,10 @@
|
|
1094
1290
|
Foundation.libs.alert = {
|
1095
1291
|
name : 'alert',
|
1096
1292
|
|
1097
|
-
version : '5.5.
|
1293
|
+
version : '5.5.3',
|
1098
1294
|
|
1099
1295
|
settings : {
|
1100
|
-
callback: function (){}
|
1296
|
+
callback : function () {}
|
1101
1297
|
},
|
1102
1298
|
|
1103
1299
|
init : function (scope, method, options) {
|
@@ -1115,13 +1311,13 @@
|
|
1115
1311
|
e.preventDefault();
|
1116
1312
|
if (Modernizr.csstransitions) {
|
1117
1313
|
alertBox.addClass('alert-close');
|
1118
|
-
alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function(e) {
|
1119
|
-
S(this).trigger('close
|
1314
|
+
alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function (e) {
|
1315
|
+
S(this).trigger('close.fndtn.alert').remove();
|
1120
1316
|
settings.callback();
|
1121
1317
|
});
|
1122
1318
|
} else {
|
1123
1319
|
alertBox.fadeOut(300, function () {
|
1124
|
-
S(this).trigger('close
|
1320
|
+
S(this).trigger('close.fndtn.alert').remove();
|
1125
1321
|
settings.callback();
|
1126
1322
|
});
|
1127
1323
|
}
|
@@ -1138,14 +1334,16 @@
|
|
1138
1334
|
Foundation.libs.clearing = {
|
1139
1335
|
name : 'clearing',
|
1140
1336
|
|
1141
|
-
version: '5.5.
|
1337
|
+
version : '5.5.3',
|
1142
1338
|
|
1143
1339
|
settings : {
|
1144
1340
|
templates : {
|
1145
1341
|
viewing : '<a href="#" class="clearing-close">×</a>' +
|
1146
1342
|
'<div class="visible-img" style="display: none"><div class="clearing-touch-label"></div><img src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />' +
|
1147
1343
|
'<p class="clearing-caption"></p><a href="#" class="clearing-main-prev"><span></span></a>' +
|
1148
|
-
'<a href="#" class="clearing-main-next"><span></span></a></div>'
|
1344
|
+
'<a href="#" class="clearing-main-next"><span></span></a></div>' +
|
1345
|
+
'<img class="clearing-preload-next" style="display: none" src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />' +
|
1346
|
+
'<img class="clearing-preload-prev" style="display: none" src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />'
|
1149
1347
|
},
|
1150
1348
|
|
1151
1349
|
// comma delimited list of selectors that, on click, will close clearing,
|
@@ -1160,7 +1358,7 @@
|
|
1160
1358
|
|
1161
1359
|
touch_label : '',
|
1162
1360
|
|
1163
|
-
// event
|
1361
|
+
// event initializer and locks
|
1164
1362
|
init : false,
|
1165
1363
|
locked : false
|
1166
1364
|
},
|
@@ -1241,23 +1439,27 @@
|
|
1241
1439
|
S = self.S;
|
1242
1440
|
|
1243
1441
|
S(this.scope)
|
1244
|
-
.on('touchstart.fndtn.clearing', '.visible-img', function(e) {
|
1442
|
+
.on('touchstart.fndtn.clearing', '.visible-img', function (e) {
|
1245
1443
|
if (!e.touches) { e = e.originalEvent; }
|
1246
1444
|
var data = {
|
1247
|
-
start_page_x: e.touches[0].pageX,
|
1248
|
-
start_page_y: e.touches[0].pageY,
|
1249
|
-
start_time: (new Date()).getTime(),
|
1250
|
-
delta_x: 0,
|
1251
|
-
is_scrolling: undefined
|
1445
|
+
start_page_x : e.touches[0].pageX,
|
1446
|
+
start_page_y : e.touches[0].pageY,
|
1447
|
+
start_time : (new Date()).getTime(),
|
1448
|
+
delta_x : 0,
|
1449
|
+
is_scrolling : undefined
|
1252
1450
|
};
|
1253
1451
|
|
1254
1452
|
S(this).data('swipe-transition', data);
|
1255
1453
|
e.stopPropagation();
|
1256
1454
|
})
|
1257
|
-
.on('touchmove.fndtn.clearing', '.visible-img', function(e) {
|
1258
|
-
if (!e.touches) {
|
1455
|
+
.on('touchmove.fndtn.clearing', '.visible-img', function (e) {
|
1456
|
+
if (!e.touches) {
|
1457
|
+
e = e.originalEvent;
|
1458
|
+
}
|
1259
1459
|
// Ignore pinch/zoom events
|
1260
|
-
if(e.touches.length > 1 || e.scale && e.scale !== 1)
|
1460
|
+
if (e.touches.length > 1 || e.scale && e.scale !== 1) {
|
1461
|
+
return;
|
1462
|
+
}
|
1261
1463
|
|
1262
1464
|
var data = S(this).data('swipe-transition');
|
1263
1465
|
|
@@ -1282,7 +1484,7 @@
|
|
1282
1484
|
self.nav(e, direction);
|
1283
1485
|
}
|
1284
1486
|
})
|
1285
|
-
.on('touchend.fndtn.clearing', '.visible-img', function(e) {
|
1487
|
+
.on('touchend.fndtn.clearing', '.visible-img', function (e) {
|
1286
1488
|
S(this).data('swipe-transition', {});
|
1287
1489
|
e.stopPropagation();
|
1288
1490
|
});
|
@@ -1309,8 +1511,8 @@
|
|
1309
1511
|
var holder = this.S('#foundationClearingHolder'),
|
1310
1512
|
settings = $el.data(this.attr_name(true) + '-init'),
|
1311
1513
|
data = {
|
1312
|
-
grid: '<div class="carousel">' + grid_outerHTML + '</div>',
|
1313
|
-
viewing: settings.templates.viewing
|
1514
|
+
grid : '<div class="carousel">' + grid_outerHTML + '</div>',
|
1515
|
+
viewing : settings.templates.viewing
|
1314
1516
|
},
|
1315
1517
|
wrapper = '<div class="clearing-assembled"><div>' + data.viewing +
|
1316
1518
|
data.grid + '</div></div>',
|
@@ -1331,10 +1533,11 @@
|
|
1331
1533
|
visible_image = self.S('.visible-img', container),
|
1332
1534
|
image = self.S('img', visible_image).not($image),
|
1333
1535
|
label = self.S('.clearing-touch-label', container),
|
1334
|
-
error = false
|
1536
|
+
error = false,
|
1537
|
+
loaded = {};
|
1335
1538
|
|
1336
1539
|
// Event to disable scrolling on touch devices when Clearing is activated
|
1337
|
-
$('body').on('touchmove',function(e){
|
1540
|
+
$('body').on('touchmove', function (e) {
|
1338
1541
|
e.preventDefault();
|
1339
1542
|
});
|
1340
1543
|
|
@@ -1357,6 +1560,7 @@
|
|
1357
1560
|
function cb (image) {
|
1358
1561
|
var $image = $(image);
|
1359
1562
|
$image.css('visibility', 'visible');
|
1563
|
+
$image.trigger('imageVisible');
|
1360
1564
|
// toggle the gallery
|
1361
1565
|
body.css('overflow', 'hidden');
|
1362
1566
|
root.addClass('clearing-blackout');
|
@@ -1375,9 +1579,17 @@
|
|
1375
1579
|
if (!this.locked()) {
|
1376
1580
|
visible_image.trigger('open.fndtn.clearing');
|
1377
1581
|
// set the image to the selected thumbnail
|
1378
|
-
image
|
1379
|
-
|
1380
|
-
|
1582
|
+
loaded = this.load($image);
|
1583
|
+
if (loaded.interchange) {
|
1584
|
+
image
|
1585
|
+
.attr('data-interchange', loaded.interchange)
|
1586
|
+
.foundation('interchange', 'reflow');
|
1587
|
+
} else {
|
1588
|
+
image
|
1589
|
+
.attr('src', loaded.src)
|
1590
|
+
.attr('data-interchange', '');
|
1591
|
+
}
|
1592
|
+
image.css('visibility', 'hidden');
|
1381
1593
|
|
1382
1594
|
startLoad.call(this);
|
1383
1595
|
}
|
@@ -1425,9 +1637,15 @@
|
|
1425
1637
|
PREV_KEY = this.rtl ? 39 : 37,
|
1426
1638
|
ESC_KEY = 27;
|
1427
1639
|
|
1428
|
-
if (e.which === NEXT_KEY)
|
1429
|
-
|
1430
|
-
|
1640
|
+
if (e.which === NEXT_KEY) {
|
1641
|
+
this.go(clearing, 'next');
|
1642
|
+
}
|
1643
|
+
if (e.which === PREV_KEY) {
|
1644
|
+
this.go(clearing, 'prev');
|
1645
|
+
}
|
1646
|
+
if (e.which === ESC_KEY) {
|
1647
|
+
this.S('a.clearing-close').trigger('click.fndtn.clearing');
|
1648
|
+
}
|
1431
1649
|
},
|
1432
1650
|
|
1433
1651
|
nav : function (e, direction) {
|
@@ -1505,35 +1723,55 @@
|
|
1505
1723
|
// image loading and preloading
|
1506
1724
|
|
1507
1725
|
load : function ($image) {
|
1508
|
-
var href
|
1726
|
+
var href,
|
1727
|
+
interchange,
|
1728
|
+
closest_a;
|
1509
1729
|
|
1510
1730
|
if ($image[0].nodeName === 'A') {
|
1511
1731
|
href = $image.attr('href');
|
1732
|
+
interchange = $image.data('clearing-interchange');
|
1512
1733
|
} else {
|
1513
|
-
|
1734
|
+
closest_a = $image.closest('a');
|
1735
|
+
href = closest_a.attr('href');
|
1736
|
+
interchange = closest_a.data('clearing-interchange');
|
1514
1737
|
}
|
1515
1738
|
|
1516
1739
|
this.preload($image);
|
1517
1740
|
|
1518
|
-
|
1519
|
-
|
1741
|
+
return {
|
1742
|
+
'src': href ? href : $image.attr('src'),
|
1743
|
+
'interchange': href ? interchange : $image.data('clearing-interchange')
|
1744
|
+
}
|
1520
1745
|
},
|
1521
1746
|
|
1522
1747
|
preload : function ($image) {
|
1523
1748
|
this
|
1524
|
-
.img($image.closest('li').next())
|
1525
|
-
.img($image.closest('li').prev());
|
1749
|
+
.img($image.closest('li').next(), 'next')
|
1750
|
+
.img($image.closest('li').prev(), 'prev');
|
1526
1751
|
},
|
1527
1752
|
|
1528
|
-
img : function (img) {
|
1753
|
+
img : function (img, sibling_type) {
|
1529
1754
|
if (img.length) {
|
1530
|
-
var
|
1531
|
-
new_a = this.S('a', img)
|
1755
|
+
var preload_img = $('.clearing-preload-' + sibling_type),
|
1756
|
+
new_a = this.S('a', img),
|
1757
|
+
src,
|
1758
|
+
interchange,
|
1759
|
+
image;
|
1532
1760
|
|
1533
1761
|
if (new_a.length) {
|
1534
|
-
|
1762
|
+
src = new_a.attr('href');
|
1763
|
+
interchange = new_a.data('clearing-interchange');
|
1535
1764
|
} else {
|
1536
|
-
|
1765
|
+
image = this.S('img', img);
|
1766
|
+
src = image.attr('src');
|
1767
|
+
interchange = image.data('clearing-interchange');
|
1768
|
+
}
|
1769
|
+
|
1770
|
+
if (interchange) {
|
1771
|
+
preload_img.attr('data-interchange', interchange);
|
1772
|
+
} else {
|
1773
|
+
preload_img.attr('src', src);
|
1774
|
+
preload_img.attr('data-interchange', '');
|
1537
1775
|
}
|
1538
1776
|
}
|
1539
1777
|
return this;
|
@@ -1545,9 +1783,9 @@
|
|
1545
1783
|
var caption = $image.attr('data-caption');
|
1546
1784
|
|
1547
1785
|
if (caption) {
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1786
|
+
var containerPlain = container.get(0);
|
1787
|
+
containerPlain.innerHTML = caption;
|
1788
|
+
container.show();
|
1551
1789
|
} else {
|
1552
1790
|
container
|
1553
1791
|
.text('')
|
@@ -1569,7 +1807,7 @@
|
|
1569
1807
|
|
1570
1808
|
if (target.length) {
|
1571
1809
|
this.S('img', target)
|
1572
|
-
.trigger('click
|
1810
|
+
.trigger('click.fndtn.clearing', [current, target])
|
1573
1811
|
.trigger('change.fndtn.clearing');
|
1574
1812
|
}
|
1575
1813
|
},
|
@@ -1588,7 +1826,7 @@
|
|
1588
1826
|
// we use jQuery animate instead of CSS transitions because we
|
1589
1827
|
// need a callback to unlock the next animation
|
1590
1828
|
// needs support for RTL **
|
1591
|
-
if (target.index() !== old_index && !/skip/.test(direction)){
|
1829
|
+
if (target.index() !== old_index && !/skip/.test(direction)) {
|
1592
1830
|
if (/left/.test(direction)) {
|
1593
1831
|
this.lock();
|
1594
1832
|
dir_obj[dir] = left + width;
|
@@ -1644,7 +1882,9 @@
|
|
1644
1882
|
|
1645
1883
|
adjacent : function (current_index, target_index) {
|
1646
1884
|
for (var i = target_index + 1; i >= target_index - 1; i--) {
|
1647
|
-
if (i === current_index)
|
1885
|
+
if (i === current_index) {
|
1886
|
+
return true;
|
1887
|
+
}
|
1648
1888
|
}
|
1649
1889
|
return false;
|
1650
1890
|
},
|
@@ -1681,17 +1921,17 @@
|
|
1681
1921
|
Foundation.libs.dropdown = {
|
1682
1922
|
name : 'dropdown',
|
1683
1923
|
|
1684
|
-
version : '5.5.
|
1924
|
+
version : '5.5.3',
|
1685
1925
|
|
1686
1926
|
settings : {
|
1687
|
-
active_class: 'open',
|
1688
|
-
disabled_class: 'disabled',
|
1689
|
-
mega_class: 'mega',
|
1690
|
-
align: 'bottom',
|
1691
|
-
is_hover: false,
|
1692
|
-
hover_timeout: 150,
|
1693
|
-
opened: function(){},
|
1694
|
-
closed: function(){}
|
1927
|
+
active_class : 'open',
|
1928
|
+
disabled_class : 'disabled',
|
1929
|
+
mega_class : 'mega',
|
1930
|
+
align : 'bottom',
|
1931
|
+
is_hover : false,
|
1932
|
+
hover_timeout : 150,
|
1933
|
+
opened : function () {},
|
1934
|
+
closed : function () {}
|
1695
1935
|
},
|
1696
1936
|
|
1697
1937
|
init : function (scope, method, options) {
|
@@ -1711,7 +1951,7 @@
|
|
1711
1951
|
var settings = S(this).data(self.attr_name(true) + '-init') || self.settings;
|
1712
1952
|
if (!settings.is_hover || Modernizr.touch) {
|
1713
1953
|
e.preventDefault();
|
1714
|
-
if (S(this).parent('[data-reveal-id]')) {
|
1954
|
+
if (S(this).parent('[data-reveal-id]').length) {
|
1715
1955
|
e.stopPropagation();
|
1716
1956
|
}
|
1717
1957
|
self.toggle($(this));
|
@@ -1734,11 +1974,13 @@
|
|
1734
1974
|
|
1735
1975
|
var settings = target.data(self.attr_name(true) + '-init') || self.settings;
|
1736
1976
|
|
1737
|
-
if(S(e.currentTarget).data(self.data_attr()) && settings.is_hover) {
|
1977
|
+
if (S(e.currentTarget).data(self.data_attr()) && settings.is_hover) {
|
1738
1978
|
self.closeall.call(self);
|
1739
1979
|
}
|
1740
1980
|
|
1741
|
-
if (settings.is_hover)
|
1981
|
+
if (settings.is_hover) {
|
1982
|
+
self.open.apply(self, [dropdown, target]);
|
1983
|
+
}
|
1742
1984
|
})
|
1743
1985
|
.on('mouseleave.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) {
|
1744
1986
|
var $this = S(this);
|
@@ -1746,17 +1988,20 @@
|
|
1746
1988
|
|
1747
1989
|
if ($this.data(self.data_attr())) {
|
1748
1990
|
settings = $this.data(self.data_attr(true) + '-init') || self.settings;
|
1749
|
-
}
|
1750
|
-
else {
|
1991
|
+
} else {
|
1751
1992
|
var target = S('[' + self.attr_name() + '="' + S(this).attr('id') + '"]'),
|
1752
1993
|
settings = target.data(self.attr_name(true) + '-init') || self.settings;
|
1753
1994
|
}
|
1754
1995
|
|
1755
1996
|
self.timeout = setTimeout(function () {
|
1756
1997
|
if ($this.data(self.data_attr())) {
|
1757
|
-
if (settings.is_hover)
|
1998
|
+
if (settings.is_hover) {
|
1999
|
+
self.close.call(self, S('#' + $this.data(self.data_attr())));
|
2000
|
+
}
|
1758
2001
|
} else {
|
1759
|
-
if (settings.is_hover)
|
2002
|
+
if (settings.is_hover) {
|
2003
|
+
self.close.call(self, $this);
|
2004
|
+
}
|
1760
2005
|
}
|
1761
2006
|
}.bind(this), settings.hover_timeout);
|
1762
2007
|
})
|
@@ -1764,7 +2009,7 @@
|
|
1764
2009
|
var parent = S(e.target).closest('[' + self.attr_name() + '-content]');
|
1765
2010
|
var links = parent.find('a');
|
1766
2011
|
|
1767
|
-
if (links.length > 0 && parent.attr('aria-autoclose') !==
|
2012
|
+
if (links.length > 0 && parent.attr('aria-autoclose') !== 'false') {
|
1768
2013
|
self.close.call(self, S('[' + self.attr_name() + '-content]'));
|
1769
2014
|
}
|
1770
2015
|
|
@@ -1801,46 +2046,46 @@
|
|
1801
2046
|
this.resize();
|
1802
2047
|
},
|
1803
2048
|
|
1804
|
-
close: function (dropdown) {
|
2049
|
+
close : function (dropdown) {
|
1805
2050
|
var self = this;
|
1806
|
-
dropdown.each(function () {
|
1807
|
-
var original_target = $('[' + self.attr_name() + '=' + dropdown[
|
2051
|
+
dropdown.each(function (idx) {
|
2052
|
+
var original_target = $('[' + self.attr_name() + '=' + dropdown[idx].id + ']') || $('aria-controls=' + dropdown[idx].id + ']');
|
1808
2053
|
original_target.attr('aria-expanded', 'false');
|
1809
2054
|
if (self.S(this).hasClass(self.settings.active_class)) {
|
1810
2055
|
self.S(this)
|
1811
|
-
.css(Foundation.rtl ? 'right':'left', '-99999px')
|
2056
|
+
.css(Foundation.rtl ? 'right' : 'left', '-99999px')
|
1812
2057
|
.attr('aria-hidden', 'true')
|
1813
2058
|
.removeClass(self.settings.active_class)
|
1814
2059
|
.prev('[' + self.attr_name() + ']')
|
1815
2060
|
.removeClass(self.settings.active_class)
|
1816
2061
|
.removeData('target');
|
1817
2062
|
|
1818
|
-
self.S(this).trigger('closed
|
2063
|
+
self.S(this).trigger('closed.fndtn.dropdown', [dropdown]);
|
1819
2064
|
}
|
1820
2065
|
});
|
1821
2066
|
dropdown.removeClass('f-open-' + this.attr_name(true));
|
1822
2067
|
},
|
1823
2068
|
|
1824
|
-
closeall: function() {
|
2069
|
+
closeall : function () {
|
1825
2070
|
var self = this;
|
1826
|
-
$.each(self.S('.f-open-' + this.attr_name(true)), function() {
|
2071
|
+
$.each(self.S('.f-open-' + this.attr_name(true)), function () {
|
1827
2072
|
self.close.call(self, self.S(this));
|
1828
2073
|
});
|
1829
2074
|
},
|
1830
2075
|
|
1831
|
-
open: function (dropdown, target) {
|
2076
|
+
open : function (dropdown, target) {
|
1832
2077
|
this
|
1833
2078
|
.css(dropdown
|
1834
2079
|
.addClass(this.settings.active_class), target);
|
1835
2080
|
dropdown.prev('[' + this.attr_name() + ']').addClass(this.settings.active_class);
|
1836
|
-
dropdown.data('target', target.get(0)).trigger('opened
|
2081
|
+
dropdown.data('target', target.get(0)).trigger('opened.fndtn.dropdown', [dropdown, target]);
|
1837
2082
|
dropdown.attr('aria-hidden', 'false');
|
1838
2083
|
target.attr('aria-expanded', 'true');
|
1839
2084
|
dropdown.focus();
|
1840
2085
|
dropdown.addClass('f-open-' + this.attr_name(true));
|
1841
2086
|
},
|
1842
2087
|
|
1843
|
-
data_attr: function () {
|
2088
|
+
data_attr : function () {
|
1844
2089
|
if (this.namespace.length > 0) {
|
1845
2090
|
return this.namespace + '-' + this.name;
|
1846
2091
|
}
|
@@ -1862,16 +2107,17 @@
|
|
1862
2107
|
|
1863
2108
|
if (dropdown.hasClass(this.settings.active_class)) {
|
1864
2109
|
this.close.call(this, dropdown);
|
1865
|
-
if (dropdown.data('target') !== target.get(0))
|
2110
|
+
if (dropdown.data('target') !== target.get(0)) {
|
1866
2111
|
this.open.call(this, dropdown, target);
|
2112
|
+
}
|
1867
2113
|
} else {
|
1868
2114
|
this.open.call(this, dropdown, target);
|
1869
2115
|
}
|
1870
2116
|
},
|
1871
2117
|
|
1872
2118
|
resize : function () {
|
1873
|
-
var dropdown = this.S('[' + this.attr_name() + '-content].open')
|
1874
|
-
|
2119
|
+
var dropdown = this.S('[' + this.attr_name() + '-content].open');
|
2120
|
+
var target = $(dropdown.data("target"));
|
1875
2121
|
|
1876
2122
|
if (dropdown.length && target.length) {
|
1877
2123
|
this.css(dropdown, target);
|
@@ -1880,22 +2126,37 @@
|
|
1880
2126
|
|
1881
2127
|
css : function (dropdown, target) {
|
1882
2128
|
var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8),
|
1883
|
-
settings = target.data(this.attr_name(true) + '-init') || this.settings
|
2129
|
+
settings = target.data(this.attr_name(true) + '-init') || this.settings,
|
2130
|
+
parentOverflow = dropdown.parent().css('overflow-y') || dropdown.parent().css('overflow');
|
1884
2131
|
|
1885
2132
|
this.clear_idx();
|
1886
2133
|
|
2134
|
+
|
2135
|
+
|
1887
2136
|
if (this.small()) {
|
1888
2137
|
var p = this.dirs.bottom.call(dropdown, target, settings);
|
1889
2138
|
|
1890
2139
|
dropdown.attr('style', '').removeClass('drop-left drop-right drop-top').css({
|
1891
2140
|
position : 'absolute',
|
1892
|
-
width: '95%',
|
1893
|
-
'max-width': 'none',
|
1894
|
-
top: p.top
|
2141
|
+
width : '95%',
|
2142
|
+
'max-width' : 'none',
|
2143
|
+
top : p.top
|
1895
2144
|
});
|
1896
2145
|
|
1897
|
-
dropdown.css(Foundation.rtl ? 'right':'left', left_offset);
|
1898
|
-
}
|
2146
|
+
dropdown.css(Foundation.rtl ? 'right' : 'left', left_offset);
|
2147
|
+
}
|
2148
|
+
// detect if dropdown is in an overflow container
|
2149
|
+
else if (parentOverflow !== 'visible') {
|
2150
|
+
var offset = target[0].offsetTop + target[0].offsetHeight;
|
2151
|
+
|
2152
|
+
dropdown.attr('style', '').css({
|
2153
|
+
position : 'absolute',
|
2154
|
+
top : offset
|
2155
|
+
});
|
2156
|
+
|
2157
|
+
dropdown.css(Foundation.rtl ? 'right' : 'left', left_offset);
|
2158
|
+
}
|
2159
|
+
else {
|
1899
2160
|
|
1900
2161
|
this.style(dropdown, target, settings);
|
1901
2162
|
}
|
@@ -1904,7 +2165,7 @@
|
|
1904
2165
|
},
|
1905
2166
|
|
1906
2167
|
style : function (dropdown, target, settings) {
|
1907
|
-
var css = $.extend({position: 'absolute'},
|
2168
|
+
var css = $.extend({position : 'absolute'},
|
1908
2169
|
this.dirs[settings.align].call(dropdown, target, settings));
|
1909
2170
|
|
1910
2171
|
dropdown.attr('style', '').css(css);
|
@@ -1914,48 +2175,53 @@
|
|
1914
2175
|
// `this` is the dropdown
|
1915
2176
|
dirs : {
|
1916
2177
|
// Calculate target offset
|
1917
|
-
_base : function (t) {
|
2178
|
+
_base : function (t, s) {
|
1918
2179
|
var o_p = this.offsetParent(),
|
1919
2180
|
o = o_p.offset(),
|
1920
2181
|
p = t.offset();
|
1921
2182
|
|
1922
2183
|
p.top -= o.top;
|
1923
2184
|
p.left -= o.left;
|
1924
|
-
|
2185
|
+
|
1925
2186
|
//set some flags on the p object to pass along
|
1926
2187
|
p.missRight = false;
|
1927
2188
|
p.missTop = false;
|
1928
2189
|
p.missLeft = false;
|
1929
2190
|
p.leftRightFlag = false;
|
1930
|
-
|
2191
|
+
|
1931
2192
|
//lets see if the panel will be off the screen
|
1932
2193
|
//get the actual width of the page and store it
|
1933
2194
|
var actualBodyWidth;
|
2195
|
+
var windowWidth = window.innerWidth;
|
2196
|
+
|
1934
2197
|
if (document.getElementsByClassName('row')[0]) {
|
1935
2198
|
actualBodyWidth = document.getElementsByClassName('row')[0].clientWidth;
|
1936
2199
|
} else {
|
1937
|
-
actualBodyWidth =
|
2200
|
+
actualBodyWidth = windowWidth;
|
1938
2201
|
}
|
1939
2202
|
|
1940
|
-
var actualMarginWidth = (
|
2203
|
+
var actualMarginWidth = (windowWidth - actualBodyWidth) / 2;
|
1941
2204
|
var actualBoundary = actualBodyWidth;
|
1942
|
-
|
1943
|
-
if (!this.hasClass('mega')) {
|
2205
|
+
|
2206
|
+
if (!this.hasClass('mega') && !s.ignore_repositioning) {
|
2207
|
+
var outerWidth = this.outerWidth();
|
2208
|
+
var o_left = t.offset().left;
|
2209
|
+
|
1944
2210
|
//miss top
|
1945
2211
|
if (t.offset().top <= this.outerHeight()) {
|
1946
2212
|
p.missTop = true;
|
1947
|
-
actualBoundary =
|
2213
|
+
actualBoundary = windowWidth - actualMarginWidth;
|
1948
2214
|
p.leftRightFlag = true;
|
1949
2215
|
}
|
1950
|
-
|
2216
|
+
|
1951
2217
|
//miss right
|
1952
|
-
if (
|
2218
|
+
if (o_left + outerWidth > o_left + actualMarginWidth && o_left - actualMarginWidth > outerWidth) {
|
1953
2219
|
p.missRight = true;
|
1954
2220
|
p.missLeft = false;
|
1955
2221
|
}
|
1956
|
-
|
2222
|
+
|
1957
2223
|
//miss left
|
1958
|
-
if (
|
2224
|
+
if (o_left - outerWidth <= 0) {
|
1959
2225
|
p.missLeft = true;
|
1960
2226
|
p.missRight = false;
|
1961
2227
|
}
|
@@ -1964,71 +2230,71 @@
|
|
1964
2230
|
return p;
|
1965
2231
|
},
|
1966
2232
|
|
1967
|
-
top: function (t, s) {
|
2233
|
+
top : function (t, s) {
|
1968
2234
|
var self = Foundation.libs.dropdown,
|
1969
|
-
p = self.dirs._base.call(this, t);
|
2235
|
+
p = self.dirs._base.call(this, t, s);
|
1970
2236
|
|
1971
2237
|
this.addClass('drop-top');
|
1972
|
-
|
2238
|
+
|
1973
2239
|
if (p.missTop == true) {
|
1974
2240
|
p.top = p.top + t.outerHeight() + this.outerHeight();
|
1975
2241
|
this.removeClass('drop-top');
|
1976
2242
|
}
|
1977
|
-
|
2243
|
+
|
1978
2244
|
if (p.missRight == true) {
|
1979
2245
|
p.left = p.left - this.outerWidth() + t.outerWidth();
|
1980
2246
|
}
|
1981
2247
|
|
1982
2248
|
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
|
1983
|
-
self.adjust_pip(this,t,s,p);
|
2249
|
+
self.adjust_pip(this, t, s, p);
|
1984
2250
|
}
|
1985
2251
|
|
1986
2252
|
if (Foundation.rtl) {
|
1987
|
-
return {left: p.left - this.outerWidth() + t.outerWidth(),
|
1988
|
-
top: p.top - this.outerHeight()};
|
2253
|
+
return {left : p.left - this.outerWidth() + t.outerWidth(),
|
2254
|
+
top : p.top - this.outerHeight()};
|
1989
2255
|
}
|
1990
2256
|
|
1991
|
-
return {left: p.left, top: p.top - this.outerHeight()};
|
2257
|
+
return {left : p.left, top : p.top - this.outerHeight()};
|
1992
2258
|
},
|
1993
2259
|
|
1994
|
-
bottom: function (t,s) {
|
2260
|
+
bottom : function (t, s) {
|
1995
2261
|
var self = Foundation.libs.dropdown,
|
1996
|
-
p = self.dirs._base.call(this, t);
|
2262
|
+
p = self.dirs._base.call(this, t, s);
|
1997
2263
|
|
1998
2264
|
if (p.missRight == true) {
|
1999
2265
|
p.left = p.left - this.outerWidth() + t.outerWidth();
|
2000
2266
|
}
|
2001
2267
|
|
2002
2268
|
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
|
2003
|
-
self.adjust_pip(this,t,s,p);
|
2269
|
+
self.adjust_pip(this, t, s, p);
|
2004
2270
|
}
|
2005
2271
|
|
2006
2272
|
if (self.rtl) {
|
2007
|
-
return {left: p.left - this.outerWidth() + t.outerWidth(), top: p.top + t.outerHeight()};
|
2273
|
+
return {left : p.left - this.outerWidth() + t.outerWidth(), top : p.top + t.outerHeight()};
|
2008
2274
|
}
|
2009
2275
|
|
2010
|
-
return {left: p.left, top: p.top + t.outerHeight()};
|
2276
|
+
return {left : p.left, top : p.top + t.outerHeight()};
|
2011
2277
|
},
|
2012
2278
|
|
2013
|
-
left: function (t, s) {
|
2014
|
-
var p = Foundation.libs.dropdown.dirs._base.call(this, t);
|
2279
|
+
left : function (t, s) {
|
2280
|
+
var p = Foundation.libs.dropdown.dirs._base.call(this, t, s);
|
2015
2281
|
|
2016
2282
|
this.addClass('drop-left');
|
2017
|
-
|
2283
|
+
|
2018
2284
|
if (p.missLeft == true) {
|
2019
2285
|
p.left = p.left + this.outerWidth();
|
2020
2286
|
p.top = p.top + t.outerHeight();
|
2021
2287
|
this.removeClass('drop-left');
|
2022
2288
|
}
|
2023
2289
|
|
2024
|
-
return {left: p.left - this.outerWidth(), top: p.top};
|
2290
|
+
return {left : p.left - this.outerWidth(), top : p.top};
|
2025
2291
|
},
|
2026
2292
|
|
2027
|
-
right: function (t, s) {
|
2028
|
-
var p = Foundation.libs.dropdown.dirs._base.call(this, t);
|
2293
|
+
right : function (t, s) {
|
2294
|
+
var p = Foundation.libs.dropdown.dirs._base.call(this, t, s);
|
2029
2295
|
|
2030
2296
|
this.addClass('drop-right');
|
2031
|
-
|
2297
|
+
|
2032
2298
|
if (p.missRight == true) {
|
2033
2299
|
p.left = p.left - this.outerWidth();
|
2034
2300
|
p.top = p.top + t.outerHeight();
|
@@ -2036,26 +2302,25 @@
|
|
2036
2302
|
} else {
|
2037
2303
|
p.triggeredRight = true;
|
2038
2304
|
}
|
2039
|
-
|
2305
|
+
|
2040
2306
|
var self = Foundation.libs.dropdown;
|
2041
2307
|
|
2042
2308
|
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
|
2043
|
-
self.adjust_pip(this,t,s,p);
|
2309
|
+
self.adjust_pip(this, t, s, p);
|
2044
2310
|
}
|
2045
2311
|
|
2046
|
-
return {left: p.left + t.outerWidth(), top: p.top};
|
2312
|
+
return {left : p.left + t.outerWidth(), top : p.top};
|
2047
2313
|
}
|
2048
2314
|
},
|
2049
2315
|
|
2050
2316
|
// Insert rule to style psuedo elements
|
2051
|
-
adjust_pip : function (dropdown,target,settings,position) {
|
2317
|
+
adjust_pip : function (dropdown, target, settings, position) {
|
2052
2318
|
var sheet = Foundation.stylesheet,
|
2053
2319
|
pip_offset_base = 8;
|
2054
2320
|
|
2055
2321
|
if (dropdown.hasClass(settings.mega_class)) {
|
2056
|
-
pip_offset_base = position.left + (target.outerWidth()/2) - 8;
|
2057
|
-
}
|
2058
|
-
else if (this.small()) {
|
2322
|
+
pip_offset_base = position.left + (target.outerWidth() / 2) - 8;
|
2323
|
+
} else if (this.small()) {
|
2059
2324
|
pip_offset_base += position.left - 8;
|
2060
2325
|
}
|
2061
2326
|
|
@@ -2066,7 +2331,7 @@
|
|
2066
2331
|
sel_after = '.f-dropdown.open:after',
|
2067
2332
|
css_before = 'left: ' + pip_offset_base + 'px;',
|
2068
2333
|
css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
|
2069
|
-
|
2334
|
+
|
2070
2335
|
if (position.missRight == true) {
|
2071
2336
|
pip_offset_base = dropdown.outerWidth() - 23;
|
2072
2337
|
sel_before = '.f-dropdown.open:before',
|
@@ -2074,7 +2339,7 @@
|
|
2074
2339
|
css_before = 'left: ' + pip_offset_base + 'px;',
|
2075
2340
|
css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
|
2076
2341
|
}
|
2077
|
-
|
2342
|
+
|
2078
2343
|
//just a case where right is fired, but its not missing right
|
2079
2344
|
if (position.triggeredRight == true) {
|
2080
2345
|
sel_before = '.f-dropdown.open:before',
|
@@ -2108,7 +2373,7 @@
|
|
2108
2373
|
!matchMedia(Foundation.media_queries.medium).matches;
|
2109
2374
|
},
|
2110
2375
|
|
2111
|
-
off: function () {
|
2376
|
+
off : function () {
|
2112
2377
|
this.S(this.scope).off('.fndtn.dropdown');
|
2113
2378
|
this.S('html, body').off('.fndtn.dropdown');
|
2114
2379
|
this.S(window).off('.fndtn.dropdown');
|
@@ -2125,13 +2390,14 @@
|
|
2125
2390
|
Foundation.libs.equalizer = {
|
2126
2391
|
name : 'equalizer',
|
2127
2392
|
|
2128
|
-
version : '5.5.
|
2393
|
+
version : '5.5.3',
|
2129
2394
|
|
2130
2395
|
settings : {
|
2131
|
-
use_tallest: true,
|
2132
|
-
before_height_change: $.noop,
|
2133
|
-
after_height_change: $.noop,
|
2134
|
-
equalize_on_stack: false
|
2396
|
+
use_tallest : true,
|
2397
|
+
before_height_change : $.noop,
|
2398
|
+
after_height_change : $.noop,
|
2399
|
+
equalize_on_stack : false,
|
2400
|
+
act_on_hidden_el: false
|
2135
2401
|
},
|
2136
2402
|
|
2137
2403
|
init : function (scope, method, options) {
|
@@ -2141,33 +2407,47 @@
|
|
2141
2407
|
},
|
2142
2408
|
|
2143
2409
|
events : function () {
|
2144
|
-
this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function(e){
|
2410
|
+
this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function (e) {
|
2145
2411
|
this.reflow();
|
2146
2412
|
}.bind(this));
|
2147
2413
|
},
|
2148
2414
|
|
2149
|
-
equalize: function(equalizer) {
|
2415
|
+
equalize : function (equalizer) {
|
2150
2416
|
var isStacked = false,
|
2151
|
-
|
2152
|
-
settings = equalizer.data(this.attr_name(true)+'-init')
|
2417
|
+
group = equalizer.data('equalizer'),
|
2418
|
+
settings = equalizer.data(this.attr_name(true)+'-init') || this.settings,
|
2419
|
+
vals,
|
2420
|
+
firstTopOffset;
|
2421
|
+
|
2422
|
+
if (settings.act_on_hidden_el) {
|
2423
|
+
vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]') : equalizer.find('['+this.attr_name()+'-watch]');
|
2424
|
+
}
|
2425
|
+
else {
|
2426
|
+
vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]:visible') : equalizer.find('['+this.attr_name()+'-watch]:visible');
|
2427
|
+
}
|
2428
|
+
|
2429
|
+
if (vals.length === 0) {
|
2430
|
+
return;
|
2431
|
+
}
|
2153
2432
|
|
2154
|
-
if (vals.length === 0) return;
|
2155
|
-
var firstTopOffset = vals.first().offset().top;
|
2156
2433
|
settings.before_height_change();
|
2157
|
-
equalizer.trigger('before-height-change
|
2434
|
+
equalizer.trigger('before-height-change.fndth.equalizer');
|
2158
2435
|
vals.height('inherit');
|
2159
|
-
vals.each(function(){
|
2160
|
-
var el = $(this);
|
2161
|
-
if (el.offset().top !== firstTopOffset) {
|
2162
|
-
isStacked = true;
|
2163
|
-
}
|
2164
|
-
});
|
2165
2436
|
|
2166
2437
|
if (settings.equalize_on_stack === false) {
|
2167
|
-
|
2168
|
-
|
2438
|
+
firstTopOffset = vals.first().offset().top;
|
2439
|
+
vals.each(function () {
|
2440
|
+
if ($(this).offset().top !== firstTopOffset) {
|
2441
|
+
isStacked = true;
|
2442
|
+
return false;
|
2443
|
+
}
|
2444
|
+
});
|
2445
|
+
if (isStacked) {
|
2446
|
+
return;
|
2447
|
+
}
|
2448
|
+
}
|
2169
2449
|
|
2170
|
-
var heights = vals.map(function(){ return $(this).outerHeight(false) }).get();
|
2450
|
+
var heights = vals.map(function () { return $(this).outerHeight(false) }).get();
|
2171
2451
|
|
2172
2452
|
if (settings.use_tallest) {
|
2173
2453
|
var max = Math.max.apply(null, heights);
|
@@ -2176,17 +2456,33 @@
|
|
2176
2456
|
var min = Math.min.apply(null, heights);
|
2177
2457
|
vals.css('height', min);
|
2178
2458
|
}
|
2459
|
+
|
2179
2460
|
settings.after_height_change();
|
2180
|
-
equalizer.trigger('after-height-change
|
2461
|
+
equalizer.trigger('after-height-change.fndtn.equalizer');
|
2181
2462
|
},
|
2182
2463
|
|
2183
2464
|
reflow : function () {
|
2184
2465
|
var self = this;
|
2185
2466
|
|
2186
|
-
this.S('[' + this.attr_name() + ']', this.scope).each(function(){
|
2187
|
-
var $eq_target = $(this)
|
2188
|
-
|
2189
|
-
|
2467
|
+
this.S('[' + this.attr_name() + ']', this.scope).each(function () {
|
2468
|
+
var $eq_target = $(this),
|
2469
|
+
media_query = $eq_target.data('equalizer-mq'),
|
2470
|
+
ignore_media_query = true;
|
2471
|
+
|
2472
|
+
if (media_query) {
|
2473
|
+
media_query = 'is_' + media_query.replace(/-/g, '_');
|
2474
|
+
if (Foundation.utils.hasOwnProperty(media_query)) {
|
2475
|
+
ignore_media_query = false;
|
2476
|
+
}
|
2477
|
+
}
|
2478
|
+
|
2479
|
+
self.image_loaded(self.S('img', this), function () {
|
2480
|
+
if (ignore_media_query || Foundation.utils[media_query]()) {
|
2481
|
+
self.equalize($eq_target)
|
2482
|
+
} else {
|
2483
|
+
var vals = $eq_target.find('[' + self.attr_name() + '-watch]:visible');
|
2484
|
+
vals.css('height', 'auto');
|
2485
|
+
}
|
2190
2486
|
});
|
2191
2487
|
});
|
2192
2488
|
}
|
@@ -2199,7 +2495,7 @@
|
|
2199
2495
|
Foundation.libs.interchange = {
|
2200
2496
|
name : 'interchange',
|
2201
2497
|
|
2202
|
-
version : '5.5.
|
2498
|
+
version : '5.5.3',
|
2203
2499
|
|
2204
2500
|
cache : {},
|
2205
2501
|
|
@@ -2231,7 +2527,7 @@
|
|
2231
2527
|
},
|
2232
2528
|
|
2233
2529
|
directives : {
|
2234
|
-
replace: function (el, path, trigger) {
|
2530
|
+
replace : function (el, path, trigger) {
|
2235
2531
|
// The trigger argument, if called within the directive, fires
|
2236
2532
|
// an event named after the directive on the element, passing
|
2237
2533
|
// any parameters along to the event that you pass to trigger.
|
@@ -2243,22 +2539,27 @@
|
|
2243
2539
|
// console.log($(this).html(), a, b, c);
|
2244
2540
|
// });
|
2245
2541
|
|
2246
|
-
if (/IMG/.test(el[0].nodeName)) {
|
2247
|
-
var orig_path = el
|
2542
|
+
if (el !== null && /IMG/.test(el[0].nodeName)) {
|
2543
|
+
var orig_path = $.each(el, function(){this.src = path;});
|
2544
|
+
// var orig_path = el[0].src;
|
2248
2545
|
|
2249
|
-
if (new RegExp(path, 'i').test(orig_path))
|
2546
|
+
if (new RegExp(path, 'i').test(orig_path)) {
|
2547
|
+
return;
|
2548
|
+
}
|
2250
2549
|
|
2251
|
-
el
|
2550
|
+
el.attr("src", path);
|
2252
2551
|
|
2253
2552
|
return trigger(el[0].src);
|
2254
2553
|
}
|
2255
2554
|
var last_path = el.data(this.data_attr + '-last-path'),
|
2256
2555
|
self = this;
|
2257
2556
|
|
2258
|
-
if (last_path == path)
|
2557
|
+
if (last_path == path) {
|
2558
|
+
return;
|
2559
|
+
}
|
2259
2560
|
|
2260
2561
|
if (/\.(gif|jpg|jpeg|tiff|png)([?#].*)?/i.test(path)) {
|
2261
|
-
$(el).css('background-image', 'url('+path+')');
|
2562
|
+
$(el).css('background-image', 'url(' + path + ')');
|
2262
2563
|
el.data('interchange-last-path', path);
|
2263
2564
|
return trigger(path);
|
2264
2565
|
}
|
@@ -2279,12 +2580,11 @@
|
|
2279
2580
|
this.data_attr = this.set_data_attr();
|
2280
2581
|
$.extend(true, this.settings, method, options);
|
2281
2582
|
this.bindings(method, options);
|
2282
|
-
this.
|
2283
|
-
this.load('nodes');
|
2583
|
+
this.reflow();
|
2284
2584
|
},
|
2285
2585
|
|
2286
|
-
get_media_hash : function() {
|
2287
|
-
var mediaHash='';
|
2586
|
+
get_media_hash : function () {
|
2587
|
+
var mediaHash = '';
|
2288
2588
|
for (var queryName in this.settings.named_queries ) {
|
2289
2589
|
mediaHash += matchMedia(this.settings.named_queries[queryName]).matches.toString();
|
2290
2590
|
}
|
@@ -2310,7 +2610,7 @@
|
|
2310
2610
|
resize : function () {
|
2311
2611
|
var cache = this.cache;
|
2312
2612
|
|
2313
|
-
if(!this.images_loaded || !this.nodes_loaded) {
|
2613
|
+
if (!this.images_loaded || !this.nodes_loaded) {
|
2314
2614
|
setTimeout($.proxy(this.resize, this), 50);
|
2315
2615
|
return;
|
2316
2616
|
}
|
@@ -2318,18 +2618,19 @@
|
|
2318
2618
|
for (var uuid in cache) {
|
2319
2619
|
if (cache.hasOwnProperty(uuid)) {
|
2320
2620
|
var passed = this.results(uuid, cache[uuid]);
|
2321
|
-
|
2322
2621
|
if (passed) {
|
2323
2622
|
this.settings.directives[passed
|
2324
|
-
.scenario[1]].call(this, passed.el, passed.scenario[0], function () {
|
2325
|
-
if (arguments[0] instanceof Array) {
|
2623
|
+
.scenario[1]].call(this, passed.el, passed.scenario[0], (function (passed) {
|
2624
|
+
if (arguments[0] instanceof Array) {
|
2326
2625
|
var args = arguments[0];
|
2327
|
-
} else {
|
2626
|
+
} else {
|
2328
2627
|
var args = Array.prototype.slice.call(arguments, 0);
|
2329
2628
|
}
|
2330
2629
|
|
2331
|
-
|
2332
|
-
|
2630
|
+
return function() {
|
2631
|
+
passed.el.trigger(passed.scenario[1], args);
|
2632
|
+
}
|
2633
|
+
}(passed)));
|
2333
2634
|
}
|
2334
2635
|
}
|
2335
2636
|
}
|
@@ -2350,7 +2651,7 @@
|
|
2350
2651
|
mq = matchMedia(rule);
|
2351
2652
|
}
|
2352
2653
|
if (mq.matches) {
|
2353
|
-
return {el: el, scenario: scenarios[count]};
|
2654
|
+
return {el : el, scenario : scenarios[count]};
|
2354
2655
|
}
|
2355
2656
|
}
|
2356
2657
|
}
|
@@ -2406,7 +2707,6 @@
|
|
2406
2707
|
this.cached_nodes = [];
|
2407
2708
|
this.nodes_loaded = (count === 0);
|
2408
2709
|
|
2409
|
-
|
2410
2710
|
while (i--) {
|
2411
2711
|
loaded_count++;
|
2412
2712
|
var str = nodes[i].getAttribute(data_attr) || '';
|
@@ -2415,7 +2715,7 @@
|
|
2415
2715
|
this.cached_nodes.push(nodes[i]);
|
2416
2716
|
}
|
2417
2717
|
|
2418
|
-
if(loaded_count === count) {
|
2718
|
+
if (loaded_count === count) {
|
2419
2719
|
this.nodes_loaded = true;
|
2420
2720
|
this.enhance('nodes');
|
2421
2721
|
}
|
@@ -2431,7 +2731,7 @@
|
|
2431
2731
|
this.object($(this['cached_' + type][i]));
|
2432
2732
|
}
|
2433
2733
|
|
2434
|
-
return $(window).trigger('resize
|
2734
|
+
return $(window).trigger('resize.fndtn.interchange');
|
2435
2735
|
},
|
2436
2736
|
|
2437
2737
|
convert_directive : function (directive) {
|
@@ -2448,33 +2748,40 @@
|
|
2448
2748
|
parse_scenario : function (scenario) {
|
2449
2749
|
// This logic had to be made more complex since some users were using commas in the url path
|
2450
2750
|
// So we cannot simply just split on a comma
|
2751
|
+
|
2451
2752
|
var directive_match = scenario[0].match(/(.+),\s*(\w+)\s*$/),
|
2452
|
-
|
2753
|
+
// getting the mq has gotten a bit complicated since we started accounting for several use cases
|
2754
|
+
// of URLs. For now we'll continue to match these scenarios, but we may consider having these scenarios
|
2755
|
+
// as nested objects or arrays in F6.
|
2756
|
+
// regex: match everything before close parenthesis for mq
|
2757
|
+
media_query = scenario[1].match(/(.*)\)/);
|
2453
2758
|
|
2454
2759
|
if (directive_match) {
|
2455
2760
|
var path = directive_match[1],
|
2456
2761
|
directive = directive_match[2];
|
2457
|
-
|
2458
|
-
else {
|
2762
|
+
|
2763
|
+
} else {
|
2459
2764
|
var cached_split = scenario[0].split(/,\s*$/),
|
2460
2765
|
path = cached_split[0],
|
2461
|
-
directive = '';
|
2766
|
+
directive = '';
|
2462
2767
|
}
|
2463
2768
|
|
2464
|
-
return [this.trim(path), this.convert_directive(directive), this.trim(media_query)];
|
2769
|
+
return [this.trim(path), this.convert_directive(directive), this.trim(media_query[1])];
|
2465
2770
|
},
|
2466
2771
|
|
2467
|
-
object : function(el) {
|
2772
|
+
object : function (el) {
|
2468
2773
|
var raw_arr = this.parse_data_attr(el),
|
2469
|
-
scenarios = [],
|
2774
|
+
scenarios = [],
|
2470
2775
|
i = raw_arr.length;
|
2471
2776
|
|
2472
2777
|
if (i > 0) {
|
2473
2778
|
while (i--) {
|
2474
|
-
|
2779
|
+
// split array between comma delimited content and mq
|
2780
|
+
// regex: comma, optional space, open parenthesis
|
2781
|
+
var scenario = raw_arr[i].split(/,\s?\(/);
|
2475
2782
|
|
2476
|
-
if (
|
2477
|
-
var params = this.parse_scenario(
|
2783
|
+
if (scenario.length > 1) {
|
2784
|
+
var params = this.parse_scenario(scenario);
|
2478
2785
|
scenarios.push(params);
|
2479
2786
|
}
|
2480
2787
|
}
|
@@ -2487,14 +2794,15 @@
|
|
2487
2794
|
var uuid = this.random_str(),
|
2488
2795
|
current_uuid = el.data(this.add_namespace('uuid', true));
|
2489
2796
|
|
2490
|
-
if (this.cache[current_uuid])
|
2797
|
+
if (this.cache[current_uuid]) {
|
2798
|
+
return this.cache[current_uuid];
|
2799
|
+
}
|
2491
2800
|
|
2492
2801
|
el.attr(this.add_namespace('data-uuid'), uuid);
|
2493
|
-
|
2494
2802
|
return this.cache[uuid] = scenarios;
|
2495
2803
|
},
|
2496
2804
|
|
2497
|
-
trim : function(str) {
|
2805
|
+
trim : function (str) {
|
2498
2806
|
|
2499
2807
|
if (typeof str === 'string') {
|
2500
2808
|
return $.trim(str);
|
@@ -2503,7 +2811,7 @@
|
|
2503
2811
|
return str;
|
2504
2812
|
},
|
2505
2813
|
|
2506
|
-
set_data_attr: function (init) {
|
2814
|
+
set_data_attr : function (init) {
|
2507
2815
|
if (init) {
|
2508
2816
|
if (this.namespace.length > 0) {
|
2509
2817
|
return this.namespace + '-' + this.settings.load_attr;
|
@@ -2521,7 +2829,7 @@
|
|
2521
2829
|
|
2522
2830
|
parse_data_attr : function (el) {
|
2523
2831
|
var raw = el.attr(this.attr_name()).split(/\[(.*?)\]/),
|
2524
|
-
i = raw.length,
|
2832
|
+
i = raw.length,
|
2525
2833
|
output = [];
|
2526
2834
|
|
2527
2835
|
while (i--) {
|
@@ -2550,13 +2858,13 @@
|
|
2550
2858
|
Foundation.libs.joyride = {
|
2551
2859
|
name : 'joyride',
|
2552
2860
|
|
2553
|
-
version : '5.5.
|
2861
|
+
version : '5.5.3',
|
2554
2862
|
|
2555
2863
|
defaults : {
|
2556
2864
|
expose : false, // turn on or off the expose feature
|
2557
2865
|
modal : true, // Whether to cover page with modal during the tour
|
2558
2866
|
keyboard : true, // enable left, right and esc keystrokes
|
2559
|
-
tip_location : 'bottom', // 'top' or '
|
2867
|
+
tip_location : 'bottom', // 'top', 'bottom', 'left' or 'right' in relation to parent
|
2560
2868
|
nub_position : 'auto', // override on a per tooltip bases
|
2561
2869
|
scroll_speed : 1500, // Page scrolling speed in milliseconds, 0 = no scroll animation
|
2562
2870
|
scroll_animation : 'linear', // supports 'swing' and 'linear', extend with jQuery UI.
|
@@ -2576,16 +2884,16 @@
|
|
2576
2884
|
tip_container : 'body', // Where will the tip be attached
|
2577
2885
|
abort_on_close : true, // When true, the close event will not fire any callback
|
2578
2886
|
tip_location_patterns : {
|
2579
|
-
top: ['bottom'],
|
2580
|
-
bottom: [], // bottom should not need to be repositioned
|
2581
|
-
left: ['right', 'top', 'bottom'],
|
2582
|
-
right: ['left', 'top', 'bottom']
|
2887
|
+
top : ['bottom'],
|
2888
|
+
bottom : [], // bottom should not need to be repositioned
|
2889
|
+
left : ['right', 'top', 'bottom'],
|
2890
|
+
right : ['left', 'top', 'bottom']
|
2583
2891
|
},
|
2584
|
-
post_ride_callback : function (){}, // A method to call once the tour closes (canceled or complete)
|
2585
|
-
post_step_callback : function (){}, // A method to call after each step
|
2586
|
-
pre_step_callback : function (){}, // A method to call before each step
|
2587
|
-
pre_ride_callback : function (){}, // A method to call before the tour starts (passed index, tip, and cloned exposed element)
|
2588
|
-
post_expose_callback : function (){}, // A method to call after an element has been exposed
|
2892
|
+
post_ride_callback : function () {}, // A method to call once the tour closes (canceled or complete)
|
2893
|
+
post_step_callback : function () {}, // A method to call after each step
|
2894
|
+
pre_step_callback : function () {}, // A method to call before each step
|
2895
|
+
pre_ride_callback : function () {}, // A method to call before the tour starts (passed index, tip, and cloned exposed element)
|
2896
|
+
post_expose_callback : function () {}, // A method to call after an element has been exposed
|
2589
2897
|
template : { // HTML segments for tip layout
|
2590
2898
|
link : '<a href="#close" class="joyride-close-tip">×</a>',
|
2591
2899
|
timer : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
|
@@ -2608,7 +2916,7 @@
|
|
2608
2916
|
this.bindings(method, options)
|
2609
2917
|
},
|
2610
2918
|
|
2611
|
-
go_next : function() {
|
2919
|
+
go_next : function () {
|
2612
2920
|
if (this.settings.$li.next().length < 1) {
|
2613
2921
|
this.end();
|
2614
2922
|
} else if (this.settings.timer > 0) {
|
@@ -2622,7 +2930,7 @@
|
|
2622
2930
|
}
|
2623
2931
|
},
|
2624
2932
|
|
2625
|
-
go_prev : function() {
|
2933
|
+
go_prev : function () {
|
2626
2934
|
if (this.settings.$li.prev().length < 1) {
|
2627
2935
|
// Do nothing if there are no prev element
|
2628
2936
|
} else if (this.settings.timer > 0) {
|
@@ -2655,10 +2963,12 @@
|
|
2655
2963
|
this.end(this.settings.abort_on_close);
|
2656
2964
|
}.bind(this))
|
2657
2965
|
|
2658
|
-
.on('keyup.fndtn.joyride', function(e) {
|
2966
|
+
.on('keyup.fndtn.joyride', function (e) {
|
2659
2967
|
// Don't do anything if keystrokes are disabled
|
2660
2968
|
// or if the joyride is not being shown
|
2661
|
-
if (!this.settings.keyboard || !this.settings.riding)
|
2969
|
+
if (!this.settings.keyboard || !this.settings.riding) {
|
2970
|
+
return;
|
2971
|
+
}
|
2662
2972
|
|
2663
2973
|
switch (e.which) {
|
2664
2974
|
case 39: // right arrow
|
@@ -2704,9 +3014,13 @@
|
|
2704
3014
|
integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
|
2705
3015
|
int_settings_count = integer_settings.length;
|
2706
3016
|
|
2707
|
-
if (!$this.length > 0)
|
3017
|
+
if (!$this.length > 0) {
|
3018
|
+
return;
|
3019
|
+
}
|
2708
3020
|
|
2709
|
-
if (!this.settings.init)
|
3021
|
+
if (!this.settings.init) {
|
3022
|
+
this.events();
|
3023
|
+
}
|
2710
3024
|
|
2711
3025
|
this.settings = $this.data(this.attr_name(true) + '-init');
|
2712
3026
|
|
@@ -2799,10 +3113,11 @@
|
|
2799
3113
|
txt = $.trim(txt) || 'Previous';
|
2800
3114
|
|
2801
3115
|
// Add the disabled class to the button if it's the first element
|
2802
|
-
if (idx == 0)
|
3116
|
+
if (idx == 0) {
|
2803
3117
|
txt = $(this.settings.template.prev_button).append(txt).addClass('disabled')[0].outerHTML;
|
2804
|
-
else
|
3118
|
+
} else {
|
2805
3119
|
txt = $(this.settings.template.prev_button).append(txt)[0].outerHTML;
|
3120
|
+
}
|
2806
3121
|
} else {
|
2807
3122
|
txt = '';
|
2808
3123
|
}
|
@@ -2811,10 +3126,8 @@
|
|
2811
3126
|
|
2812
3127
|
create : function (opts) {
|
2813
3128
|
this.settings.tip_settings = $.extend({}, this.settings, this.data_options(opts.$li));
|
2814
|
-
var buttonText = opts.$li.attr(this.add_namespace('data-button'))
|
2815
|
-
|
2816
|
-
prevButtonText = opts.$li.attr(this.add_namespace('data-button-prev'))
|
2817
|
-
|| opts.$li.attr(this.add_namespace('data-prev-text')),
|
3129
|
+
var buttonText = opts.$li.attr(this.add_namespace('data-button')) || opts.$li.attr(this.add_namespace('data-text')),
|
3130
|
+
prevButtonText = opts.$li.attr(this.add_namespace('data-button-prev')) || opts.$li.attr(this.add_namespace('data-prev-text')),
|
2818
3131
|
tipClass = opts.$li.attr('class'),
|
2819
3132
|
$tip_content = $(this.tip_template({
|
2820
3133
|
tip_class : tipClass,
|
@@ -2831,8 +3144,7 @@
|
|
2831
3144
|
var $timer = null;
|
2832
3145
|
|
2833
3146
|
// are we paused?
|
2834
|
-
if (this.settings.$li === undefined
|
2835
|
-
|| ($.inArray(this.settings.$li.index(), this.settings.pause_after) === -1)) {
|
3147
|
+
if (this.settings.$li === undefined || ($.inArray(this.settings.$li.index(), this.settings.pause_after) === -1)) {
|
2836
3148
|
|
2837
3149
|
// don't go to the next li if the tour was paused
|
2838
3150
|
if (this.settings.paused) {
|
@@ -2863,8 +3175,8 @@
|
|
2863
3175
|
|
2864
3176
|
this.settings.tip_settings.tip_location_pattern = this.settings.tip_location_patterns[this.settings.tip_settings.tip_location];
|
2865
3177
|
|
2866
|
-
// scroll and hide bg if not modal
|
2867
|
-
if (!/body/i.test(this.settings.$target.selector)) {
|
3178
|
+
// scroll and hide bg if not modal and not expose
|
3179
|
+
if (!/body/i.test(this.settings.$target.selector) && !this.settings.expose) {
|
2868
3180
|
var joyridemodalbg = $('.joyride-modal-bg');
|
2869
3181
|
if (/pop/i.test(this.settings.tipAnimation)) {
|
2870
3182
|
joyridemodalbg.hide();
|
@@ -2892,7 +3204,7 @@
|
|
2892
3204
|
|
2893
3205
|
setTimeout(function () {
|
2894
3206
|
$timer.animate({
|
2895
|
-
width: $timer.parent().width()
|
3207
|
+
width : $timer.parent().width()
|
2896
3208
|
}, this.settings.timer, 'linear');
|
2897
3209
|
}.bind(this), this.settings.tip_animation_fade_speed);
|
2898
3210
|
|
@@ -2901,7 +3213,6 @@
|
|
2901
3213
|
|
2902
3214
|
}
|
2903
3215
|
|
2904
|
-
|
2905
3216
|
} else if (/fade/i.test(this.settings.tip_animation)) {
|
2906
3217
|
|
2907
3218
|
$timer.width(0);
|
@@ -2914,7 +3225,7 @@
|
|
2914
3225
|
|
2915
3226
|
setTimeout(function () {
|
2916
3227
|
$timer.animate({
|
2917
|
-
width: $timer.parent().width()
|
3228
|
+
width : $timer.parent().width()
|
2918
3229
|
}, this.settings.timer, 'linear');
|
2919
3230
|
}.bind(this), this.settings.tip_animation_fade_speed);
|
2920
3231
|
|
@@ -2959,7 +3270,7 @@
|
|
2959
3270
|
|
2960
3271
|
// Prevent scroll bouncing...wait to remove from layout
|
2961
3272
|
this.settings.$current_tip.css('visibility', 'hidden');
|
2962
|
-
setTimeout($.proxy(function() {
|
3273
|
+
setTimeout($.proxy(function () {
|
2963
3274
|
this.hide();
|
2964
3275
|
this.css('visibility', 'visible');
|
2965
3276
|
}, this.settings.$current_tip), 0);
|
@@ -2973,10 +3284,11 @@
|
|
2973
3284
|
this.set_next_tip();
|
2974
3285
|
this.settings.$current_tip = this.settings.$next_tip;
|
2975
3286
|
} else {
|
2976
|
-
if (is_prev)
|
3287
|
+
if (is_prev) {
|
2977
3288
|
this.settings.$li = this.settings.$li.prev();
|
2978
|
-
else
|
3289
|
+
} else {
|
2979
3290
|
this.settings.$li = this.settings.$li.next();
|
3291
|
+
}
|
2980
3292
|
this.set_next_tip();
|
2981
3293
|
}
|
2982
3294
|
|
@@ -3012,7 +3324,7 @@
|
|
3012
3324
|
|
3013
3325
|
if (tipOffset != 0) {
|
3014
3326
|
$('html, body').stop().animate({
|
3015
|
-
scrollTop: tipOffset
|
3327
|
+
scrollTop : tipOffset
|
3016
3328
|
}, this.settings.scroll_speed, 'swing');
|
3017
3329
|
}
|
3018
3330
|
},
|
@@ -3040,67 +3352,67 @@
|
|
3040
3352
|
}
|
3041
3353
|
|
3042
3354
|
if (!/body/i.test(this.settings.$target.selector)) {
|
3043
|
-
|
3044
|
-
|
3045
|
-
|
3046
|
-
if (this.bottom()) {
|
3047
|
-
if (this.rtl) {
|
3048
|
-
this.settings.$next_tip.css({
|
3049
|
-
top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
|
3050
|
-
left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth() + leftAdjustment});
|
3051
|
-
} else {
|
3052
|
-
this.settings.$next_tip.css({
|
3053
|
-
top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
|
3054
|
-
left: this.settings.$target.offset().left + leftAdjustment});
|
3055
|
-
}
|
3355
|
+
var topAdjustment = this.settings.tip_settings.tipAdjustmentY ? parseInt(this.settings.tip_settings.tipAdjustmentY) : 0,
|
3356
|
+
leftAdjustment = this.settings.tip_settings.tipAdjustmentX ? parseInt(this.settings.tip_settings.tipAdjustmentX) : 0;
|
3056
3357
|
|
3057
|
-
|
3358
|
+
if (this.bottom()) {
|
3359
|
+
if (this.rtl) {
|
3360
|
+
this.settings.$next_tip.css({
|
3361
|
+
top : (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
|
3362
|
+
left : this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth() + leftAdjustment});
|
3363
|
+
} else {
|
3364
|
+
this.settings.$next_tip.css({
|
3365
|
+
top : (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
|
3366
|
+
left : this.settings.$target.offset().left + leftAdjustment});
|
3367
|
+
}
|
3058
3368
|
|
3059
|
-
|
3060
|
-
if (this.rtl) {
|
3061
|
-
this.settings.$next_tip.css({
|
3062
|
-
top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
|
3063
|
-
left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
|
3064
|
-
} else {
|
3065
|
-
this.settings.$next_tip.css({
|
3066
|
-
top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
|
3067
|
-
left: this.settings.$target.offset().left + leftAdjustment});
|
3068
|
-
}
|
3369
|
+
this.nub_position($nub, this.settings.tip_settings.nub_position, 'top');
|
3069
3370
|
|
3070
|
-
|
3371
|
+
} else if (this.top()) {
|
3372
|
+
if (this.rtl) {
|
3373
|
+
this.settings.$next_tip.css({
|
3374
|
+
top : (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
|
3375
|
+
left : this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
|
3376
|
+
} else {
|
3377
|
+
this.settings.$next_tip.css({
|
3378
|
+
top : (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
|
3379
|
+
left : this.settings.$target.offset().left + leftAdjustment});
|
3380
|
+
}
|
3071
3381
|
|
3072
|
-
|
3382
|
+
this.nub_position($nub, this.settings.tip_settings.nub_position, 'bottom');
|
3073
3383
|
|
3074
|
-
|
3075
|
-
top: this.settings.$target.offset().top + topAdjustment,
|
3076
|
-
left: (this.settings.$target.outerWidth() + this.settings.$target.offset().left + nub_width + leftAdjustment)});
|
3384
|
+
} else if (this.right()) {
|
3077
3385
|
|
3078
|
-
|
3386
|
+
this.settings.$next_tip.css({
|
3387
|
+
top : this.settings.$target.offset().top + topAdjustment,
|
3388
|
+
left : (this.settings.$target.outerWidth() + this.settings.$target.offset().left + nub_width + leftAdjustment)});
|
3079
3389
|
|
3080
|
-
|
3390
|
+
this.nub_position($nub, this.settings.tip_settings.nub_position, 'left');
|
3081
3391
|
|
3082
|
-
|
3083
|
-
top: this.settings.$target.offset().top + topAdjustment,
|
3084
|
-
left: (this.settings.$target.offset().left - this.settings.$next_tip.outerWidth() - nub_width + leftAdjustment)});
|
3392
|
+
} else if (this.left()) {
|
3085
3393
|
|
3086
|
-
|
3394
|
+
this.settings.$next_tip.css({
|
3395
|
+
top : this.settings.$target.offset().top + topAdjustment,
|
3396
|
+
left : (this.settings.$target.offset().left - this.settings.$next_tip.outerWidth() - nub_width + leftAdjustment)});
|
3087
3397
|
|
3088
|
-
|
3398
|
+
this.nub_position($nub, this.settings.tip_settings.nub_position, 'right');
|
3089
3399
|
|
3090
|
-
|
3400
|
+
}
|
3091
3401
|
|
3092
|
-
|
3093
|
-
.removeClass('top')
|
3094
|
-
.removeClass('right')
|
3095
|
-
.removeClass('left');
|
3402
|
+
if (!this.visible(this.corners(this.settings.$next_tip)) && this.settings.attempts < this.settings.tip_settings.tip_location_pattern.length) {
|
3096
3403
|
|
3097
|
-
|
3404
|
+
$nub.removeClass('bottom')
|
3405
|
+
.removeClass('top')
|
3406
|
+
.removeClass('right')
|
3407
|
+
.removeClass('left');
|
3098
3408
|
|
3099
|
-
|
3409
|
+
this.settings.tip_settings.tip_location = this.settings.tip_settings.tip_location_pattern[this.settings.attempts];
|
3100
3410
|
|
3101
|
-
|
3411
|
+
this.settings.attempts++;
|
3102
3412
|
|
3103
|
-
|
3413
|
+
this.pos_default();
|
3414
|
+
|
3415
|
+
}
|
3104
3416
|
|
3105
3417
|
} else if (this.settings.$li.length) {
|
3106
3418
|
|
@@ -3137,12 +3449,12 @@
|
|
3137
3449
|
|
3138
3450
|
if (this.top()) {
|
3139
3451
|
|
3140
|
-
this.settings.$next_tip.offset({top: this.settings.$target.offset().top - tip_height - nub_height});
|
3452
|
+
this.settings.$next_tip.offset({top : this.settings.$target.offset().top - tip_height - nub_height});
|
3141
3453
|
$nub.addClass('bottom');
|
3142
3454
|
|
3143
3455
|
} else {
|
3144
3456
|
|
3145
|
-
this.settings.$next_tip.offset({top: this.settings.$target.offset().top + target_height + nub_height});
|
3457
|
+
this.settings.$next_tip.offset({top : this.settings.$target.offset().top + target_height + nub_height});
|
3146
3458
|
$nub.addClass('top');
|
3147
3459
|
|
3148
3460
|
}
|
@@ -3190,14 +3502,14 @@
|
|
3190
3502
|
|
3191
3503
|
if (arguments.length > 0 && arguments[0] instanceof $) {
|
3192
3504
|
el = arguments[0];
|
3193
|
-
} else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){
|
3505
|
+
} else if (this.settings.$target && !/body/i.test(this.settings.$target.selector)) {
|
3194
3506
|
el = this.settings.$target;
|
3195
|
-
}
|
3507
|
+
} else {
|
3196
3508
|
return false;
|
3197
3509
|
}
|
3198
3510
|
|
3199
|
-
if(el.length < 1){
|
3200
|
-
if(window.console){
|
3511
|
+
if (el.length < 1) {
|
3512
|
+
if (window.console) {
|
3201
3513
|
console.error('element not valid', el);
|
3202
3514
|
}
|
3203
3515
|
return false;
|
@@ -3206,39 +3518,41 @@
|
|
3206
3518
|
expose = $(this.settings.template.expose);
|
3207
3519
|
this.settings.$body.append(expose);
|
3208
3520
|
expose.css({
|
3209
|
-
top: el.offset().top,
|
3210
|
-
left: el.offset().left,
|
3211
|
-
width: el.outerWidth(true),
|
3212
|
-
height: el.outerHeight(true)
|
3521
|
+
top : el.offset().top,
|
3522
|
+
left : el.offset().left,
|
3523
|
+
width : el.outerWidth(true),
|
3524
|
+
height : el.outerHeight(true)
|
3213
3525
|
});
|
3214
3526
|
|
3215
3527
|
exposeCover = $(this.settings.template.expose_cover);
|
3216
3528
|
|
3217
3529
|
origCSS = {
|
3218
|
-
zIndex: el.css('z-index'),
|
3219
|
-
position: el.css('position')
|
3530
|
+
zIndex : el.css('z-index'),
|
3531
|
+
position : el.css('position')
|
3220
3532
|
};
|
3221
3533
|
|
3222
3534
|
origClasses = el.attr('class') == null ? '' : el.attr('class');
|
3223
3535
|
|
3224
|
-
el.css('z-index',parseInt(expose.css('z-index'))+1);
|
3536
|
+
el.css('z-index', parseInt(expose.css('z-index')) + 1);
|
3225
3537
|
|
3226
3538
|
if (origCSS.position == 'static') {
|
3227
|
-
el.css('position','relative');
|
3539
|
+
el.css('position', 'relative');
|
3228
3540
|
}
|
3229
3541
|
|
3230
|
-
el.data('expose-css',origCSS);
|
3542
|
+
el.data('expose-css', origCSS);
|
3231
3543
|
el.data('orig-class', origClasses);
|
3232
3544
|
el.attr('class', origClasses + ' ' + this.settings.expose_add_class);
|
3233
3545
|
|
3234
3546
|
exposeCover.css({
|
3235
|
-
top: el.offset().top,
|
3236
|
-
left: el.offset().left,
|
3237
|
-
width: el.outerWidth(true),
|
3238
|
-
height: el.outerHeight(true)
|
3547
|
+
top : el.offset().top,
|
3548
|
+
left : el.offset().left,
|
3549
|
+
width : el.outerWidth(true),
|
3550
|
+
height : el.outerHeight(true)
|
3239
3551
|
});
|
3240
3552
|
|
3241
|
-
if (this.settings.modal)
|
3553
|
+
if (this.settings.modal) {
|
3554
|
+
this.show_modal();
|
3555
|
+
}
|
3242
3556
|
|
3243
3557
|
this.settings.$body.append(exposeCover);
|
3244
3558
|
expose.addClass(randId);
|
@@ -3251,20 +3565,20 @@
|
|
3251
3565
|
un_expose : function () {
|
3252
3566
|
var exposeId,
|
3253
3567
|
el,
|
3254
|
-
expose
|
3568
|
+
expose,
|
3255
3569
|
origCSS,
|
3256
3570
|
origClasses,
|
3257
3571
|
clearAll = false;
|
3258
3572
|
|
3259
3573
|
if (arguments.length > 0 && arguments[0] instanceof $) {
|
3260
3574
|
el = arguments[0];
|
3261
|
-
} else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){
|
3575
|
+
} else if (this.settings.$target && !/body/i.test(this.settings.$target.selector)) {
|
3262
3576
|
el = this.settings.$target;
|
3263
|
-
}
|
3577
|
+
} else {
|
3264
3578
|
return false;
|
3265
3579
|
}
|
3266
3580
|
|
3267
|
-
if(el.length < 1){
|
3581
|
+
if (el.length < 1) {
|
3268
3582
|
if (window.console) {
|
3269
3583
|
console.error('element not valid', el);
|
3270
3584
|
}
|
@@ -3293,7 +3607,7 @@
|
|
3293
3607
|
}
|
3294
3608
|
|
3295
3609
|
if (origCSS.position != el.css('position')) {
|
3296
|
-
if(origCSS.position == 'static') {// this is default, no need to set it.
|
3610
|
+
if (origCSS.position == 'static') {// this is default, no need to set it.
|
3297
3611
|
el.css('position', '');
|
3298
3612
|
} else {
|
3299
3613
|
el.css('position', origCSS.position);
|
@@ -3309,7 +3623,7 @@
|
|
3309
3623
|
this.remove_exposed(el);
|
3310
3624
|
},
|
3311
3625
|
|
3312
|
-
add_exposed: function(el){
|
3626
|
+
add_exposed : function (el) {
|
3313
3627
|
this.settings.exposed = this.settings.exposed || [];
|
3314
3628
|
if (el instanceof $ || typeof el === 'object') {
|
3315
3629
|
this.settings.exposed.push(el[0]);
|
@@ -3318,11 +3632,11 @@
|
|
3318
3632
|
}
|
3319
3633
|
},
|
3320
3634
|
|
3321
|
-
remove_exposed: function(el){
|
3635
|
+
remove_exposed : function (el) {
|
3322
3636
|
var search, i;
|
3323
3637
|
if (el instanceof $) {
|
3324
3638
|
search = el[0]
|
3325
|
-
} else if (typeof el == 'string'){
|
3639
|
+
} else if (typeof el == 'string') {
|
3326
3640
|
search = el;
|
3327
3641
|
}
|
3328
3642
|
|
@@ -3365,6 +3679,10 @@
|
|
3365
3679
|
},
|
3366
3680
|
|
3367
3681
|
corners : function (el) {
|
3682
|
+
if (el.length === 0) {
|
3683
|
+
return [false, false, false, false];
|
3684
|
+
}
|
3685
|
+
|
3368
3686
|
var w = $(window),
|
3369
3687
|
window_half = w.height() / 2,
|
3370
3688
|
//using this to calculate since scroll may not have finished yet.
|
@@ -3398,7 +3716,9 @@
|
|
3398
3716
|
var i = hidden_corners.length;
|
3399
3717
|
|
3400
3718
|
while (i--) {
|
3401
|
-
if (hidden_corners[i])
|
3719
|
+
if (hidden_corners[i]) {
|
3720
|
+
return false;
|
3721
|
+
}
|
3402
3722
|
}
|
3403
3723
|
|
3404
3724
|
return true;
|
@@ -3426,7 +3746,7 @@
|
|
3426
3746
|
|
3427
3747
|
end : function (abort) {
|
3428
3748
|
if (this.settings.cookie_monster) {
|
3429
|
-
$.cookie(this.settings.cookie_name, 'ridden', {
|
3749
|
+
$.cookie(this.settings.cookie_name, 'ridden', {expires : this.settings.cookie_expires, domain : this.settings.cookie_domain});
|
3430
3750
|
}
|
3431
3751
|
|
3432
3752
|
if (this.settings.timer > 0) {
|
@@ -3460,7 +3780,6 @@
|
|
3460
3780
|
$('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride');
|
3461
3781
|
$('.joyride-tip-guide, .joyride-modal-bg').remove();
|
3462
3782
|
clearTimeout(this.settings.automate);
|
3463
|
-
this.settings = {};
|
3464
3783
|
},
|
3465
3784
|
|
3466
3785
|
reflow : function () {}
|
@@ -3473,17 +3792,17 @@
|
|
3473
3792
|
Foundation.libs['magellan-expedition'] = {
|
3474
3793
|
name : 'magellan-expedition',
|
3475
3794
|
|
3476
|
-
version : '5.5.
|
3795
|
+
version : '5.5.3',
|
3477
3796
|
|
3478
3797
|
settings : {
|
3479
|
-
active_class: 'active',
|
3480
|
-
threshold: 0, // pixels from the top of the expedition for it to become fixes
|
3481
|
-
destination_threshold: 20, // pixels from the top of destination for it to be considered active
|
3482
|
-
throttle_delay: 30, // calculation throttling to increase framerate
|
3483
|
-
fixed_top: 0, // top distance in pixels assigend to the fixed element on scroll
|
3484
|
-
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.
|
3485
|
-
duration: 700, // animation duration time
|
3486
|
-
easing: 'swing' // animation easing
|
3798
|
+
active_class : 'active',
|
3799
|
+
threshold : 0, // pixels from the top of the expedition for it to become fixes
|
3800
|
+
destination_threshold : 20, // pixels from the top of destination for it to be considered active
|
3801
|
+
throttle_delay : 30, // calculation throttling to increase framerate
|
3802
|
+
fixed_top : 0, // top distance in pixels assigend to the fixed element on scroll
|
3803
|
+
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.
|
3804
|
+
duration : 700, // animation duration time
|
3805
|
+
easing : 'swing' // animation easing
|
3487
3806
|
},
|
3488
3807
|
|
3489
3808
|
init : function (scope, method, options) {
|
@@ -3501,51 +3820,52 @@
|
|
3501
3820
|
|
3502
3821
|
S(self.scope)
|
3503
3822
|
.off('.magellan')
|
3504
|
-
.on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href
|
3505
|
-
|
3506
|
-
|
3507
|
-
|
3508
|
-
|
3509
|
-
target = $('a[name="'+hash+'"]');
|
3510
|
-
|
3511
|
-
if (target.length === 0) {
|
3512
|
-
target = $('#'+hash);
|
3513
|
-
|
3514
|
-
}
|
3823
|
+
.on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href*=#]', function (e) {
|
3824
|
+
var sameHost = ((this.hostname === location.hostname) || !this.hostname),
|
3825
|
+
samePath = self.filterPathname(location.pathname) === self.filterPathname(this.pathname),
|
3826
|
+
testHash = this.hash.replace(/(:|\.|\/)/g, '\\$1'),
|
3827
|
+
anchor = this;
|
3515
3828
|
|
3829
|
+
if (sameHost && samePath && testHash) {
|
3830
|
+
e.preventDefault();
|
3831
|
+
var expedition = $(this).closest('[' + self.attr_name() + ']'),
|
3832
|
+
settings = expedition.data('magellan-expedition-init'),
|
3833
|
+
hash = this.hash.split('#').join(''),
|
3834
|
+
target = $('a[name="' + hash + '"]');
|
3516
3835
|
|
3517
|
-
|
3518
|
-
|
3519
|
-
if (settings.offset_by_height) {
|
3520
|
-
scroll_top = scroll_top - expedition.outerHeight();
|
3521
|
-
}
|
3836
|
+
if (target.length === 0) {
|
3837
|
+
target = $('#' + hash);
|
3522
3838
|
|
3523
|
-
$('html, body').stop().animate({
|
3524
|
-
'scrollTop': scroll_top
|
3525
|
-
}, settings.duration, settings.easing, function () {
|
3526
|
-
if(history.pushState) {
|
3527
|
-
history.pushState(null, null, '#'+hash);
|
3528
3839
|
}
|
3529
|
-
|
3530
|
-
|
3840
|
+
|
3841
|
+
// Account for expedition height if fixed position
|
3842
|
+
var scroll_top = target.offset().top - settings.destination_threshold + 1;
|
3843
|
+
if (settings.offset_by_height) {
|
3844
|
+
scroll_top = scroll_top - expedition.outerHeight();
|
3531
3845
|
}
|
3532
|
-
|
3846
|
+
$('html, body').stop().animate({
|
3847
|
+
'scrollTop' : scroll_top
|
3848
|
+
}, settings.duration, settings.easing, function () {
|
3849
|
+
if (history.pushState) {
|
3850
|
+
history.pushState(null, null, anchor.pathname + anchor.search + '#' + hash);
|
3851
|
+
} else {
|
3852
|
+
location.hash = anchor.pathname + anchor.search + '#' + hash;
|
3853
|
+
}
|
3854
|
+
});
|
3855
|
+
}
|
3533
3856
|
})
|
3534
3857
|
.on('scroll.fndtn.magellan', self.throttle(this.check_for_arrivals.bind(this), settings.throttle_delay));
|
3535
|
-
|
3536
|
-
$(window)
|
3537
|
-
.on('resize.fndtn.magellan', self.throttle(this.set_expedition_position.bind(this), settings.throttle_delay));
|
3538
3858
|
},
|
3539
3859
|
|
3540
|
-
check_for_arrivals : function() {
|
3860
|
+
check_for_arrivals : function () {
|
3541
3861
|
var self = this;
|
3542
3862
|
self.update_arrivals();
|
3543
3863
|
self.update_expedition_positions();
|
3544
3864
|
},
|
3545
3865
|
|
3546
|
-
set_expedition_position : function() {
|
3866
|
+
set_expedition_position : function () {
|
3547
3867
|
var self = this;
|
3548
|
-
$('[' + this.attr_name() + '=fixed]', self.scope).each(function(idx, el) {
|
3868
|
+
$('[' + this.attr_name() + '=fixed]', self.scope).each(function (idx, el) {
|
3549
3869
|
var expedition = $(this),
|
3550
3870
|
settings = expedition.data('magellan-expedition-init'),
|
3551
3871
|
styles = expedition.attr('styles'), // save styles
|
@@ -3556,54 +3876,55 @@
|
|
3556
3876
|
|
3557
3877
|
//set fixed-top by attribute
|
3558
3878
|
fixed_top = parseInt(expedition.data('magellan-fixed-top'));
|
3559
|
-
if(!isNaN(fixed_top))
|
3560
|
-
|
3879
|
+
if (!isNaN(fixed_top)) {
|
3880
|
+
self.settings.fixed_top = fixed_top;
|
3881
|
+
}
|
3561
3882
|
|
3562
3883
|
expedition.data(self.data_attr('magellan-top-offset'), top_offset);
|
3563
3884
|
expedition.attr('style', styles);
|
3564
3885
|
});
|
3565
3886
|
},
|
3566
3887
|
|
3567
|
-
update_expedition_positions : function() {
|
3888
|
+
update_expedition_positions : function () {
|
3568
3889
|
var self = this,
|
3569
3890
|
window_top_offset = $(window).scrollTop();
|
3570
3891
|
|
3571
|
-
$('[' + this.attr_name() + '=fixed]', self.scope).each(function() {
|
3892
|
+
$('[' + this.attr_name() + '=fixed]', self.scope).each(function () {
|
3572
3893
|
var expedition = $(this),
|
3573
3894
|
settings = expedition.data('magellan-expedition-init'),
|
3574
3895
|
styles = expedition.attr('style'), // save styles
|
3575
3896
|
top_offset = expedition.data('magellan-top-offset');
|
3576
3897
|
|
3577
3898
|
//scroll to the top distance
|
3578
|
-
if (window_top_offset+self.settings.fixed_top >= top_offset) {
|
3899
|
+
if (window_top_offset + self.settings.fixed_top >= top_offset) {
|
3579
3900
|
// Placeholder allows height calculations to be consistent even when
|
3580
3901
|
// appearing to switch between fixed/non-fixed placement
|
3581
3902
|
var placeholder = expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']');
|
3582
3903
|
if (placeholder.length === 0) {
|
3583
3904
|
placeholder = expedition.clone();
|
3584
3905
|
placeholder.removeAttr(self.attr_name());
|
3585
|
-
placeholder.attr(self.add_namespace('data-magellan-expedition-clone'),'');
|
3906
|
+
placeholder.attr(self.add_namespace('data-magellan-expedition-clone'), '');
|
3586
3907
|
expedition.before(placeholder);
|
3587
3908
|
}
|
3588
|
-
expedition.css({position:'fixed', top: settings.fixed_top}).addClass('fixed');
|
3909
|
+
expedition.css({position :'fixed', top : settings.fixed_top}).addClass('fixed');
|
3589
3910
|
} else {
|
3590
3911
|
expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']').remove();
|
3591
|
-
expedition.attr('style',styles).css('position','').css('top','').removeClass('fixed');
|
3912
|
+
expedition.attr('style', styles).css('position', '').css('top', '').removeClass('fixed');
|
3592
3913
|
}
|
3593
3914
|
});
|
3594
3915
|
},
|
3595
3916
|
|
3596
|
-
update_arrivals : function() {
|
3917
|
+
update_arrivals : function () {
|
3597
3918
|
var self = this,
|
3598
3919
|
window_top_offset = $(window).scrollTop();
|
3599
3920
|
|
3600
|
-
$('[' + this.attr_name() + ']', self.scope).each(function() {
|
3921
|
+
$('[' + this.attr_name() + ']', self.scope).each(function () {
|
3601
3922
|
var expedition = $(this),
|
3602
3923
|
settings = expedition.data(self.attr_name(true) + '-init'),
|
3603
3924
|
offsets = self.offsets(expedition, window_top_offset),
|
3604
3925
|
arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'),
|
3605
3926
|
active_item = false;
|
3606
|
-
offsets.each(function(idx, item) {
|
3927
|
+
offsets.each(function (idx, item) {
|
3607
3928
|
if (item.viewport_offset >= item.top_offset) {
|
3608
3929
|
var arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']');
|
3609
3930
|
arrivals.not(item.arrival).removeClass(settings.active_class);
|
@@ -3613,16 +3934,18 @@
|
|
3613
3934
|
}
|
3614
3935
|
});
|
3615
3936
|
|
3616
|
-
if (!active_item)
|
3937
|
+
if (!active_item) {
|
3938
|
+
arrivals.removeClass(settings.active_class);
|
3939
|
+
}
|
3617
3940
|
});
|
3618
3941
|
},
|
3619
3942
|
|
3620
|
-
offsets : function(expedition, window_offset) {
|
3943
|
+
offsets : function (expedition, window_offset) {
|
3621
3944
|
var self = this,
|
3622
3945
|
settings = expedition.data(self.attr_name(true) + '-init'),
|
3623
3946
|
viewport_offset = window_offset;
|
3624
3947
|
|
3625
|
-
return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function(idx, el) {
|
3948
|
+
return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function (idx, el) {
|
3626
3949
|
var name = $(this).data(self.data_attr('magellan-arrival')),
|
3627
3950
|
dest = $('[' + self.add_namespace('data-magellan-destination') + '=' + name + ']');
|
3628
3951
|
if (dest.length > 0) {
|
@@ -3638,14 +3961,18 @@
|
|
3638
3961
|
viewport_offset : viewport_offset
|
3639
3962
|
}
|
3640
3963
|
}
|
3641
|
-
}).sort(function(a, b) {
|
3642
|
-
if (a.top_offset < b.top_offset)
|
3643
|
-
|
3964
|
+
}).sort(function (a, b) {
|
3965
|
+
if (a.top_offset < b.top_offset) {
|
3966
|
+
return -1;
|
3967
|
+
}
|
3968
|
+
if (a.top_offset > b.top_offset) {
|
3969
|
+
return 1;
|
3970
|
+
}
|
3644
3971
|
return 0;
|
3645
3972
|
});
|
3646
3973
|
},
|
3647
3974
|
|
3648
|
-
data_attr: function (str) {
|
3975
|
+
data_attr : function (str) {
|
3649
3976
|
if (this.namespace.length > 0) {
|
3650
3977
|
return this.namespace + '-' + str;
|
3651
3978
|
}
|
@@ -3658,6 +3985,14 @@
|
|
3658
3985
|
this.S(window).off('.magellan');
|
3659
3986
|
},
|
3660
3987
|
|
3988
|
+
filterPathname : function (pathname) {
|
3989
|
+
pathname = pathname || '';
|
3990
|
+
return pathname
|
3991
|
+
.replace(/^\//,'')
|
3992
|
+
.replace(/(?:index|default).[a-zA-Z]{3,4}$/,'')
|
3993
|
+
.replace(/\/$/,'');
|
3994
|
+
},
|
3995
|
+
|
3661
3996
|
reflow : function () {
|
3662
3997
|
var self = this;
|
3663
3998
|
// remove placeholder expeditions used for height calculation purposes
|
@@ -3672,11 +4007,11 @@
|
|
3672
4007
|
Foundation.libs.offcanvas = {
|
3673
4008
|
name : 'offcanvas',
|
3674
4009
|
|
3675
|
-
version : '5.5.
|
4010
|
+
version : '5.5.3',
|
3676
4011
|
|
3677
4012
|
settings : {
|
3678
|
-
open_method: 'move',
|
3679
|
-
close_on_click: false
|
4013
|
+
open_method : 'move',
|
4014
|
+
close_on_click : false
|
3680
4015
|
},
|
3681
4016
|
|
3682
4017
|
init : function (scope, method, options) {
|
@@ -3688,16 +4023,22 @@
|
|
3688
4023
|
S = self.S,
|
3689
4024
|
move_class = '',
|
3690
4025
|
right_postfix = '',
|
3691
|
-
left_postfix = ''
|
4026
|
+
left_postfix = '',
|
4027
|
+
top_postfix = '',
|
4028
|
+
bottom_postfix = '';
|
3692
4029
|
|
3693
4030
|
if (this.settings.open_method === 'move') {
|
3694
4031
|
move_class = 'move-';
|
3695
4032
|
right_postfix = 'right';
|
3696
4033
|
left_postfix = 'left';
|
4034
|
+
top_postfix = 'top';
|
4035
|
+
bottom_postfix = 'bottom';
|
3697
4036
|
} else if (this.settings.open_method === 'overlap_single') {
|
3698
4037
|
move_class = 'offcanvas-overlap-';
|
3699
4038
|
right_postfix = 'right';
|
3700
4039
|
left_postfix = 'left';
|
4040
|
+
top_postfix = 'top';
|
4041
|
+
bottom_postfix = 'bottom';
|
3701
4042
|
} else if (this.settings.open_method === 'overlap') {
|
3702
4043
|
move_class = 'offcanvas-overlap';
|
3703
4044
|
}
|
@@ -3705,7 +4046,7 @@
|
|
3705
4046
|
S(this.scope).off('.offcanvas')
|
3706
4047
|
.on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) {
|
3707
4048
|
self.click_toggle_class(e, move_class + right_postfix);
|
3708
|
-
if (self.settings.open_method !== 'overlap'){
|
4049
|
+
if (self.settings.open_method !== 'overlap') {
|
3709
4050
|
S('.left-submenu').removeClass(move_class + right_postfix);
|
3710
4051
|
}
|
3711
4052
|
$('.left-off-canvas-toggle').attr('aria-expanded', 'true');
|
@@ -3714,21 +4055,22 @@
|
|
3714
4055
|
var settings = self.get_settings(e);
|
3715
4056
|
var parent = S(this).parent();
|
3716
4057
|
|
3717
|
-
if(settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')){
|
4058
|
+
if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
|
3718
4059
|
self.hide.call(self, move_class + right_postfix, self.get_wrapper(e));
|
3719
4060
|
parent.parent().removeClass(move_class + right_postfix);
|
3720
|
-
}else if(S(this).parent().hasClass('has-submenu')){
|
4061
|
+
} else if (S(this).parent().hasClass('has-submenu')) {
|
3721
4062
|
e.preventDefault();
|
3722
4063
|
S(this).siblings('.left-submenu').toggleClass(move_class + right_postfix);
|
3723
|
-
}else if(parent.hasClass('back')){
|
4064
|
+
} else if (parent.hasClass('back')) {
|
3724
4065
|
e.preventDefault();
|
3725
4066
|
parent.parent().removeClass(move_class + right_postfix);
|
3726
4067
|
}
|
3727
4068
|
$('.left-off-canvas-toggle').attr('aria-expanded', 'true');
|
3728
4069
|
})
|
4070
|
+
//end of left canvas
|
3729
4071
|
.on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) {
|
3730
4072
|
self.click_toggle_class(e, move_class + left_postfix);
|
3731
|
-
if (self.settings.open_method !== 'overlap'){
|
4073
|
+
if (self.settings.open_method !== 'overlap') {
|
3732
4074
|
S('.right-submenu').removeClass(move_class + left_postfix);
|
3733
4075
|
}
|
3734
4076
|
$('.right-off-canvas-toggle').attr('aria-expanded', 'true');
|
@@ -3737,22 +4079,71 @@
|
|
3737
4079
|
var settings = self.get_settings(e);
|
3738
4080
|
var parent = S(this).parent();
|
3739
4081
|
|
3740
|
-
if(settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')){
|
4082
|
+
if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
|
3741
4083
|
self.hide.call(self, move_class + left_postfix, self.get_wrapper(e));
|
3742
4084
|
parent.parent().removeClass(move_class + left_postfix);
|
3743
|
-
}else if(S(this).parent().hasClass('has-submenu')){
|
4085
|
+
} else if (S(this).parent().hasClass('has-submenu')) {
|
3744
4086
|
e.preventDefault();
|
3745
4087
|
S(this).siblings('.right-submenu').toggleClass(move_class + left_postfix);
|
3746
|
-
}else if(parent.hasClass('back')){
|
4088
|
+
} else if (parent.hasClass('back')) {
|
3747
4089
|
e.preventDefault();
|
3748
4090
|
parent.parent().removeClass(move_class + left_postfix);
|
3749
4091
|
}
|
3750
4092
|
$('.right-off-canvas-toggle').attr('aria-expanded', 'true');
|
3751
4093
|
})
|
4094
|
+
//end of right canvas
|
4095
|
+
.on('click.fndtn.offcanvas', '.top-off-canvas-toggle', function (e) {
|
4096
|
+
self.click_toggle_class(e, move_class + bottom_postfix);
|
4097
|
+
if (self.settings.open_method !== 'overlap') {
|
4098
|
+
S('.top-submenu').removeClass(move_class + bottom_postfix);
|
4099
|
+
}
|
4100
|
+
$('.top-off-canvas-toggle').attr('aria-expanded', 'true');
|
4101
|
+
})
|
4102
|
+
.on('click.fndtn.offcanvas', '.top-off-canvas-menu a', function (e) {
|
4103
|
+
var settings = self.get_settings(e);
|
4104
|
+
var parent = S(this).parent();
|
4105
|
+
|
4106
|
+
if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
|
4107
|
+
self.hide.call(self, move_class + bottom_postfix, self.get_wrapper(e));
|
4108
|
+
parent.parent().removeClass(move_class + bottom_postfix);
|
4109
|
+
} else if (S(this).parent().hasClass('has-submenu')) {
|
4110
|
+
e.preventDefault();
|
4111
|
+
S(this).siblings('.top-submenu').toggleClass(move_class + bottom_postfix);
|
4112
|
+
} else if (parent.hasClass('back')) {
|
4113
|
+
e.preventDefault();
|
4114
|
+
parent.parent().removeClass(move_class + bottom_postfix);
|
4115
|
+
}
|
4116
|
+
$('.top-off-canvas-toggle').attr('aria-expanded', 'true');
|
4117
|
+
})
|
4118
|
+
//end of top canvas
|
4119
|
+
.on('click.fndtn.offcanvas', '.bottom-off-canvas-toggle', function (e) {
|
4120
|
+
self.click_toggle_class(e, move_class + top_postfix);
|
4121
|
+
if (self.settings.open_method !== 'overlap') {
|
4122
|
+
S('.bottom-submenu').removeClass(move_class + top_postfix);
|
4123
|
+
}
|
4124
|
+
$('.bottom-off-canvas-toggle').attr('aria-expanded', 'true');
|
4125
|
+
})
|
4126
|
+
.on('click.fndtn.offcanvas', '.bottom-off-canvas-menu a', function (e) {
|
4127
|
+
var settings = self.get_settings(e);
|
4128
|
+
var parent = S(this).parent();
|
4129
|
+
|
4130
|
+
if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
|
4131
|
+
self.hide.call(self, move_class + top_postfix, self.get_wrapper(e));
|
4132
|
+
parent.parent().removeClass(move_class + top_postfix);
|
4133
|
+
} else if (S(this).parent().hasClass('has-submenu')) {
|
4134
|
+
e.preventDefault();
|
4135
|
+
S(this).siblings('.bottom-submenu').toggleClass(move_class + top_postfix);
|
4136
|
+
} else if (parent.hasClass('back')) {
|
4137
|
+
e.preventDefault();
|
4138
|
+
parent.parent().removeClass(move_class + top_postfix);
|
4139
|
+
}
|
4140
|
+
$('.bottom-off-canvas-toggle').attr('aria-expanded', 'true');
|
4141
|
+
})
|
4142
|
+
//end of bottom
|
3752
4143
|
.on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
|
3753
4144
|
self.click_remove_class(e, move_class + left_postfix);
|
3754
4145
|
S('.right-submenu').removeClass(move_class + left_postfix);
|
3755
|
-
if (right_postfix){
|
4146
|
+
if (right_postfix) {
|
3756
4147
|
self.click_remove_class(e, move_class + right_postfix);
|
3757
4148
|
S('.left-submenu').removeClass(move_class + left_postfix);
|
3758
4149
|
}
|
@@ -3765,10 +4156,27 @@
|
|
3765
4156
|
self.click_remove_class(e, move_class + right_postfix);
|
3766
4157
|
$('.right-off-canvas-toggle').attr('aria-expanded', 'false');
|
3767
4158
|
}
|
4159
|
+
})
|
4160
|
+
.on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
|
4161
|
+
self.click_remove_class(e, move_class + top_postfix);
|
4162
|
+
S('.bottom-submenu').removeClass(move_class + top_postfix);
|
4163
|
+
if (bottom_postfix) {
|
4164
|
+
self.click_remove_class(e, move_class + bottom_postfix);
|
4165
|
+
S('.top-submenu').removeClass(move_class + top_postfix);
|
4166
|
+
}
|
4167
|
+
$('.bottom-off-canvas-toggle').attr('aria-expanded', 'true');
|
4168
|
+
})
|
4169
|
+
.on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
|
4170
|
+
self.click_remove_class(e, move_class + top_postfix);
|
4171
|
+
$('.top-off-canvas-toggle').attr('aria-expanded', 'false');
|
4172
|
+
if (bottom_postfix) {
|
4173
|
+
self.click_remove_class(e, move_class + bottom_postfix);
|
4174
|
+
$('.bottom-off-canvas-toggle').attr('aria-expanded', 'false');
|
4175
|
+
}
|
3768
4176
|
});
|
3769
4177
|
},
|
3770
4178
|
|
3771
|
-
toggle: function(class_name, $off_canvas) {
|
4179
|
+
toggle : function (class_name, $off_canvas) {
|
3772
4180
|
$off_canvas = $off_canvas || this.get_wrapper();
|
3773
4181
|
if ($off_canvas.is('.' + class_name)) {
|
3774
4182
|
this.hide(class_name, $off_canvas);
|
@@ -3777,36 +4185,36 @@
|
|
3777
4185
|
}
|
3778
4186
|
},
|
3779
4187
|
|
3780
|
-
show: function(class_name, $off_canvas) {
|
4188
|
+
show : function (class_name, $off_canvas) {
|
3781
4189
|
$off_canvas = $off_canvas || this.get_wrapper();
|
3782
|
-
$off_canvas.trigger('open
|
4190
|
+
$off_canvas.trigger('open.fndtn.offcanvas');
|
3783
4191
|
$off_canvas.addClass(class_name);
|
3784
4192
|
},
|
3785
4193
|
|
3786
|
-
hide: function(class_name, $off_canvas) {
|
4194
|
+
hide : function (class_name, $off_canvas) {
|
3787
4195
|
$off_canvas = $off_canvas || this.get_wrapper();
|
3788
|
-
$off_canvas.trigger('close
|
4196
|
+
$off_canvas.trigger('close.fndtn.offcanvas');
|
3789
4197
|
$off_canvas.removeClass(class_name);
|
3790
4198
|
},
|
3791
4199
|
|
3792
|
-
click_toggle_class: function(e, class_name) {
|
4200
|
+
click_toggle_class : function (e, class_name) {
|
3793
4201
|
e.preventDefault();
|
3794
4202
|
var $off_canvas = this.get_wrapper(e);
|
3795
4203
|
this.toggle(class_name, $off_canvas);
|
3796
4204
|
},
|
3797
4205
|
|
3798
|
-
click_remove_class: function(e, class_name) {
|
4206
|
+
click_remove_class : function (e, class_name) {
|
3799
4207
|
e.preventDefault();
|
3800
4208
|
var $off_canvas = this.get_wrapper(e);
|
3801
4209
|
this.hide(class_name, $off_canvas);
|
3802
4210
|
},
|
3803
4211
|
|
3804
|
-
get_settings: function(e) {
|
4212
|
+
get_settings : function (e) {
|
3805
4213
|
var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']');
|
3806
4214
|
return offcanvas.data(this.attr_name(true) + '-init') || this.settings;
|
3807
4215
|
},
|
3808
4216
|
|
3809
|
-
get_wrapper: function(e) {
|
4217
|
+
get_wrapper : function (e) {
|
3810
4218
|
var $off_canvas = this.S(e ? e.target : this.scope).closest('.off-canvas-wrap');
|
3811
4219
|
|
3812
4220
|
if ($off_canvas.length === 0) {
|
@@ -3822,9 +4230,9 @@
|
|
3822
4230
|
;(function ($, window, document, undefined) {
|
3823
4231
|
'use strict';
|
3824
4232
|
|
3825
|
-
var noop = function() {};
|
4233
|
+
var noop = function () {};
|
3826
4234
|
|
3827
|
-
var Orbit = function(el, settings) {
|
4235
|
+
var Orbit = function (el, settings) {
|
3828
4236
|
// Don't reinitialize plugin
|
3829
4237
|
if (el.hasClass(settings.slides_container_class)) {
|
3830
4238
|
return this;
|
@@ -3842,16 +4250,15 @@
|
|
3842
4250
|
locked = false,
|
3843
4251
|
adjust_height_after = false;
|
3844
4252
|
|
3845
|
-
|
3846
|
-
self.slides = function() {
|
4253
|
+
self.slides = function () {
|
3847
4254
|
return slides_container.children(settings.slide_selector);
|
3848
4255
|
};
|
3849
4256
|
|
3850
4257
|
self.slides().first().addClass(settings.active_slide_class);
|
3851
4258
|
|
3852
|
-
self.update_slide_number = function(index) {
|
4259
|
+
self.update_slide_number = function (index) {
|
3853
4260
|
if (settings.slide_number) {
|
3854
|
-
number_container.find('span:first').text(parseInt(index)+1);
|
4261
|
+
number_container.find('span:first').text(parseInt(index) + 1);
|
3855
4262
|
number_container.find('span:last').text(self.slides().length);
|
3856
4263
|
}
|
3857
4264
|
if (settings.bullets) {
|
@@ -3860,14 +4267,14 @@
|
|
3860
4267
|
}
|
3861
4268
|
};
|
3862
4269
|
|
3863
|
-
self.update_active_link = function(index) {
|
3864
|
-
var link = $('[data-orbit-link="'+self.slides().eq(index).attr('data-orbit-slide')+'"]');
|
4270
|
+
self.update_active_link = function (index) {
|
4271
|
+
var link = $('[data-orbit-link="' + self.slides().eq(index).attr('data-orbit-slide') + '"]');
|
3865
4272
|
link.siblings().removeClass(settings.bullets_active_class);
|
3866
4273
|
link.addClass(settings.bullets_active_class);
|
3867
4274
|
};
|
3868
4275
|
|
3869
|
-
self.build_markup = function() {
|
3870
|
-
slides_container.wrap('<div class="'+settings.container_class+'"></div>');
|
4276
|
+
self.build_markup = function () {
|
4277
|
+
slides_container.wrap('<div class="' + settings.container_class + '"></div>');
|
3871
4278
|
container = slides_container.parent();
|
3872
4279
|
slides_container.addClass(settings.slides_container_class);
|
3873
4280
|
|
@@ -3898,7 +4305,7 @@
|
|
3898
4305
|
bullets_container = $('<ol>').addClass(settings.bullets_container_class);
|
3899
4306
|
container.append(bullets_container);
|
3900
4307
|
bullets_container.wrap('<div class="orbit-bullets-container"></div>');
|
3901
|
-
self.slides().each(function(idx, el) {
|
4308
|
+
self.slides().each(function (idx, el) {
|
3902
4309
|
var bullet = $('<li>').attr('data-orbit-slide', idx).on('click', self.link_bullet);;
|
3903
4310
|
bullets_container.append(bullet);
|
3904
4311
|
});
|
@@ -3906,7 +4313,7 @@
|
|
3906
4313
|
|
3907
4314
|
};
|
3908
4315
|
|
3909
|
-
self._goto = function(next_idx, start_timer) {
|
4316
|
+
self._goto = function (next_idx, start_timer) {
|
3910
4317
|
// if (locked) {return false;}
|
3911
4318
|
if (next_idx === idx) {return false;}
|
3912
4319
|
if (typeof timer === 'object') {timer.restart();}
|
@@ -3916,10 +4323,14 @@
|
|
3916
4323
|
locked = true;
|
3917
4324
|
if (next_idx < idx) {dir = 'prev';}
|
3918
4325
|
if (next_idx >= slides.length) {
|
3919
|
-
if (!settings.circular)
|
4326
|
+
if (!settings.circular) {
|
4327
|
+
return false;
|
4328
|
+
}
|
3920
4329
|
next_idx = 0;
|
3921
4330
|
} else if (next_idx < 0) {
|
3922
|
-
if (!settings.circular)
|
4331
|
+
if (!settings.circular) {
|
4332
|
+
return false;
|
4333
|
+
}
|
3923
4334
|
next_idx = slides.length - 1;
|
3924
4335
|
}
|
3925
4336
|
|
@@ -3934,13 +4345,13 @@
|
|
3934
4345
|
settings.before_slide_change();
|
3935
4346
|
self.update_active_link(next_idx);
|
3936
4347
|
|
3937
|
-
var callback = function() {
|
3938
|
-
var unlock = function() {
|
4348
|
+
var callback = function () {
|
4349
|
+
var unlock = function () {
|
3939
4350
|
idx = next_idx;
|
3940
4351
|
locked = false;
|
3941
4352
|
if (start_timer === true) {timer = self.create_timer(); timer.start();}
|
3942
4353
|
self.update_slide_number(idx);
|
3943
|
-
slides_container.trigger('after-slide-change.fndtn.orbit',[{slide_number: idx, total_slides: slides.length}]);
|
4354
|
+
slides_container.trigger('after-slide-change.fndtn.orbit', [{slide_number : idx, total_slides : slides.length}]);
|
3944
4355
|
settings.after_slide_change(idx, slides.length);
|
3945
4356
|
};
|
3946
4357
|
if (slides_container.outerHeight() != next.outerHeight() && settings.variable_height) {
|
@@ -3952,7 +4363,7 @@
|
|
3952
4363
|
|
3953
4364
|
if (slides.length === 1) {callback(); return false;}
|
3954
4365
|
|
3955
|
-
var start_animation = function() {
|
4366
|
+
var start_animation = function () {
|
3956
4367
|
if (dir === 'next') {animate.next(current, next, callback);}
|
3957
4368
|
if (dir === 'prev') {animate.prev(current, next, callback);}
|
3958
4369
|
};
|
@@ -3964,48 +4375,45 @@
|
|
3964
4375
|
}
|
3965
4376
|
};
|
3966
4377
|
|
3967
|
-
self.next = function(e) {
|
4378
|
+
self.next = function (e) {
|
3968
4379
|
e.stopImmediatePropagation();
|
3969
4380
|
e.preventDefault();
|
3970
4381
|
self._goto(idx + 1);
|
3971
4382
|
};
|
3972
4383
|
|
3973
|
-
self.prev = function(e) {
|
4384
|
+
self.prev = function (e) {
|
3974
4385
|
e.stopImmediatePropagation();
|
3975
4386
|
e.preventDefault();
|
3976
4387
|
self._goto(idx - 1);
|
3977
4388
|
};
|
3978
4389
|
|
3979
|
-
self.link_custom = function(e) {
|
4390
|
+
self.link_custom = function (e) {
|
3980
4391
|
e.preventDefault();
|
3981
4392
|
var link = $(this).attr('data-orbit-link');
|
3982
4393
|
if ((typeof link === 'string') && (link = $.trim(link)) != '') {
|
3983
|
-
var slide = container.find('[data-orbit-slide='+link+']');
|
4394
|
+
var slide = container.find('[data-orbit-slide=' + link + ']');
|
3984
4395
|
if (slide.index() != -1) {self._goto(slide.index());}
|
3985
4396
|
}
|
3986
4397
|
};
|
3987
4398
|
|
3988
|
-
self.link_bullet = function(e) {
|
4399
|
+
self.link_bullet = function (e) {
|
3989
4400
|
var index = $(this).attr('data-orbit-slide');
|
3990
4401
|
if ((typeof index === 'string') && (index = $.trim(index)) != '') {
|
3991
|
-
if(isNaN(parseInt(index)))
|
3992
|
-
|
3993
|
-
var slide = container.find('[data-orbit-slide='+index+']');
|
4402
|
+
if (isNaN(parseInt(index))) {
|
4403
|
+
var slide = container.find('[data-orbit-slide=' + index + ']');
|
3994
4404
|
if (slide.index() != -1) {self._goto(slide.index() + 1);}
|
3995
|
-
}
|
3996
|
-
else
|
3997
|
-
{
|
4405
|
+
} else {
|
3998
4406
|
self._goto(parseInt(index));
|
3999
4407
|
}
|
4000
4408
|
}
|
4001
4409
|
|
4002
4410
|
}
|
4003
4411
|
|
4004
|
-
self.timer_callback = function() {
|
4412
|
+
self.timer_callback = function () {
|
4005
4413
|
self._goto(idx + 1, true);
|
4006
4414
|
}
|
4007
4415
|
|
4008
|
-
self.compute_dimensions = function() {
|
4416
|
+
self.compute_dimensions = function () {
|
4009
4417
|
var current = $(self.slides().get(idx));
|
4010
4418
|
var h = current.outerHeight();
|
4011
4419
|
if (!settings.variable_height) {
|
@@ -4016,65 +4424,71 @@
|
|
4016
4424
|
slides_container.height(h);
|
4017
4425
|
};
|
4018
4426
|
|
4019
|
-
self.create_timer = function() {
|
4427
|
+
self.create_timer = function () {
|
4020
4428
|
var t = new Timer(
|
4021
|
-
container.find('.'+settings.timer_container_class),
|
4429
|
+
container.find('.' + settings.timer_container_class),
|
4022
4430
|
settings,
|
4023
4431
|
self.timer_callback
|
4024
4432
|
);
|
4025
4433
|
return t;
|
4026
4434
|
};
|
4027
4435
|
|
4028
|
-
self.stop_timer = function() {
|
4029
|
-
if (typeof timer === 'object')
|
4436
|
+
self.stop_timer = function () {
|
4437
|
+
if (typeof timer === 'object') {
|
4438
|
+
timer.stop();
|
4439
|
+
}
|
4030
4440
|
};
|
4031
4441
|
|
4032
|
-
self.toggle_timer = function() {
|
4033
|
-
var t = container.find('.'+settings.timer_container_class);
|
4442
|
+
self.toggle_timer = function () {
|
4443
|
+
var t = container.find('.' + settings.timer_container_class);
|
4034
4444
|
if (t.hasClass(settings.timer_paused_class)) {
|
4035
4445
|
if (typeof timer === 'undefined') {timer = self.create_timer();}
|
4036
4446
|
timer.start();
|
4037
|
-
}
|
4038
|
-
else {
|
4447
|
+
} else {
|
4039
4448
|
if (typeof timer === 'object') {timer.stop();}
|
4040
4449
|
}
|
4041
4450
|
};
|
4042
4451
|
|
4043
|
-
self.init = function() {
|
4452
|
+
self.init = function () {
|
4044
4453
|
self.build_markup();
|
4045
4454
|
if (settings.timer) {
|
4046
4455
|
timer = self.create_timer();
|
4047
4456
|
Foundation.utils.image_loaded(this.slides().children('img'), timer.start);
|
4048
4457
|
}
|
4049
4458
|
animate = new FadeAnimation(settings, slides_container);
|
4050
|
-
if (settings.animation === 'slide')
|
4459
|
+
if (settings.animation === 'slide') {
|
4051
4460
|
animate = new SlideAnimation(settings, slides_container);
|
4461
|
+
}
|
4052
4462
|
|
4053
|
-
container.on('click', '.'+settings.next_class, self.next);
|
4054
|
-
container.on('click', '.'+settings.prev_class, self.prev);
|
4463
|
+
container.on('click', '.' + settings.next_class, self.next);
|
4464
|
+
container.on('click', '.' + settings.prev_class, self.prev);
|
4055
4465
|
|
4056
4466
|
if (settings.next_on_click) {
|
4057
|
-
container.on('click', '.'+settings.slides_container_class+' [data-orbit-slide]', self.link_bullet);
|
4467
|
+
container.on('click', '.' + settings.slides_container_class + ' [data-orbit-slide]', self.link_bullet);
|
4058
4468
|
}
|
4059
4469
|
|
4060
4470
|
container.on('click', self.toggle_timer);
|
4061
4471
|
if (settings.swipe) {
|
4062
|
-
container.on('touchstart.fndtn.orbit', function(e) {
|
4472
|
+
container.on('touchstart.fndtn.orbit', function (e) {
|
4063
4473
|
if (!e.touches) {e = e.originalEvent;}
|
4064
4474
|
var data = {
|
4065
|
-
start_page_x: e.touches[0].pageX,
|
4066
|
-
start_page_y: e.touches[0].pageY,
|
4067
|
-
start_time: (new Date()).getTime(),
|
4068
|
-
delta_x: 0,
|
4069
|
-
is_scrolling: undefined
|
4475
|
+
start_page_x : e.touches[0].pageX,
|
4476
|
+
start_page_y : e.touches[0].pageY,
|
4477
|
+
start_time : (new Date()).getTime(),
|
4478
|
+
delta_x : 0,
|
4479
|
+
is_scrolling : undefined
|
4070
4480
|
};
|
4071
4481
|
container.data('swipe-transition', data);
|
4072
4482
|
e.stopPropagation();
|
4073
4483
|
})
|
4074
|
-
.on('touchmove.fndtn.orbit', function(e) {
|
4075
|
-
if (!e.touches) {
|
4484
|
+
.on('touchmove.fndtn.orbit', function (e) {
|
4485
|
+
if (!e.touches) {
|
4486
|
+
e = e.originalEvent;
|
4487
|
+
}
|
4076
4488
|
// Ignore pinch/zoom events
|
4077
|
-
if(e.touches.length > 1 || e.scale && e.scale !== 1)
|
4489
|
+
if (e.touches.length > 1 || e.scale && e.scale !== 1) {
|
4490
|
+
return;
|
4491
|
+
}
|
4078
4492
|
|
4079
4493
|
var data = container.data('swipe-transition');
|
4080
4494
|
if (typeof data === 'undefined') {data = {};}
|
@@ -4087,22 +4501,22 @@
|
|
4087
4501
|
|
4088
4502
|
if (!data.is_scrolling && !data.active) {
|
4089
4503
|
e.preventDefault();
|
4090
|
-
var direction = (data.delta_x < 0) ? (idx+1) : (idx-1);
|
4504
|
+
var direction = (data.delta_x < 0) ? (idx + 1) : (idx - 1);
|
4091
4505
|
data.active = true;
|
4092
4506
|
self._goto(direction);
|
4093
4507
|
}
|
4094
4508
|
})
|
4095
|
-
.on('touchend.fndtn.orbit', function(e) {
|
4509
|
+
.on('touchend.fndtn.orbit', function (e) {
|
4096
4510
|
container.data('swipe-transition', {});
|
4097
4511
|
e.stopPropagation();
|
4098
4512
|
})
|
4099
4513
|
}
|
4100
|
-
container.on('mouseenter.fndtn.orbit', function(e) {
|
4514
|
+
container.on('mouseenter.fndtn.orbit', function (e) {
|
4101
4515
|
if (settings.timer && settings.pause_on_hover) {
|
4102
4516
|
self.stop_timer();
|
4103
4517
|
}
|
4104
4518
|
})
|
4105
|
-
.on('mouseleave.fndtn.orbit', function(e) {
|
4519
|
+
.on('mouseleave.fndtn.orbit', function (e) {
|
4106
4520
|
if (settings.timer && settings.resume_on_mouseout) {
|
4107
4521
|
timer.start();
|
4108
4522
|
}
|
@@ -4111,8 +4525,8 @@
|
|
4111
4525
|
$(document).on('click', '[data-orbit-link]', self.link_custom);
|
4112
4526
|
$(window).on('load resize', self.compute_dimensions);
|
4113
4527
|
Foundation.utils.image_loaded(this.slides().children('img'), self.compute_dimensions);
|
4114
|
-
Foundation.utils.image_loaded(this.slides().children('img'), function() {
|
4115
|
-
container.prev('.'+settings.preloader_class).css('display', 'none');
|
4528
|
+
Foundation.utils.image_loaded(this.slides().children('img'), function () {
|
4529
|
+
container.prev('.' + settings.preloader_class).css('display', 'none');
|
4116
4530
|
self.update_slide_number(0);
|
4117
4531
|
self.update_active_link(0);
|
4118
4532
|
slides_container.trigger('ready.fndtn.orbit');
|
@@ -4122,43 +4536,43 @@
|
|
4122
4536
|
self.init();
|
4123
4537
|
};
|
4124
4538
|
|
4125
|
-
var Timer = function(el, settings, callback) {
|
4539
|
+
var Timer = function (el, settings, callback) {
|
4126
4540
|
var self = this,
|
4127
4541
|
duration = settings.timer_speed,
|
4128
|
-
progress = el.find('.'+settings.timer_progress_class),
|
4542
|
+
progress = el.find('.' + settings.timer_progress_class),
|
4129
4543
|
start,
|
4130
4544
|
timeout,
|
4131
4545
|
left = -1;
|
4132
4546
|
|
4133
|
-
this.update_progress = function(w) {
|
4547
|
+
this.update_progress = function (w) {
|
4134
4548
|
var new_progress = progress.clone();
|
4135
4549
|
new_progress.attr('style', '');
|
4136
|
-
new_progress.css('width', w+'%');
|
4550
|
+
new_progress.css('width', w + '%');
|
4137
4551
|
progress.replaceWith(new_progress);
|
4138
4552
|
progress = new_progress;
|
4139
4553
|
};
|
4140
4554
|
|
4141
|
-
this.restart = function() {
|
4555
|
+
this.restart = function () {
|
4142
4556
|
clearTimeout(timeout);
|
4143
4557
|
el.addClass(settings.timer_paused_class);
|
4144
4558
|
left = -1;
|
4145
4559
|
self.update_progress(0);
|
4146
4560
|
};
|
4147
4561
|
|
4148
|
-
this.start = function() {
|
4562
|
+
this.start = function () {
|
4149
4563
|
if (!el.hasClass(settings.timer_paused_class)) {return true;}
|
4150
4564
|
left = (left === -1) ? duration : left;
|
4151
4565
|
el.removeClass(settings.timer_paused_class);
|
4152
4566
|
start = new Date().getTime();
|
4153
|
-
progress.animate({'width': '100%'}, left, 'linear');
|
4154
|
-
timeout = setTimeout(function() {
|
4567
|
+
progress.animate({'width' : '100%'}, left, 'linear');
|
4568
|
+
timeout = setTimeout(function () {
|
4155
4569
|
self.restart();
|
4156
4570
|
callback();
|
4157
4571
|
}, left);
|
4158
4572
|
el.trigger('timer-started.fndtn.orbit')
|
4159
4573
|
};
|
4160
4574
|
|
4161
|
-
this.stop = function() {
|
4575
|
+
this.stop = function () {
|
4162
4576
|
if (el.hasClass(settings.timer_paused_class)) {return true;}
|
4163
4577
|
clearTimeout(timeout);
|
4164
4578
|
el.addClass(settings.timer_paused_class);
|
@@ -4170,95 +4584,94 @@
|
|
4170
4584
|
};
|
4171
4585
|
};
|
4172
4586
|
|
4173
|
-
var SlideAnimation = function(settings, container) {
|
4587
|
+
var SlideAnimation = function (settings, container) {
|
4174
4588
|
var duration = settings.animation_speed;
|
4175
4589
|
var is_rtl = ($('html[dir=rtl]').length === 1);
|
4176
4590
|
var margin = is_rtl ? 'marginRight' : 'marginLeft';
|
4177
4591
|
var animMargin = {};
|
4178
4592
|
animMargin[margin] = '0%';
|
4179
4593
|
|
4180
|
-
this.next = function(current, next, callback) {
|
4181
|
-
current.animate({marginLeft:'-100%'}, duration);
|
4182
|
-
next.animate(animMargin, duration, function() {
|
4594
|
+
this.next = function (current, next, callback) {
|
4595
|
+
current.animate({marginLeft : '-100%'}, duration);
|
4596
|
+
next.animate(animMargin, duration, function () {
|
4183
4597
|
current.css(margin, '100%');
|
4184
4598
|
callback();
|
4185
4599
|
});
|
4186
4600
|
};
|
4187
4601
|
|
4188
|
-
this.prev = function(current, prev, callback) {
|
4189
|
-
current.animate({marginLeft:'100%'}, duration);
|
4602
|
+
this.prev = function (current, prev, callback) {
|
4603
|
+
current.animate({marginLeft : '100%'}, duration);
|
4190
4604
|
prev.css(margin, '-100%');
|
4191
|
-
prev.animate(animMargin, duration, function() {
|
4605
|
+
prev.animate(animMargin, duration, function () {
|
4192
4606
|
current.css(margin, '100%');
|
4193
4607
|
callback();
|
4194
4608
|
});
|
4195
4609
|
};
|
4196
4610
|
};
|
4197
4611
|
|
4198
|
-
var FadeAnimation = function(settings, container) {
|
4612
|
+
var FadeAnimation = function (settings, container) {
|
4199
4613
|
var duration = settings.animation_speed;
|
4200
4614
|
var is_rtl = ($('html[dir=rtl]').length === 1);
|
4201
4615
|
var margin = is_rtl ? 'marginRight' : 'marginLeft';
|
4202
4616
|
|
4203
|
-
this.next = function(current, next, callback) {
|
4204
|
-
next.css({'margin':'0%', 'opacity':'0.01'});
|
4205
|
-
next.animate({'opacity':'1'}, duration, 'linear', function() {
|
4617
|
+
this.next = function (current, next, callback) {
|
4618
|
+
next.css({'margin' : '0%', 'opacity' : '0.01'});
|
4619
|
+
next.animate({'opacity' :'1'}, duration, 'linear', function () {
|
4206
4620
|
current.css('margin', '100%');
|
4207
4621
|
callback();
|
4208
4622
|
});
|
4209
4623
|
};
|
4210
4624
|
|
4211
|
-
this.prev = function(current, prev, callback) {
|
4212
|
-
prev.css({'margin':'0%', 'opacity':'0.01'});
|
4213
|
-
prev.animate({'opacity':'1'}, duration, 'linear', function() {
|
4625
|
+
this.prev = function (current, prev, callback) {
|
4626
|
+
prev.css({'margin' : '0%', 'opacity' : '0.01'});
|
4627
|
+
prev.animate({'opacity' : '1'}, duration, 'linear', function () {
|
4214
4628
|
current.css('margin', '100%');
|
4215
4629
|
callback();
|
4216
4630
|
});
|
4217
4631
|
};
|
4218
4632
|
};
|
4219
4633
|
|
4220
|
-
|
4221
4634
|
Foundation.libs = Foundation.libs || {};
|
4222
4635
|
|
4223
4636
|
Foundation.libs.orbit = {
|
4224
|
-
name: 'orbit',
|
4225
|
-
|
4226
|
-
version: '5.5.
|
4227
|
-
|
4228
|
-
settings: {
|
4229
|
-
animation: 'slide',
|
4230
|
-
timer_speed: 10000,
|
4231
|
-
pause_on_hover: true,
|
4232
|
-
resume_on_mouseout: false,
|
4233
|
-
next_on_click: true,
|
4234
|
-
animation_speed: 500,
|
4235
|
-
stack_on_small: false,
|
4236
|
-
navigation_arrows: true,
|
4237
|
-
slide_number: true,
|
4238
|
-
slide_number_text: 'of',
|
4239
|
-
container_class: 'orbit-container',
|
4240
|
-
stack_on_small_class: 'orbit-stack-on-small',
|
4241
|
-
next_class: 'orbit-next',
|
4242
|
-
prev_class: 'orbit-prev',
|
4243
|
-
timer_container_class: 'orbit-timer',
|
4244
|
-
timer_paused_class: 'paused',
|
4245
|
-
timer_progress_class: 'orbit-progress',
|
4246
|
-
slides_container_class: 'orbit-slides-container',
|
4247
|
-
preloader_class: 'preloader',
|
4248
|
-
slide_selector: '*',
|
4249
|
-
bullets_container_class: 'orbit-bullets',
|
4250
|
-
bullets_active_class: 'active',
|
4251
|
-
slide_number_class: 'orbit-slide-number',
|
4252
|
-
caption_class: 'orbit-caption',
|
4253
|
-
active_slide_class: 'active',
|
4254
|
-
orbit_transition_class: 'orbit-transitioning',
|
4255
|
-
bullets: true,
|
4256
|
-
circular: true,
|
4257
|
-
timer: true,
|
4258
|
-
variable_height: false,
|
4259
|
-
swipe: true,
|
4260
|
-
before_slide_change: noop,
|
4261
|
-
after_slide_change: noop
|
4637
|
+
name : 'orbit',
|
4638
|
+
|
4639
|
+
version : '5.5.3',
|
4640
|
+
|
4641
|
+
settings : {
|
4642
|
+
animation : 'slide',
|
4643
|
+
timer_speed : 10000,
|
4644
|
+
pause_on_hover : true,
|
4645
|
+
resume_on_mouseout : false,
|
4646
|
+
next_on_click : true,
|
4647
|
+
animation_speed : 500,
|
4648
|
+
stack_on_small : false,
|
4649
|
+
navigation_arrows : true,
|
4650
|
+
slide_number : true,
|
4651
|
+
slide_number_text : 'of',
|
4652
|
+
container_class : 'orbit-container',
|
4653
|
+
stack_on_small_class : 'orbit-stack-on-small',
|
4654
|
+
next_class : 'orbit-next',
|
4655
|
+
prev_class : 'orbit-prev',
|
4656
|
+
timer_container_class : 'orbit-timer',
|
4657
|
+
timer_paused_class : 'paused',
|
4658
|
+
timer_progress_class : 'orbit-progress',
|
4659
|
+
slides_container_class : 'orbit-slides-container',
|
4660
|
+
preloader_class : 'preloader',
|
4661
|
+
slide_selector : '*',
|
4662
|
+
bullets_container_class : 'orbit-bullets',
|
4663
|
+
bullets_active_class : 'active',
|
4664
|
+
slide_number_class : 'orbit-slide-number',
|
4665
|
+
caption_class : 'orbit-caption',
|
4666
|
+
active_slide_class : 'active',
|
4667
|
+
orbit_transition_class : 'orbit-transitioning',
|
4668
|
+
bullets : true,
|
4669
|
+
circular : true,
|
4670
|
+
timer : true,
|
4671
|
+
variable_height : false,
|
4672
|
+
swipe : true,
|
4673
|
+
before_slide_change : noop,
|
4674
|
+
after_slide_change : noop
|
4262
4675
|
},
|
4263
4676
|
|
4264
4677
|
init : function (scope, method, options) {
|
@@ -4279,7 +4692,7 @@
|
|
4279
4692
|
var instance = $el.data(self.name + '-instance');
|
4280
4693
|
instance.compute_dimensions();
|
4281
4694
|
} else {
|
4282
|
-
self.S('[data-orbit]', self.scope).each(function(idx, el) {
|
4695
|
+
self.S('[data-orbit]', self.scope).each(function (idx, el) {
|
4283
4696
|
var $el = self.S(el);
|
4284
4697
|
var opts = self.data_options($el);
|
4285
4698
|
var instance = $el.data(self.name + '-instance');
|
@@ -4289,42 +4702,45 @@
|
|
4289
4702
|
}
|
4290
4703
|
};
|
4291
4704
|
|
4292
|
-
|
4293
4705
|
}(jQuery, window, window.document));
|
4294
4706
|
|
4295
4707
|
;(function ($, window, document, undefined) {
|
4296
4708
|
'use strict';
|
4297
4709
|
|
4710
|
+
var openModals = [];
|
4711
|
+
|
4298
4712
|
Foundation.libs.reveal = {
|
4299
4713
|
name : 'reveal',
|
4300
4714
|
|
4301
|
-
version : '5.5.
|
4715
|
+
version : '5.5.3',
|
4302
4716
|
|
4303
4717
|
locked : false,
|
4304
4718
|
|
4305
4719
|
settings : {
|
4306
|
-
animation: 'fadeAndPop',
|
4307
|
-
animation_speed: 250,
|
4308
|
-
close_on_background_click: true,
|
4309
|
-
close_on_esc: true,
|
4310
|
-
dismiss_modal_class: 'close-reveal-modal',
|
4311
|
-
|
4312
|
-
|
4313
|
-
|
4314
|
-
|
4315
|
-
|
4316
|
-
|
4720
|
+
animation : 'fadeAndPop',
|
4721
|
+
animation_speed : 250,
|
4722
|
+
close_on_background_click : true,
|
4723
|
+
close_on_esc : true,
|
4724
|
+
dismiss_modal_class : 'close-reveal-modal',
|
4725
|
+
multiple_opened : false,
|
4726
|
+
bg_class : 'reveal-modal-bg',
|
4727
|
+
root_element : 'body',
|
4728
|
+
open : function(){},
|
4729
|
+
opened : function(){},
|
4730
|
+
close : function(){},
|
4731
|
+
closed : function(){},
|
4732
|
+
on_ajax_error: $.noop,
|
4317
4733
|
bg : $('.reveal-modal-bg'),
|
4318
4734
|
css : {
|
4319
4735
|
open : {
|
4320
|
-
'opacity': 0,
|
4321
|
-
'visibility': 'visible',
|
4736
|
+
'opacity' : 0,
|
4737
|
+
'visibility' : 'visible',
|
4322
4738
|
'display' : 'block'
|
4323
4739
|
},
|
4324
4740
|
close : {
|
4325
|
-
'opacity': 1,
|
4326
|
-
'visibility': 'hidden',
|
4327
|
-
'display': 'none'
|
4741
|
+
'opacity' : 1,
|
4742
|
+
'visibility' : 'hidden',
|
4743
|
+
'display' : 'none'
|
4328
4744
|
}
|
4329
4745
|
}
|
4330
4746
|
},
|
@@ -4345,7 +4761,8 @@
|
|
4345
4761
|
|
4346
4762
|
if (!self.locked) {
|
4347
4763
|
var element = S(this),
|
4348
|
-
ajax = element.data(self.data_attr('reveal-ajax'))
|
4764
|
+
ajax = element.data(self.data_attr('reveal-ajax')),
|
4765
|
+
replaceContentSel = element.data(self.data_attr('reveal-replace-content'));
|
4349
4766
|
|
4350
4767
|
self.locked = true;
|
4351
4768
|
|
@@ -4353,8 +4770,7 @@
|
|
4353
4770
|
self.open.call(self, element);
|
4354
4771
|
} else {
|
4355
4772
|
var url = ajax === true ? element.attr('href') : ajax;
|
4356
|
-
|
4357
|
-
self.open.call(self, element, {url: url});
|
4773
|
+
self.open.call(self, element, {url : url}, { replaceContentSel : replaceContentSel });
|
4358
4774
|
}
|
4359
4775
|
}
|
4360
4776
|
});
|
@@ -4375,11 +4791,11 @@
|
|
4375
4791
|
}
|
4376
4792
|
|
4377
4793
|
self.locked = true;
|
4378
|
-
self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open') : S(this).closest('[' + self.attr_name() + ']'));
|
4794
|
+
self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open:not(.toback)') : S(this).closest('[' + self.attr_name() + ']'));
|
4379
4795
|
}
|
4380
4796
|
});
|
4381
4797
|
|
4382
|
-
if(S('[' + self.attr_name() + ']', this.scope).length > 0) {
|
4798
|
+
if (S('[' + self.attr_name() + ']', this.scope).length > 0) {
|
4383
4799
|
S(this.scope)
|
4384
4800
|
// .off('.reveal')
|
4385
4801
|
.on('open.fndtn.reveal', this.settings.open)
|
@@ -4426,7 +4842,6 @@
|
|
4426
4842
|
return true;
|
4427
4843
|
},
|
4428
4844
|
|
4429
|
-
|
4430
4845
|
open : function (target, ajax_settings) {
|
4431
4846
|
var self = this,
|
4432
4847
|
modal;
|
@@ -4448,7 +4863,7 @@
|
|
4448
4863
|
settings = settings || this.settings;
|
4449
4864
|
|
4450
4865
|
|
4451
|
-
if (modal.hasClass('open') && target.attr('data-reveal-id') == modal.attr('id')) {
|
4866
|
+
if (modal.hasClass('open') && target !== undefined && target.attr('data-reveal-id') == modal.attr('id')) {
|
4452
4867
|
return self.close(modal);
|
4453
4868
|
}
|
4454
4869
|
|
@@ -4460,8 +4875,15 @@
|
|
4460
4875
|
.data('offset', this.cache_offset(modal));
|
4461
4876
|
}
|
4462
4877
|
|
4878
|
+
modal.attr('tabindex','0').attr('aria-hidden','false');
|
4879
|
+
|
4463
4880
|
this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open
|
4464
4881
|
|
4882
|
+
// Prevent namespace event from triggering twice
|
4883
|
+
modal.on('open.fndtn.reveal', function(e) {
|
4884
|
+
if (e.namespace !== 'fndtn.reveal') return;
|
4885
|
+
});
|
4886
|
+
|
4465
4887
|
modal.on('open.fndtn.reveal').trigger('open.fndtn.reveal');
|
4466
4888
|
|
4467
4889
|
if (open_modal.length < 1) {
|
@@ -4470,37 +4892,60 @@
|
|
4470
4892
|
|
4471
4893
|
if (typeof ajax_settings === 'string') {
|
4472
4894
|
ajax_settings = {
|
4473
|
-
url: ajax_settings
|
4895
|
+
url : ajax_settings
|
4474
4896
|
};
|
4475
4897
|
}
|
4476
4898
|
|
4477
|
-
|
4478
|
-
if
|
4479
|
-
|
4899
|
+
var openModal = function() {
|
4900
|
+
if(open_modal.length > 0) {
|
4901
|
+
if(settings.multiple_opened) {
|
4902
|
+
self.to_back(open_modal);
|
4903
|
+
} else {
|
4904
|
+
self.hide(open_modal, settings.css.close);
|
4905
|
+
}
|
4480
4906
|
}
|
4481
4907
|
|
4482
|
-
|
4908
|
+
// bl: add the open_modal that isn't already in the background to the openModals array
|
4909
|
+
if(settings.multiple_opened) {
|
4910
|
+
openModals.push(modal);
|
4911
|
+
}
|
4912
|
+
|
4913
|
+
self.show(modal, settings.css.open);
|
4914
|
+
};
|
4915
|
+
|
4916
|
+
if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
|
4917
|
+
openModal();
|
4483
4918
|
} else {
|
4484
4919
|
var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
|
4485
|
-
|
4486
4920
|
$.extend(ajax_settings, {
|
4487
|
-
success: function (data, textStatus, jqXHR) {
|
4921
|
+
success : function (data, textStatus, jqXHR) {
|
4488
4922
|
if ( $.isFunction(old_success) ) {
|
4489
4923
|
var result = old_success(data, textStatus, jqXHR);
|
4490
|
-
if (typeof result == 'string')
|
4924
|
+
if (typeof result == 'string') {
|
4925
|
+
data = result;
|
4926
|
+
}
|
4927
|
+
}
|
4928
|
+
|
4929
|
+
if (typeof options !== 'undefined' && typeof options.replaceContentSel !== 'undefined') {
|
4930
|
+
modal.find(options.replaceContentSel).html(data);
|
4931
|
+
} else {
|
4932
|
+
modal.html(data);
|
4491
4933
|
}
|
4492
4934
|
|
4493
|
-
modal.html(data);
|
4494
4935
|
self.S(modal).foundation('section', 'reflow');
|
4495
4936
|
self.S(modal).children().foundation();
|
4496
4937
|
|
4497
|
-
|
4498
|
-
self.hide(open_modal, settings.css.close);
|
4499
|
-
}
|
4500
|
-
self.show(modal, settings.css.open);
|
4938
|
+
openModal();
|
4501
4939
|
}
|
4502
4940
|
});
|
4503
4941
|
|
4942
|
+
// check for if user initalized with error callback
|
4943
|
+
if (settings.on_ajax_error !== $.noop) {
|
4944
|
+
$.extend(ajax_settings, {
|
4945
|
+
error : settings.on_ajax_error
|
4946
|
+
});
|
4947
|
+
}
|
4948
|
+
|
4504
4949
|
$.ajax(ajax_settings);
|
4505
4950
|
}
|
4506
4951
|
}
|
@@ -4510,14 +4955,48 @@
|
|
4510
4955
|
close : function (modal) {
|
4511
4956
|
var modal = modal && modal.length ? modal : this.S(this.scope),
|
4512
4957
|
open_modals = this.S('[' + this.attr_name() + '].open'),
|
4513
|
-
settings = modal.data(this.attr_name(true) + '-init') || this.settings
|
4958
|
+
settings = modal.data(this.attr_name(true) + '-init') || this.settings,
|
4959
|
+
self = this;
|
4514
4960
|
|
4515
4961
|
if (open_modals.length > 0) {
|
4962
|
+
|
4963
|
+
modal.removeAttr('tabindex','0').attr('aria-hidden','true');
|
4964
|
+
|
4516
4965
|
this.locked = true;
|
4517
4966
|
this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open
|
4518
|
-
|
4519
|
-
|
4520
|
-
|
4967
|
+
|
4968
|
+
modal.trigger('close.fndtn.reveal');
|
4969
|
+
|
4970
|
+
if ((settings.multiple_opened && open_modals.length === 1) || !settings.multiple_opened || modal.length > 1) {
|
4971
|
+
self.toggle_bg(modal, false);
|
4972
|
+
self.to_front(modal);
|
4973
|
+
}
|
4974
|
+
|
4975
|
+
if (settings.multiple_opened) {
|
4976
|
+
var isCurrent = modal.is(':not(.toback)');
|
4977
|
+
self.hide(modal, settings.css.close, settings);
|
4978
|
+
if(isCurrent) {
|
4979
|
+
// remove the last modal since it is now closed
|
4980
|
+
openModals.pop();
|
4981
|
+
} else {
|
4982
|
+
// if this isn't the current modal, then find it in the array and remove it
|
4983
|
+
openModals = $.grep(openModals, function(elt) {
|
4984
|
+
var isThis = elt[0]===modal[0];
|
4985
|
+
if(isThis) {
|
4986
|
+
// since it's not currently in the front, put it in the front now that it is hidden
|
4987
|
+
// so that if it's re-opened, it won't be .toback
|
4988
|
+
self.to_front(modal);
|
4989
|
+
}
|
4990
|
+
return !isThis;
|
4991
|
+
});
|
4992
|
+
}
|
4993
|
+
// finally, show the next modal in the stack, if there is one
|
4994
|
+
if(openModals.length>0) {
|
4995
|
+
self.to_front(openModals[openModals.length - 1]);
|
4996
|
+
}
|
4997
|
+
} else {
|
4998
|
+
self.hide(open_modals, settings.css.close, settings);
|
4999
|
+
}
|
4521
5000
|
}
|
4522
5001
|
},
|
4523
5002
|
|
@@ -4551,12 +5030,13 @@
|
|
4551
5030
|
// is modal
|
4552
5031
|
if (css) {
|
4553
5032
|
var settings = el.data(this.attr_name(true) + '-init') || this.settings,
|
4554
|
-
root_element = settings.root_element
|
5033
|
+
root_element = settings.root_element,
|
5034
|
+
context = this;
|
4555
5035
|
|
4556
5036
|
if (el.parent(root_element).length === 0) {
|
4557
5037
|
var placeholder = el.wrap('<div style="display: none;" />').parent();
|
4558
5038
|
|
4559
|
-
el.on('closed.fndtn.reveal.wrapped', function() {
|
5039
|
+
el.on('closed.fndtn.reveal.wrapped', function () {
|
4560
5040
|
el.detach().appendTo(placeholder);
|
4561
5041
|
el.unwrap().unbind('closed.fndtn.reveal.wrapped');
|
4562
5042
|
});
|
@@ -4579,29 +5059,30 @@
|
|
4579
5059
|
return el
|
4580
5060
|
.css(css)
|
4581
5061
|
.animate(end_css, settings.animation_speed, 'linear', function () {
|
4582
|
-
|
4583
|
-
el.trigger('opened
|
4584
|
-
}
|
5062
|
+
context.locked = false;
|
5063
|
+
el.trigger('opened.fndtn.reveal');
|
5064
|
+
})
|
4585
5065
|
.addClass('open');
|
4586
|
-
}
|
5066
|
+
}, settings.animation_speed / 2);
|
4587
5067
|
}
|
4588
5068
|
|
5069
|
+
css.top = $(window).scrollTop() + el.data('css-top') + 'px';
|
5070
|
+
|
4589
5071
|
if (animData.fade) {
|
4590
|
-
css.top = $(window).scrollTop() + el.data('css-top') + 'px';
|
4591
5072
|
var end_css = {opacity: 1};
|
4592
5073
|
|
4593
5074
|
return setTimeout(function () {
|
4594
5075
|
return el
|
4595
5076
|
.css(css)
|
4596
5077
|
.animate(end_css, settings.animation_speed, 'linear', function () {
|
4597
|
-
|
4598
|
-
el.trigger('opened
|
4599
|
-
}
|
5078
|
+
context.locked = false;
|
5079
|
+
el.trigger('opened.fndtn.reveal');
|
5080
|
+
})
|
4600
5081
|
.addClass('open');
|
4601
|
-
}
|
5082
|
+
}, settings.animation_speed / 2);
|
4602
5083
|
}
|
4603
5084
|
|
4604
|
-
return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened
|
5085
|
+
return el.css(css).show().css({opacity : 1}).addClass('open').trigger('opened.fndtn.reveal');
|
4605
5086
|
}
|
4606
5087
|
|
4607
5088
|
var settings = this.settings;
|
@@ -4616,10 +5097,19 @@
|
|
4616
5097
|
return el.show();
|
4617
5098
|
},
|
4618
5099
|
|
5100
|
+
to_back : function(el) {
|
5101
|
+
el.addClass('toback');
|
5102
|
+
},
|
5103
|
+
|
5104
|
+
to_front : function(el) {
|
5105
|
+
el.removeClass('toback');
|
5106
|
+
},
|
5107
|
+
|
4619
5108
|
hide : function (el, css) {
|
4620
5109
|
// is modal
|
4621
5110
|
if (css) {
|
4622
|
-
var settings = el.data(this.attr_name(true) + '-init')
|
5111
|
+
var settings = el.data(this.attr_name(true) + '-init'),
|
5112
|
+
context = this;
|
4623
5113
|
settings = settings || this.settings;
|
4624
5114
|
|
4625
5115
|
var animData = getAnimationData(settings.animation);
|
@@ -4635,27 +5125,27 @@
|
|
4635
5125
|
return setTimeout(function () {
|
4636
5126
|
return el
|
4637
5127
|
.animate(end_css, settings.animation_speed, 'linear', function () {
|
4638
|
-
|
4639
|
-
el.css(css).trigger('closed
|
4640
|
-
}
|
5128
|
+
context.locked = false;
|
5129
|
+
el.css(css).trigger('closed.fndtn.reveal');
|
5130
|
+
})
|
4641
5131
|
.removeClass('open');
|
4642
|
-
}
|
5132
|
+
}, settings.animation_speed / 2);
|
4643
5133
|
}
|
4644
5134
|
|
4645
5135
|
if (animData.fade) {
|
4646
|
-
var end_css = {opacity: 0};
|
5136
|
+
var end_css = {opacity : 0};
|
4647
5137
|
|
4648
5138
|
return setTimeout(function () {
|
4649
5139
|
return el
|
4650
5140
|
.animate(end_css, settings.animation_speed, 'linear', function () {
|
4651
|
-
|
4652
|
-
el.css(css).trigger('closed
|
4653
|
-
}
|
5141
|
+
context.locked = false;
|
5142
|
+
el.css(css).trigger('closed.fndtn.reveal');
|
5143
|
+
})
|
4654
5144
|
.removeClass('open');
|
4655
|
-
}
|
5145
|
+
}, settings.animation_speed / 2);
|
4656
5146
|
}
|
4657
5147
|
|
4658
|
-
return el.hide().css(css).removeClass('open').trigger('closed
|
5148
|
+
return el.hide().css(css).removeClass('open').trigger('closed.fndtn.reveal');
|
4659
5149
|
}
|
4660
5150
|
|
4661
5151
|
var settings = this.settings;
|
@@ -4696,7 +5186,7 @@
|
|
4696
5186
|
}
|
4697
5187
|
},
|
4698
5188
|
|
4699
|
-
data_attr: function (str) {
|
5189
|
+
data_attr : function (str) {
|
4700
5190
|
if (this.namespace.length > 0) {
|
4701
5191
|
return this.namespace + '-' + str;
|
4702
5192
|
}
|
@@ -4705,7 +5195,7 @@
|
|
4705
5195
|
},
|
4706
5196
|
|
4707
5197
|
cache_offset : function (modal) {
|
4708
|
-
var offset = modal.show().height() + parseInt(modal.css('top'), 10);
|
5198
|
+
var offset = modal.show().height() + parseInt(modal.css('top'), 10) + modal.scrollY;
|
4709
5199
|
|
4710
5200
|
modal.hide();
|
4711
5201
|
|
@@ -4730,9 +5220,9 @@
|
|
4730
5220
|
var fade = /fade/i.test(str);
|
4731
5221
|
var pop = /pop/i.test(str);
|
4732
5222
|
return {
|
4733
|
-
animate: fade || pop,
|
4734
|
-
pop: pop,
|
4735
|
-
fade: fade
|
5223
|
+
animate : fade || pop,
|
5224
|
+
pop : pop,
|
5225
|
+
fade : fade
|
4736
5226
|
};
|
4737
5227
|
}
|
4738
5228
|
}(jQuery, window, window.document));
|
@@ -4743,41 +5233,40 @@
|
|
4743
5233
|
Foundation.libs.slider = {
|
4744
5234
|
name : 'slider',
|
4745
5235
|
|
4746
|
-
version : '5.5.
|
5236
|
+
version : '5.5.3',
|
4747
5237
|
|
4748
|
-
settings: {
|
4749
|
-
start: 0,
|
4750
|
-
end: 100,
|
4751
|
-
step: 1,
|
4752
|
-
precision:
|
4753
|
-
initial: null,
|
4754
|
-
display_selector: '',
|
4755
|
-
vertical: false,
|
4756
|
-
trigger_input_change: false,
|
4757
|
-
on_change: function(){}
|
5238
|
+
settings : {
|
5239
|
+
start : 0,
|
5240
|
+
end : 100,
|
5241
|
+
step : 1,
|
5242
|
+
precision : 2,
|
5243
|
+
initial : null,
|
5244
|
+
display_selector : '',
|
5245
|
+
vertical : false,
|
5246
|
+
trigger_input_change : false,
|
5247
|
+
on_change : function () {}
|
4758
5248
|
},
|
4759
5249
|
|
4760
5250
|
cache : {},
|
4761
5251
|
|
4762
5252
|
init : function (scope, method, options) {
|
4763
|
-
Foundation.inherit(this,'throttle');
|
5253
|
+
Foundation.inherit(this, 'throttle');
|
4764
5254
|
this.bindings(method, options);
|
4765
5255
|
this.reflow();
|
4766
5256
|
},
|
4767
5257
|
|
4768
|
-
events : function() {
|
5258
|
+
events : function () {
|
4769
5259
|
var self = this;
|
4770
|
-
|
4771
5260
|
$(this.scope)
|
4772
5261
|
.off('.slider')
|
4773
5262
|
.on('mousedown.fndtn.slider touchstart.fndtn.slider pointerdown.fndtn.slider',
|
4774
|
-
'[' + self.attr_name() + ']:not(.disabled, [disabled]) .range-slider-handle', function(e) {
|
5263
|
+
'[' + self.attr_name() + ']:not(.disabled, [disabled]) .range-slider-handle', function (e) {
|
4775
5264
|
if (!self.cache.active) {
|
4776
5265
|
e.preventDefault();
|
4777
5266
|
self.set_active_slider($(e.target));
|
4778
5267
|
}
|
4779
5268
|
})
|
4780
|
-
.on('mousemove.fndtn.slider touchmove.fndtn.slider pointermove.fndtn.slider', function(e) {
|
5269
|
+
.on('mousemove.fndtn.slider touchmove.fndtn.slider pointermove.fndtn.slider', function (e) {
|
4781
5270
|
if (!!self.cache.active) {
|
4782
5271
|
e.preventDefault();
|
4783
5272
|
if ($.data(self.cache.active[0], 'settings').vertical) {
|
@@ -4791,48 +5280,80 @@
|
|
4791
5280
|
}
|
4792
5281
|
}
|
4793
5282
|
})
|
4794
|
-
.on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider', function(e) {
|
5283
|
+
.on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider', function (e) {
|
5284
|
+
if(!self.cache.active) {
|
5285
|
+
// if the user has just clicked into the slider without starting to drag the handle
|
5286
|
+
var slider = $(e.target).attr('role') === 'slider' ? $(e.target) : $(e.target).closest('.range-slider').find("[role='slider']");
|
5287
|
+
|
5288
|
+
if (slider.length && (!slider.parent().hasClass('disabled') && !slider.parent().attr('disabled'))) {
|
5289
|
+
self.set_active_slider(slider);
|
5290
|
+
if ($.data(self.cache.active[0], 'settings').vertical) {
|
5291
|
+
var scroll_offset = 0;
|
5292
|
+
if (!e.pageY) {
|
5293
|
+
scroll_offset = window.scrollY;
|
5294
|
+
}
|
5295
|
+
self.calculate_position(self.cache.active, self.get_cursor_position(e, 'y') + scroll_offset);
|
5296
|
+
} else {
|
5297
|
+
self.calculate_position(self.cache.active, self.get_cursor_position(e, 'x'));
|
5298
|
+
}
|
5299
|
+
}
|
5300
|
+
}
|
4795
5301
|
self.remove_active_slider();
|
4796
5302
|
})
|
4797
|
-
.on('change.fndtn.slider', function(e) {
|
5303
|
+
.on('change.fndtn.slider', function (e) {
|
4798
5304
|
self.settings.on_change();
|
4799
5305
|
});
|
4800
5306
|
|
4801
5307
|
self.S(window)
|
4802
|
-
.on('resize.fndtn.slider', self.throttle(function(e) {
|
5308
|
+
.on('resize.fndtn.slider', self.throttle(function (e) {
|
4803
5309
|
self.reflow();
|
4804
5310
|
}, 300));
|
5311
|
+
|
5312
|
+
// update slider value as users change input value
|
5313
|
+
this.S('[' + this.attr_name() + ']').each(function () {
|
5314
|
+
var slider = $(this),
|
5315
|
+
handle = slider.children('.range-slider-handle')[0],
|
5316
|
+
settings = self.initialize_settings(handle);
|
5317
|
+
|
5318
|
+
if (settings.display_selector != '') {
|
5319
|
+
$(settings.display_selector).each(function(){
|
5320
|
+
if ($(this).attr('value')) {
|
5321
|
+
$(this).off('change').on('change', function () {
|
5322
|
+
slider.foundation("slider", "set_value", $(this).val());
|
5323
|
+
});
|
5324
|
+
}
|
5325
|
+
});
|
5326
|
+
}
|
5327
|
+
});
|
4805
5328
|
},
|
4806
5329
|
|
4807
|
-
get_cursor_position : function(e, xy) {
|
5330
|
+
get_cursor_position : function (e, xy) {
|
4808
5331
|
var pageXY = 'page' + xy.toUpperCase(),
|
4809
5332
|
clientXY = 'client' + xy.toUpperCase(),
|
4810
5333
|
position;
|
4811
5334
|
|
4812
5335
|
if (typeof e[pageXY] !== 'undefined') {
|
4813
5336
|
position = e[pageXY];
|
4814
|
-
}
|
4815
|
-
else if (typeof e.originalEvent[clientXY] !== 'undefined') {
|
5337
|
+
} else if (typeof e.originalEvent[clientXY] !== 'undefined') {
|
4816
5338
|
position = e.originalEvent[clientXY];
|
4817
|
-
}
|
4818
|
-
else if (e.originalEvent.touches && e.originalEvent.touches[0] && typeof e.originalEvent.touches[0][clientXY] !== 'undefined') {
|
5339
|
+
} else if (e.originalEvent.touches && e.originalEvent.touches[0] && typeof e.originalEvent.touches[0][clientXY] !== 'undefined') {
|
4819
5340
|
position = e.originalEvent.touches[0][clientXY];
|
4820
|
-
}
|
4821
|
-
else if(e.currentPoint && typeof e.currentPoint[xy] !== 'undefined') {
|
5341
|
+
} else if (e.currentPoint && typeof e.currentPoint[xy] !== 'undefined') {
|
4822
5342
|
position = e.currentPoint[xy];
|
4823
5343
|
}
|
5344
|
+
|
4824
5345
|
return position;
|
4825
5346
|
},
|
4826
5347
|
|
4827
|
-
set_active_slider : function($handle) {
|
5348
|
+
set_active_slider : function ($handle) {
|
4828
5349
|
this.cache.active = $handle;
|
4829
5350
|
},
|
4830
5351
|
|
4831
|
-
remove_active_slider : function() {
|
5352
|
+
remove_active_slider : function () {
|
4832
5353
|
this.cache.active = null;
|
4833
5354
|
},
|
4834
5355
|
|
4835
|
-
calculate_position : function($handle, cursor_x) {
|
5356
|
+
calculate_position : function ($handle, cursor_x) {
|
4836
5357
|
var self = this,
|
4837
5358
|
settings = $.data($handle[0], 'settings'),
|
4838
5359
|
handle_l = $.data($handle[0], 'handle_l'),
|
@@ -4840,16 +5361,16 @@
|
|
4840
5361
|
bar_l = $.data($handle[0], 'bar_l'),
|
4841
5362
|
bar_o = $.data($handle[0], 'bar_o');
|
4842
5363
|
|
4843
|
-
requestAnimationFrame(function(){
|
5364
|
+
requestAnimationFrame(function () {
|
4844
5365
|
var pct;
|
4845
5366
|
|
4846
5367
|
if (Foundation.rtl && !settings.vertical) {
|
4847
|
-
pct = self.limit_to(((bar_o+bar_l-cursor_x)/bar_l),0,1);
|
5368
|
+
pct = self.limit_to(((bar_o + bar_l - cursor_x) / bar_l), 0, 1);
|
4848
5369
|
} else {
|
4849
|
-
pct = self.limit_to(((cursor_x-bar_o)/bar_l),0,1);
|
5370
|
+
pct = self.limit_to(((cursor_x - bar_o) / bar_l), 0, 1);
|
4850
5371
|
}
|
4851
5372
|
|
4852
|
-
pct = settings.vertical ? 1-pct : pct;
|
5373
|
+
pct = settings.vertical ? 1 - pct : pct;
|
4853
5374
|
|
4854
5375
|
var norm = self.normalized_value(pct, settings.start, settings.end, settings.step, settings.precision);
|
4855
5376
|
|
@@ -4857,13 +5378,13 @@
|
|
4857
5378
|
});
|
4858
5379
|
},
|
4859
5380
|
|
4860
|
-
set_ui : function($handle, value) {
|
5381
|
+
set_ui : function ($handle, value) {
|
4861
5382
|
var settings = $.data($handle[0], 'settings'),
|
4862
5383
|
handle_l = $.data($handle[0], 'handle_l'),
|
4863
5384
|
bar_l = $.data($handle[0], 'bar_l'),
|
4864
5385
|
norm_pct = this.normalized_percentage(value, settings.start, settings.end),
|
4865
|
-
handle_offset = norm_pct*(bar_l-handle_l)-1,
|
4866
|
-
progress_bar_length = norm_pct*100,
|
5386
|
+
handle_offset = norm_pct * (bar_l - handle_l) - 1,
|
5387
|
+
progress_bar_length = norm_pct * 100,
|
4867
5388
|
$handle_parent = $handle.parent(),
|
4868
5389
|
$hidden_inputs = $handle.parent().children('input[type=hidden]');
|
4869
5390
|
|
@@ -4880,24 +5401,24 @@
|
|
4880
5401
|
$handle.siblings('.range-slider-active-segment').css('width', progress_bar_length + '%');
|
4881
5402
|
}
|
4882
5403
|
|
4883
|
-
$handle_parent.attr(this.attr_name(), value).trigger('change
|
5404
|
+
$handle_parent.attr(this.attr_name(), value).trigger('change.fndtn.slider');
|
4884
5405
|
|
4885
5406
|
$hidden_inputs.val(value);
|
4886
5407
|
if (settings.trigger_input_change) {
|
4887
|
-
$hidden_inputs.trigger('change');
|
5408
|
+
$hidden_inputs.trigger('change.fndtn.slider');
|
4888
5409
|
}
|
4889
5410
|
|
4890
5411
|
if (!$handle[0].hasAttribute('aria-valuemin')) {
|
4891
5412
|
$handle.attr({
|
4892
|
-
'aria-valuemin': settings.start,
|
4893
|
-
'aria-valuemax': settings.end
|
5413
|
+
'aria-valuemin' : settings.start,
|
5414
|
+
'aria-valuemax' : settings.end
|
4894
5415
|
});
|
4895
5416
|
}
|
4896
5417
|
$handle.attr('aria-valuenow', value);
|
4897
5418
|
|
4898
5419
|
if (settings.display_selector != '') {
|
4899
|
-
$(settings.display_selector).each(function(){
|
4900
|
-
if (this.
|
5420
|
+
$(settings.display_selector).each(function () {
|
5421
|
+
if (this.hasAttribute('value')) {
|
4901
5422
|
$(this).val(value);
|
4902
5423
|
} else {
|
4903
5424
|
$(this).text(value);
|
@@ -4907,44 +5428,42 @@
|
|
4907
5428
|
|
4908
5429
|
},
|
4909
5430
|
|
4910
|
-
normalized_percentage : function(val, start, end) {
|
4911
|
-
return Math.min(1, (val - start)/(end - start));
|
5431
|
+
normalized_percentage : function (val, start, end) {
|
5432
|
+
return Math.min(1, (val - start) / (end - start));
|
4912
5433
|
},
|
4913
5434
|
|
4914
|
-
normalized_value : function(val, start, end, step, precision) {
|
5435
|
+
normalized_value : function (val, start, end, step, precision) {
|
4915
5436
|
var range = end - start,
|
4916
|
-
point = val*range,
|
4917
|
-
mod = (point-(point%step)) / step,
|
5437
|
+
point = val * range,
|
5438
|
+
mod = (point - (point % step)) / step,
|
4918
5439
|
rem = point % step,
|
4919
|
-
round = ( rem >= step*0.5 ? step : 0);
|
4920
|
-
return ((mod*step + round) + start).toFixed(precision);
|
5440
|
+
round = ( rem >= step * 0.5 ? step : 0);
|
5441
|
+
return ((mod * step + round) + start).toFixed(precision);
|
4921
5442
|
},
|
4922
5443
|
|
4923
|
-
set_translate : function(ele, offset, vertical) {
|
5444
|
+
set_translate : function (ele, offset, vertical) {
|
4924
5445
|
if (vertical) {
|
4925
5446
|
$(ele)
|
4926
|
-
.css('-webkit-transform', 'translateY('+offset+'px)')
|
4927
|
-
.css('-moz-transform', 'translateY('+offset+'px)')
|
4928
|
-
.css('-ms-transform', 'translateY('+offset+'px)')
|
4929
|
-
.css('-o-transform', 'translateY('+offset+'px)')
|
4930
|
-
.css('transform', 'translateY('+offset+'px)');
|
5447
|
+
.css('-webkit-transform', 'translateY(' + offset + 'px)')
|
5448
|
+
.css('-moz-transform', 'translateY(' + offset + 'px)')
|
5449
|
+
.css('-ms-transform', 'translateY(' + offset + 'px)')
|
5450
|
+
.css('-o-transform', 'translateY(' + offset + 'px)')
|
5451
|
+
.css('transform', 'translateY(' + offset + 'px)');
|
4931
5452
|
} else {
|
4932
5453
|
$(ele)
|
4933
|
-
.css('-webkit-transform', 'translateX('+offset+'px)')
|
4934
|
-
.css('-moz-transform', 'translateX('+offset+'px)')
|
4935
|
-
.css('-ms-transform', 'translateX('+offset+'px)')
|
4936
|
-
.css('-o-transform', 'translateX('+offset+'px)')
|
4937
|
-
.css('transform', 'translateX('+offset+'px)');
|
5454
|
+
.css('-webkit-transform', 'translateX(' + offset + 'px)')
|
5455
|
+
.css('-moz-transform', 'translateX(' + offset + 'px)')
|
5456
|
+
.css('-ms-transform', 'translateX(' + offset + 'px)')
|
5457
|
+
.css('-o-transform', 'translateX(' + offset + 'px)')
|
5458
|
+
.css('transform', 'translateX(' + offset + 'px)');
|
4938
5459
|
}
|
4939
5460
|
},
|
4940
5461
|
|
4941
|
-
limit_to : function(val, min, max) {
|
5462
|
+
limit_to : function (val, min, max) {
|
4942
5463
|
return Math.min(Math.max(val, min), max);
|
4943
5464
|
},
|
4944
5465
|
|
4945
|
-
|
4946
|
-
|
4947
|
-
initialize_settings : function(handle) {
|
5466
|
+
initialize_settings : function (handle) {
|
4948
5467
|
var settings = $.extend({}, this.settings, this.data_options($(handle).parent())),
|
4949
5468
|
decimal_places_match_result;
|
4950
5469
|
|
@@ -4966,19 +5485,19 @@
|
|
4966
5485
|
}
|
4967
5486
|
|
4968
5487
|
$.data(handle, 'bar', $(handle).parent());
|
4969
|
-
$.data(handle, 'settings', settings);
|
5488
|
+
return $.data(handle, 'settings', settings);
|
4970
5489
|
},
|
4971
5490
|
|
4972
|
-
set_initial_position : function($ele) {
|
5491
|
+
set_initial_position : function ($ele) {
|
4973
5492
|
var settings = $.data($ele.children('.range-slider-handle')[0], 'settings'),
|
4974
|
-
initial = ((typeof settings.initial == 'number' && !isNaN(settings.initial)) ? settings.initial : Math.floor((settings.end-settings.start)*0.5/settings.step)*settings.step+settings.start),
|
5493
|
+
initial = ((typeof settings.initial == 'number' && !isNaN(settings.initial)) ? settings.initial : Math.floor((settings.end - settings.start) * 0.5 / settings.step) * settings.step + settings.start),
|
4975
5494
|
$handle = $ele.children('.range-slider-handle');
|
4976
5495
|
this.set_ui($handle, initial);
|
4977
5496
|
},
|
4978
5497
|
|
4979
|
-
set_value : function(value) {
|
5498
|
+
set_value : function (value) {
|
4980
5499
|
var self = this;
|
4981
|
-
$('[' + self.attr_name() + ']', this.scope).each(function(){
|
5500
|
+
$('[' + self.attr_name() + ']', this.scope).each(function () {
|
4982
5501
|
$(this).attr(self.attr_name(), value);
|
4983
5502
|
});
|
4984
5503
|
if (!!$(this.scope).attr(self.attr_name())) {
|
@@ -4987,9 +5506,9 @@
|
|
4987
5506
|
self.reflow();
|
4988
5507
|
},
|
4989
5508
|
|
4990
|
-
reflow : function() {
|
5509
|
+
reflow : function () {
|
4991
5510
|
var self = this;
|
4992
|
-
self.S('[' + this.attr_name() + ']').each(function() {
|
5511
|
+
self.S('[' + this.attr_name() + ']').each(function () {
|
4993
5512
|
var handle = $(this).children('.range-slider-handle')[0],
|
4994
5513
|
val = $(this).attr(self.attr_name());
|
4995
5514
|
self.initialize_settings(handle);
|
@@ -5011,59 +5530,73 @@
|
|
5011
5530
|
Foundation.libs.tab = {
|
5012
5531
|
name : 'tab',
|
5013
5532
|
|
5014
|
-
version : '5.5.
|
5533
|
+
version : '5.5.3',
|
5015
5534
|
|
5016
5535
|
settings : {
|
5017
|
-
active_class: 'active',
|
5536
|
+
active_class : 'active',
|
5018
5537
|
callback : function () {},
|
5019
|
-
deep_linking: false,
|
5020
|
-
scroll_to_content: true,
|
5021
|
-
is_hover: false
|
5538
|
+
deep_linking : false,
|
5539
|
+
scroll_to_content : true,
|
5540
|
+
is_hover : false
|
5022
5541
|
},
|
5023
5542
|
|
5024
|
-
default_tab_hashes: [],
|
5543
|
+
default_tab_hashes : [],
|
5025
5544
|
|
5026
5545
|
init : function (scope, method, options) {
|
5027
5546
|
var self = this,
|
5028
5547
|
S = this.S;
|
5029
5548
|
|
5549
|
+
// Store the default active tabs which will be referenced when the
|
5550
|
+
// location hash is absent, as in the case of navigating the tabs and
|
5551
|
+
// returning to the first viewing via the browser Back button.
|
5552
|
+
S('[' + this.attr_name() + '] > .active > a', this.scope).each(function () {
|
5553
|
+
self.default_tab_hashes.push(this.hash);
|
5554
|
+
});
|
5555
|
+
|
5030
5556
|
this.bindings(method, options);
|
5031
5557
|
this.handle_location_hash_change();
|
5032
|
-
|
5033
|
-
// Store the default active tabs which will be referenced when the
|
5034
|
-
// location hash is absent, as in the case of navigating the tabs and
|
5035
|
-
// returning to the first viewing via the browser Back button.
|
5036
|
-
S('[' + this.attr_name() + '] > .active > a', this.scope).each(function () {
|
5037
|
-
self.default_tab_hashes.push(this.hash);
|
5038
|
-
});
|
5039
|
-
|
5040
|
-
// store the initial href, which is used to allow correct behaviour of the
|
5041
|
-
// browser back button when deep linking is turned on.
|
5042
|
-
self.entry_location = window.location.href;
|
5043
5558
|
},
|
5044
5559
|
|
5045
5560
|
events : function () {
|
5046
5561
|
var self = this,
|
5047
5562
|
S = this.S;
|
5048
5563
|
|
5049
|
-
var usual_tab_behavior = function (e) {
|
5050
|
-
|
5051
|
-
|
5564
|
+
var usual_tab_behavior = function (e, target) {
|
5565
|
+
var settings = S(target).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init');
|
5566
|
+
if (!settings.is_hover || Modernizr.touch) {
|
5567
|
+
// if user did not pressed tab key, prevent default action
|
5568
|
+
var keyCode = e.keyCode || e.which;
|
5569
|
+
if (keyCode !== 9) {
|
5052
5570
|
e.preventDefault();
|
5053
5571
|
e.stopPropagation();
|
5054
|
-
self.toggle_active_tab(S(this).parent());
|
5055
5572
|
}
|
5056
|
-
|
5573
|
+
self.toggle_active_tab(S(target).parent());
|
5574
|
+
|
5575
|
+
}
|
5576
|
+
};
|
5057
5577
|
|
5058
5578
|
S(this.scope)
|
5059
5579
|
.off('.tab')
|
5580
|
+
// Key event: focus/tab key
|
5581
|
+
.on('keydown.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e) {
|
5582
|
+
var keyCode = e.keyCode || e.which;
|
5583
|
+
// if user pressed tab key
|
5584
|
+
if (keyCode === 13 || keyCode === 32) { // enter or space
|
5585
|
+
var el = this;
|
5586
|
+
usual_tab_behavior(e, el);
|
5587
|
+
}
|
5588
|
+
})
|
5060
5589
|
// Click event: tab title
|
5061
|
-
.on('
|
5062
|
-
|
5590
|
+
.on('click.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e) {
|
5591
|
+
var el = this;
|
5592
|
+
usual_tab_behavior(e, el);
|
5593
|
+
})
|
5063
5594
|
// Hover event: tab title
|
5064
5595
|
.on('mouseenter.fndtn.tab', '[' + this.attr_name() + '] > * > a', function (e) {
|
5065
|
-
var settings = S(this).closest('[' + self.attr_name() +']').data(self.attr_name(true) + '-init');
|
5066
|
-
if (settings.is_hover)
|
5596
|
+
var settings = S(this).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init');
|
5597
|
+
if (settings.is_hover) {
|
5598
|
+
self.toggle_active_tab(S(this).parent());
|
5599
|
+
}
|
5067
5600
|
});
|
5068
5601
|
|
5069
5602
|
// Location hash change event
|
@@ -5114,7 +5647,7 @@
|
|
5114
5647
|
});
|
5115
5648
|
},
|
5116
5649
|
|
5117
|
-
toggle_active_tab: function (tab, location_hash) {
|
5650
|
+
toggle_active_tab : function (tab, location_hash) {
|
5118
5651
|
var self = this,
|
5119
5652
|
S = self.S,
|
5120
5653
|
tabs = tab.closest('[' + this.attr_name() + ']'),
|
@@ -5124,7 +5657,7 @@
|
|
5124
5657
|
target = S(target_hash),
|
5125
5658
|
siblings = tab.siblings(),
|
5126
5659
|
settings = tabs.data(this.attr_name(true) + '-init'),
|
5127
|
-
interpret_keyup_action = function(e) {
|
5660
|
+
interpret_keyup_action = function (e) {
|
5128
5661
|
// Light modification of Heydon Pickering's Practical ARIA Examples: http://heydonworks.com/practical_aria_examples/js/a11y.js
|
5129
5662
|
|
5130
5663
|
// define current, previous and next (possible) tabs
|
@@ -5173,17 +5706,16 @@
|
|
5173
5706
|
go_to_hash = function(hash) {
|
5174
5707
|
// This function allows correct behaviour of the browser's back button when deep linking is enabled. Without it
|
5175
5708
|
// the user would get continually redirected to the default hash.
|
5176
|
-
var
|
5177
|
-
default_hash = settings.scroll_to_content ? self.default_tab_hashes[0] : 'fndtn-' + self.default_tab_hashes[0].replace('#', '')
|
5709
|
+
var default_hash = settings.scroll_to_content ? self.default_tab_hashes[0] : 'fndtn-' + self.default_tab_hashes[0].replace('#', '');
|
5178
5710
|
|
5179
|
-
if (
|
5711
|
+
if (hash !== default_hash || window.location.hash) {
|
5180
5712
|
window.location.hash = hash;
|
5181
5713
|
}
|
5182
5714
|
};
|
5183
5715
|
|
5184
5716
|
// allow usage of data-tab-content attribute instead of href
|
5185
|
-
if (
|
5186
|
-
target_hash = '#' +
|
5717
|
+
if (anchor.data('tab-content')) {
|
5718
|
+
target_hash = '#' + anchor.data('tab-content').split('#')[1];
|
5187
5719
|
target = S(target_hash);
|
5188
5720
|
}
|
5189
5721
|
|
@@ -5214,19 +5746,19 @@
|
|
5214
5746
|
// window (notably in Chrome).
|
5215
5747
|
// Clean up multiple attr instances to done once
|
5216
5748
|
tab.addClass(settings.active_class).triggerHandler('opened');
|
5217
|
-
tab_link.attr({'aria-selected': 'true', tabindex: 0});
|
5749
|
+
tab_link.attr({'aria-selected' : 'true', tabindex : 0});
|
5218
5750
|
siblings.removeClass(settings.active_class)
|
5219
|
-
siblings.find('a').attr({'aria-selected': 'false'
|
5220
|
-
target.siblings().removeClass(settings.active_class).attr({'aria-hidden': 'true'
|
5751
|
+
siblings.find('a').attr({'aria-selected' : 'false'/*, tabindex : -1*/});
|
5752
|
+
target.siblings().removeClass(settings.active_class).attr({'aria-hidden' : 'true'/*, tabindex : -1*/});
|
5221
5753
|
target.addClass(settings.active_class).attr('aria-hidden', 'false').removeAttr('tabindex');
|
5222
5754
|
settings.callback(tab);
|
5223
|
-
target.triggerHandler('toggled', [
|
5224
|
-
tabs.triggerHandler('toggled', [
|
5755
|
+
target.triggerHandler('toggled', [target]);
|
5756
|
+
tabs.triggerHandler('toggled', [tab]);
|
5225
5757
|
|
5226
5758
|
tab_link.off('keydown').on('keydown', interpret_keyup_action );
|
5227
5759
|
},
|
5228
5760
|
|
5229
|
-
data_attr: function (str) {
|
5761
|
+
data_attr : function (str) {
|
5230
5762
|
if (this.namespace.length > 0) {
|
5231
5763
|
return this.namespace + '-' + str;
|
5232
5764
|
}
|
@@ -5246,15 +5778,17 @@
|
|
5246
5778
|
Foundation.libs.tooltip = {
|
5247
5779
|
name : 'tooltip',
|
5248
5780
|
|
5249
|
-
version : '5.5.
|
5781
|
+
version : '5.5.3',
|
5250
5782
|
|
5251
5783
|
settings : {
|
5252
5784
|
additional_inheritable_classes : [],
|
5253
5785
|
tooltip_class : '.tooltip',
|
5254
|
-
append_to: 'body',
|
5255
|
-
touch_close_text: 'Tap To Close',
|
5256
|
-
disable_for_touch: false,
|
5257
|
-
hover_delay: 200,
|
5786
|
+
append_to : 'body',
|
5787
|
+
touch_close_text : 'Tap To Close',
|
5788
|
+
disable_for_touch : false,
|
5789
|
+
hover_delay : 200,
|
5790
|
+
fade_in_duration : 150,
|
5791
|
+
fade_out_duration : 150,
|
5258
5792
|
show_on : 'all',
|
5259
5793
|
tip_template : function (selector, content) {
|
5260
5794
|
return '<span data-selector="' + selector + '" id="' + selector + '" class="'
|
@@ -5270,7 +5804,7 @@
|
|
5270
5804
|
this.bindings(method, options);
|
5271
5805
|
},
|
5272
5806
|
|
5273
|
-
should_show: function (target, tip) {
|
5807
|
+
should_show : function (target, tip) {
|
5274
5808
|
var settings = $.extend({}, this.settings, this.data_options(target));
|
5275
5809
|
|
5276
5810
|
if (settings.show_on === 'all') {
|
@@ -5299,6 +5833,31 @@
|
|
5299
5833
|
|
5300
5834
|
self.create(this.S(instance));
|
5301
5835
|
|
5836
|
+
function _startShow(elt, $this, immediate) {
|
5837
|
+
if (elt.timer) {
|
5838
|
+
return;
|
5839
|
+
}
|
5840
|
+
|
5841
|
+
if (immediate) {
|
5842
|
+
elt.timer = null;
|
5843
|
+
self.showTip($this);
|
5844
|
+
} else {
|
5845
|
+
elt.timer = setTimeout(function () {
|
5846
|
+
elt.timer = null;
|
5847
|
+
self.showTip($this);
|
5848
|
+
}.bind(elt), self.settings.hover_delay);
|
5849
|
+
}
|
5850
|
+
}
|
5851
|
+
|
5852
|
+
function _startHide(elt, $this) {
|
5853
|
+
if (elt.timer) {
|
5854
|
+
clearTimeout(elt.timer);
|
5855
|
+
elt.timer = null;
|
5856
|
+
}
|
5857
|
+
|
5858
|
+
self.hide($this);
|
5859
|
+
}
|
5860
|
+
|
5302
5861
|
$(this.scope)
|
5303
5862
|
.off('.tooltip')
|
5304
5863
|
.on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip',
|
@@ -5311,46 +5870,54 @@
|
|
5311
5870
|
return false;
|
5312
5871
|
}
|
5313
5872
|
|
5314
|
-
if (/mouse/i.test(e.type) && self.ie_touch(e))
|
5315
|
-
|
5873
|
+
if (/mouse/i.test(e.type) && self.ie_touch(e)) {
|
5874
|
+
return false;
|
5875
|
+
}
|
5876
|
+
|
5316
5877
|
if ($this.hasClass('open')) {
|
5317
|
-
if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type))
|
5878
|
+
if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
|
5879
|
+
e.preventDefault();
|
5880
|
+
}
|
5318
5881
|
self.hide($this);
|
5319
5882
|
} else {
|
5320
5883
|
if (settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
|
5321
5884
|
return;
|
5322
|
-
} else if(!settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
|
5885
|
+
} else if (!settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
|
5323
5886
|
e.preventDefault();
|
5324
5887
|
S(settings.tooltip_class + '.open').hide();
|
5325
5888
|
is_touch = true;
|
5889
|
+
// close other open tooltips on touch
|
5890
|
+
if ($('.open[' + self.attr_name() + ']').length > 0) {
|
5891
|
+
var prevOpen = S($('.open[' + self.attr_name() + ']')[0]);
|
5892
|
+
self.hide(prevOpen);
|
5893
|
+
}
|
5326
5894
|
}
|
5327
5895
|
|
5328
5896
|
if (/enter|over/i.test(e.type)) {
|
5329
|
-
this
|
5330
|
-
|
5331
|
-
}.bind(this), self.settings.hover_delay);
|
5897
|
+
_startShow(this, $this);
|
5898
|
+
|
5332
5899
|
} else if (e.type === 'mouseout' || e.type === 'mouseleave') {
|
5333
|
-
|
5334
|
-
self.hide($this);
|
5900
|
+
_startHide(this, $this);
|
5335
5901
|
} else {
|
5336
|
-
|
5902
|
+
_startShow(this, $this, true);
|
5337
5903
|
}
|
5338
5904
|
}
|
5339
5905
|
})
|
5340
5906
|
.on('mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', '[' + this.attr_name() + '].open', function (e) {
|
5341
|
-
if (/mouse/i.test(e.type) && self.ie_touch(e))
|
5907
|
+
if (/mouse/i.test(e.type) && self.ie_touch(e)) {
|
5908
|
+
return false;
|
5909
|
+
}
|
5342
5910
|
|
5343
|
-
if($(this).data('tooltip-open-event-type') == 'touch' && e.type == 'mouseleave') {
|
5911
|
+
if ($(this).data('tooltip-open-event-type') == 'touch' && e.type == 'mouseleave') {
|
5344
5912
|
return;
|
5345
|
-
}
|
5346
|
-
else if($(this).data('tooltip-open-event-type') == 'mouse' && /MSPointerDown|touchstart/i.test(e.type)) {
|
5913
|
+
} else if ($(this).data('tooltip-open-event-type') == 'mouse' && /MSPointerDown|touchstart/i.test(e.type)) {
|
5347
5914
|
self.convert_to_touch($(this));
|
5348
5915
|
} else {
|
5349
|
-
|
5916
|
+
_startHide(this, $(this));
|
5350
5917
|
}
|
5351
5918
|
})
|
5352
5919
|
.on('DOMNodeRemoved DOMAttrModified', '[' + this.attr_name() + ']:not(a)', function (e) {
|
5353
|
-
|
5920
|
+
_startHide(this, S(this));
|
5354
5921
|
});
|
5355
5922
|
},
|
5356
5923
|
|
@@ -5361,7 +5928,7 @@
|
|
5361
5928
|
|
5362
5929
|
showTip : function ($target) {
|
5363
5930
|
var $tip = this.getTip($target);
|
5364
|
-
if (this.should_show($target, $tip)){
|
5931
|
+
if (this.should_show($target, $tip)) {
|
5365
5932
|
return this.show($target);
|
5366
5933
|
}
|
5367
5934
|
return;
|
@@ -5380,17 +5947,16 @@
|
|
5380
5947
|
},
|
5381
5948
|
|
5382
5949
|
selector : function ($target) {
|
5383
|
-
var
|
5384
|
-
dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');
|
5950
|
+
var dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');
|
5385
5951
|
|
5386
|
-
if (
|
5952
|
+
if (typeof dataSelector != 'string') {
|
5387
5953
|
dataSelector = this.random_str(6);
|
5388
5954
|
$target
|
5389
5955
|
.attr('data-selector', dataSelector)
|
5390
5956
|
.attr('aria-describedby', dataSelector);
|
5391
5957
|
}
|
5392
5958
|
|
5393
|
-
return
|
5959
|
+
return dataSelector;
|
5394
5960
|
},
|
5395
5961
|
|
5396
5962
|
create : function ($target) {
|
@@ -5408,27 +5974,27 @@
|
|
5408
5974
|
$tip.addClass(classes).appendTo(settings.append_to);
|
5409
5975
|
|
5410
5976
|
if (Modernizr.touch) {
|
5411
|
-
$tip.append('<span class="tap-to-close">'+settings.touch_close_text+'</span>');
|
5412
|
-
$tip.on('touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', function(e) {
|
5977
|
+
$tip.append('<span class="tap-to-close">' + settings.touch_close_text + '</span>');
|
5978
|
+
$tip.on('touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', function (e) {
|
5413
5979
|
self.hide($target);
|
5414
5980
|
});
|
5415
5981
|
}
|
5416
5982
|
|
5417
|
-
$target.removeAttr('title').attr('title','');
|
5983
|
+
$target.removeAttr('title').attr('title', '');
|
5418
5984
|
},
|
5419
5985
|
|
5420
5986
|
reposition : function (target, tip, classes) {
|
5421
|
-
var width, nub, nubHeight, nubWidth,
|
5987
|
+
var width, nub, nubHeight, nubWidth, objPos;
|
5422
5988
|
|
5423
5989
|
tip.css('visibility', 'hidden').show();
|
5424
5990
|
|
5425
5991
|
width = target.data('width');
|
5426
5992
|
nub = tip.children('.nub');
|
5427
5993
|
nubHeight = nub.outerHeight();
|
5428
|
-
nubWidth = nub.
|
5994
|
+
nubWidth = nub.outerWidth();
|
5429
5995
|
|
5430
5996
|
if (this.small()) {
|
5431
|
-
tip.css({'width' : '100%'
|
5997
|
+
tip.css({'width' : '100%'});
|
5432
5998
|
} else {
|
5433
5999
|
tip.css({'width' : (width) ? width : 'auto'});
|
5434
6000
|
}
|
@@ -5441,31 +6007,46 @@
|
|
5441
6007
|
'right' : (right) ? right : 'auto'
|
5442
6008
|
}).end();
|
5443
6009
|
};
|
6010
|
+
|
6011
|
+
var o_top = target.offset().top;
|
6012
|
+
var o_left = target.offset().left;
|
6013
|
+
var outerHeight = target.outerHeight();
|
5444
6014
|
|
5445
|
-
objPos(tip, (
|
6015
|
+
objPos(tip, (o_top + outerHeight + 10), 'auto', 'auto', o_left);
|
5446
6016
|
|
5447
6017
|
if (this.small()) {
|
5448
|
-
objPos(tip, (
|
6018
|
+
objPos(tip, (o_top + outerHeight + 10), 'auto', 'auto', 12.5, $(this.scope).width());
|
5449
6019
|
tip.addClass('tip-override');
|
5450
|
-
objPos(nub, -nubHeight, 'auto', 'auto',
|
6020
|
+
objPos(nub, -nubHeight, 'auto', 'auto', o_left);
|
5451
6021
|
} else {
|
5452
|
-
|
6022
|
+
|
5453
6023
|
if (Foundation.rtl) {
|
5454
6024
|
nub.addClass('rtl');
|
5455
|
-
|
6025
|
+
o_left = o_left + target.outerWidth() - tip.outerWidth();
|
5456
6026
|
}
|
5457
|
-
|
6027
|
+
|
6028
|
+
objPos(tip, (o_top + outerHeight + 10), 'auto', 'auto', o_left);
|
6029
|
+
// reset nub from small styles, if they've been applied
|
6030
|
+
if (nub.attr('style')) {
|
6031
|
+
nub.removeAttr('style');
|
6032
|
+
}
|
6033
|
+
|
5458
6034
|
tip.removeClass('tip-override');
|
6035
|
+
|
6036
|
+
var tip_outerHeight = tip.outerHeight();
|
6037
|
+
|
5459
6038
|
if (classes && classes.indexOf('tip-top') > -1) {
|
5460
|
-
if (Foundation.rtl)
|
5461
|
-
|
6039
|
+
if (Foundation.rtl) {
|
6040
|
+
nub.addClass('rtl');
|
6041
|
+
}
|
6042
|
+
objPos(tip, (o_top - tip_outerHeight), 'auto', 'auto', o_left)
|
5462
6043
|
.removeClass('tip-override');
|
5463
6044
|
} else if (classes && classes.indexOf('tip-left') > -1) {
|
5464
|
-
objPos(tip, (
|
6045
|
+
objPos(tip, (o_top + (outerHeight / 2) - (tip_outerHeight / 2)), 'auto', 'auto', (o_left - tip.outerWidth() - nubHeight))
|
5465
6046
|
.removeClass('tip-override');
|
5466
6047
|
nub.removeClass('rtl');
|
5467
6048
|
} else if (classes && classes.indexOf('tip-right') > -1) {
|
5468
|
-
objPos(tip, (
|
6049
|
+
objPos(tip, (o_top + (outerHeight / 2) - (tip_outerHeight / 2)), 'auto', 'auto', (o_left + target.outerWidth() + nubHeight))
|
5469
6050
|
.removeClass('tip-override');
|
5470
6051
|
nub.removeClass('rtl');
|
5471
6052
|
}
|
@@ -5492,14 +6073,14 @@
|
|
5492
6073
|
return $.trim(filtered);
|
5493
6074
|
},
|
5494
6075
|
|
5495
|
-
convert_to_touch : function($target) {
|
6076
|
+
convert_to_touch : function ($target) {
|
5496
6077
|
var self = this,
|
5497
6078
|
$tip = self.getTip($target),
|
5498
6079
|
settings = $.extend({}, self.settings, self.data_options($target));
|
5499
6080
|
|
5500
6081
|
if ($tip.find('.tap-to-close').length === 0) {
|
5501
|
-
$tip.append('<span class="tap-to-close">'+settings.touch_close_text+'</span>');
|
5502
|
-
$tip.on('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tooltip.tapclose', function(e) {
|
6082
|
+
$tip.append('<span class="tap-to-close">' + settings.touch_close_text + '</span>');
|
6083
|
+
$tip.on('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tooltip.tapclose', function (e) {
|
5503
6084
|
self.hide($target);
|
5504
6085
|
});
|
5505
6086
|
}
|
@@ -5509,20 +6090,19 @@
|
|
5509
6090
|
|
5510
6091
|
show : function ($target) {
|
5511
6092
|
var $tip = this.getTip($target);
|
5512
|
-
|
5513
6093
|
if ($target.data('tooltip-open-event-type') == 'touch') {
|
5514
6094
|
this.convert_to_touch($target);
|
5515
6095
|
}
|
5516
6096
|
|
5517
6097
|
this.reposition($target, $tip, $target.attr('class'));
|
5518
6098
|
$target.addClass('open');
|
5519
|
-
$tip.fadeIn(
|
6099
|
+
$tip.fadeIn(this.settings.fade_in_duration);
|
5520
6100
|
},
|
5521
6101
|
|
5522
6102
|
hide : function ($target) {
|
5523
6103
|
var $tip = this.getTip($target);
|
5524
6104
|
|
5525
|
-
$tip.fadeOut(
|
6105
|
+
$tip.fadeOut(this.settings.fade_out_duration, function () {
|
5526
6106
|
$tip.find('.tap-to-close').remove();
|
5527
6107
|
$tip.off('click.fndtn.tooltip.tapclose MSPointerDown.fndtn.tapclose');
|
5528
6108
|
$target.removeClass('open');
|
@@ -5547,17 +6127,19 @@
|
|
5547
6127
|
Foundation.libs.topbar = {
|
5548
6128
|
name : 'topbar',
|
5549
6129
|
|
5550
|
-
version: '5.5.
|
6130
|
+
version : '5.5.3',
|
5551
6131
|
|
5552
6132
|
settings : {
|
5553
6133
|
index : 0,
|
6134
|
+
start_offset : 0,
|
5554
6135
|
sticky_class : 'sticky',
|
5555
|
-
custom_back_text: true,
|
5556
|
-
back_text: 'Back',
|
5557
|
-
mobile_show_parent_link: true,
|
5558
|
-
is_hover: true,
|
6136
|
+
custom_back_text : true,
|
6137
|
+
back_text : 'Back',
|
6138
|
+
mobile_show_parent_link : true,
|
6139
|
+
is_hover : true,
|
5559
6140
|
scrolltop : true, // jump to top when sticky nav menu toggle is clicked
|
5560
|
-
sticky_on : 'all'
|
6141
|
+
sticky_on : 'all',
|
6142
|
+
dropdown_autoclose: true
|
5561
6143
|
},
|
5562
6144
|
|
5563
6145
|
init : function (section, method, options) {
|
@@ -5603,29 +6185,29 @@
|
|
5603
6185
|
|
5604
6186
|
},
|
5605
6187
|
|
5606
|
-
is_sticky: function (topbar, topbarContainer, settings) {
|
5607
|
-
var sticky
|
6188
|
+
is_sticky : function (topbar, topbarContainer, settings) {
|
6189
|
+
var sticky = topbarContainer.hasClass(settings.sticky_class);
|
6190
|
+
var smallMatch = matchMedia(Foundation.media_queries.small).matches;
|
6191
|
+
var medMatch = matchMedia(Foundation.media_queries.medium).matches;
|
6192
|
+
var lrgMatch = matchMedia(Foundation.media_queries.large).matches;
|
5608
6193
|
|
5609
6194
|
if (sticky && settings.sticky_on === 'all') {
|
5610
6195
|
return true;
|
5611
|
-
}
|
5612
|
-
|
5613
|
-
|
5614
|
-
|
5615
|
-
|
5616
|
-
|
5617
|
-
|
5618
|
-
|
5619
|
-
|
5620
|
-
return (matchMedia(Foundation.media_queries.small).matches && matchMedia(Foundation.media_queries.medium).matches &&
|
5621
|
-
matchMedia(Foundation.media_queries.large).matches);
|
5622
|
-
//return true;
|
6196
|
+
}
|
6197
|
+
if (sticky && this.small() && settings.sticky_on.indexOf('small') !== -1) {
|
6198
|
+
if (smallMatch && !medMatch && !lrgMatch) { return true; }
|
6199
|
+
}
|
6200
|
+
if (sticky && this.medium() && settings.sticky_on.indexOf('medium') !== -1) {
|
6201
|
+
if (smallMatch && medMatch && !lrgMatch) { return true; }
|
6202
|
+
}
|
6203
|
+
if (sticky && this.large() && settings.sticky_on.indexOf('large') !== -1) {
|
6204
|
+
if (smallMatch && medMatch && lrgMatch) { return true; }
|
5623
6205
|
}
|
5624
6206
|
|
5625
|
-
|
6207
|
+
return false;
|
5626
6208
|
},
|
5627
6209
|
|
5628
|
-
toggle: function (toggleEl) {
|
6210
|
+
toggle : function (toggleEl) {
|
5629
6211
|
var self = this,
|
5630
6212
|
topbar;
|
5631
6213
|
|
@@ -5641,11 +6223,11 @@
|
|
5641
6223
|
|
5642
6224
|
if (self.breakpoint()) {
|
5643
6225
|
if (!self.rtl) {
|
5644
|
-
section.css({left: '0%'});
|
5645
|
-
$('>.name', section).css({left: '100%'});
|
6226
|
+
section.css({left : '0%'});
|
6227
|
+
$('>.name', section).css({left : '100%'});
|
5646
6228
|
} else {
|
5647
|
-
section.css({right: '0%'});
|
5648
|
-
$('>.name', section).css({right: '100%'});
|
6229
|
+
section.css({right : '0%'});
|
6230
|
+
$('>.name', section).css({right : '100%'});
|
5649
6231
|
}
|
5650
6232
|
|
5651
6233
|
self.S('li.moved', section).removeClass('moved');
|
@@ -5669,7 +6251,7 @@
|
|
5669
6251
|
topbar.addClass('fixed');
|
5670
6252
|
self.S('body').removeClass('f-topbar-fixed');
|
5671
6253
|
|
5672
|
-
window.scrollTo(0,0);
|
6254
|
+
window.scrollTo(0, 0);
|
5673
6255
|
} else {
|
5674
6256
|
topbar.parent().removeClass('expanded');
|
5675
6257
|
}
|
@@ -5705,12 +6287,19 @@
|
|
5705
6287
|
e.preventDefault();
|
5706
6288
|
self.toggle(this);
|
5707
6289
|
})
|
5708
|
-
.on('click.fndtn.topbar','.top-bar .top-bar-section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li a[href^="#"]',function (e) {
|
5709
|
-
|
5710
|
-
|
5711
|
-
|
6290
|
+
.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) {
|
6291
|
+
var li = $(this).closest('li'),
|
6292
|
+
topbar = li.closest('[' + self.attr_name() + ']'),
|
6293
|
+
settings = topbar.data(self.attr_name(true) + '-init');
|
6294
|
+
|
6295
|
+
if (settings.dropdown_autoclose && settings.is_hover) {
|
6296
|
+
var hoverLi = $(this).closest('.hover');
|
6297
|
+
hoverLi.removeClass('hover');
|
6298
|
+
}
|
6299
|
+
if (self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown')) {
|
5712
6300
|
self.toggle();
|
5713
|
-
|
6301
|
+
}
|
6302
|
+
|
5714
6303
|
})
|
5715
6304
|
.on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) {
|
5716
6305
|
var li = S(this),
|
@@ -5718,13 +6307,18 @@
|
|
5718
6307
|
topbar = li.closest('[' + self.attr_name() + ']'),
|
5719
6308
|
settings = topbar.data(self.attr_name(true) + '-init');
|
5720
6309
|
|
5721
|
-
if(target.data('revealId')) {
|
6310
|
+
if (target.data('revealId')) {
|
5722
6311
|
self.toggle();
|
5723
6312
|
return;
|
5724
6313
|
}
|
5725
6314
|
|
5726
|
-
if (self.breakpoint())
|
5727
|
-
|
6315
|
+
if (self.breakpoint()) {
|
6316
|
+
return;
|
6317
|
+
}
|
6318
|
+
|
6319
|
+
if (settings.is_hover && !Modernizr.touch) {
|
6320
|
+
return;
|
6321
|
+
}
|
5728
6322
|
|
5729
6323
|
e.stopImmediatePropagation();
|
5730
6324
|
|
@@ -5761,20 +6355,20 @@
|
|
5761
6355
|
$selectedLi.addClass('moved');
|
5762
6356
|
|
5763
6357
|
if (!self.rtl) {
|
5764
|
-
section.css({left: -(100 * topbar.data('index')) + '%'});
|
5765
|
-
section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
|
6358
|
+
section.css({left : -(100 * topbar.data('index')) + '%'});
|
6359
|
+
section.find('>.name').css({left : 100 * topbar.data('index') + '%'});
|
5766
6360
|
} else {
|
5767
|
-
section.css({right: -(100 * topbar.data('index')) + '%'});
|
5768
|
-
section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
|
6361
|
+
section.css({right : -(100 * topbar.data('index')) + '%'});
|
6362
|
+
section.find('>.name').css({right : 100 * topbar.data('index') + '%'});
|
5769
6363
|
}
|
5770
6364
|
|
5771
6365
|
topbar.css('height', $this.siblings('ul').outerHeight(true) + topbar.data('height'));
|
5772
6366
|
}
|
5773
6367
|
});
|
5774
6368
|
|
5775
|
-
S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function() {
|
6369
|
+
S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {
|
5776
6370
|
self.resize.call(self);
|
5777
|
-
}, 50)).trigger('resize
|
6371
|
+
}, 50)).trigger('resize.fndtn.topbar').load(function () {
|
5778
6372
|
// Ensure that the offset is calculated after all of the pages resources have loaded
|
5779
6373
|
S(this).trigger('resize.fndtn.topbar');
|
5780
6374
|
});
|
@@ -5803,11 +6397,11 @@
|
|
5803
6397
|
topbar.data('index', topbar.data('index') - 1);
|
5804
6398
|
|
5805
6399
|
if (!self.rtl) {
|
5806
|
-
section.css({left: -(100 * topbar.data('index')) + '%'});
|
5807
|
-
section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
|
6400
|
+
section.css({left : -(100 * topbar.data('index')) + '%'});
|
6401
|
+
section.find('>.name').css({left : 100 * topbar.data('index') + '%'});
|
5808
6402
|
} else {
|
5809
|
-
section.css({right: -(100 * topbar.data('index')) + '%'});
|
5810
|
-
section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
|
6403
|
+
section.css({right : -(100 * topbar.data('index')) + '%'});
|
6404
|
+
section.find('>.name').css({right : 100 * topbar.data('index') + '%'});
|
5811
6405
|
}
|
5812
6406
|
|
5813
6407
|
if (topbar.data('index') === 0) {
|
@@ -5823,10 +6417,10 @@
|
|
5823
6417
|
|
5824
6418
|
// Show dropdown menus when their items are focused
|
5825
6419
|
S(this.scope).find('.dropdown a')
|
5826
|
-
.focus(function() {
|
6420
|
+
.focus(function () {
|
5827
6421
|
$(this).parents('.has-dropdown').addClass('hover');
|
5828
6422
|
})
|
5829
|
-
.blur(function() {
|
6423
|
+
.blur(function () {
|
5830
6424
|
$(this).parents('.has-dropdown').removeClass('hover');
|
5831
6425
|
});
|
5832
6426
|
},
|
@@ -5848,18 +6442,18 @@
|
|
5848
6442
|
.find('li')
|
5849
6443
|
.removeClass('hover');
|
5850
6444
|
|
5851
|
-
if(doToggle) {
|
6445
|
+
if (doToggle) {
|
5852
6446
|
self.toggle(topbar);
|
5853
6447
|
}
|
5854
6448
|
}
|
5855
6449
|
|
5856
|
-
if(self.is_sticky(topbar, stickyContainer, settings)) {
|
5857
|
-
if(stickyContainer.hasClass('fixed')) {
|
6450
|
+
if (self.is_sticky(topbar, stickyContainer, settings)) {
|
6451
|
+
if (stickyContainer.hasClass('fixed')) {
|
5858
6452
|
// Remove the fixed to allow for correct calculation of the offset.
|
5859
6453
|
stickyContainer.removeClass('fixed');
|
5860
6454
|
|
5861
6455
|
stickyOffset = stickyContainer.offset().top;
|
5862
|
-
if(self.S(document.body).hasClass('f-topbar-fixed')) {
|
6456
|
+
if (self.S(document.body).hasClass('f-topbar-fixed')) {
|
5863
6457
|
stickyOffset -= topbar.data('height');
|
5864
6458
|
}
|
5865
6459
|
|
@@ -5904,11 +6498,10 @@
|
|
5904
6498
|
url = $link.attr('href'),
|
5905
6499
|
$titleLi;
|
5906
6500
|
|
5907
|
-
|
5908
6501
|
if (!$dropdown.find('.title.back').length) {
|
5909
6502
|
|
5910
6503
|
if (settings.mobile_show_parent_link == true && url) {
|
5911
|
-
$titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link
|
6504
|
+
$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>');
|
5912
6505
|
} else {
|
5913
6506
|
$titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5>');
|
5914
6507
|
}
|
@@ -5933,7 +6526,7 @@
|
|
5933
6526
|
},
|
5934
6527
|
|
5935
6528
|
assembled : function (topbar) {
|
5936
|
-
topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled: true}));
|
6529
|
+
topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled : true}));
|
5937
6530
|
},
|
5938
6531
|
|
5939
6532
|
height : function (ul) {
|
@@ -5950,18 +6543,18 @@
|
|
5950
6543
|
sticky : function () {
|
5951
6544
|
var self = this;
|
5952
6545
|
|
5953
|
-
this.S(window).on('scroll', function() {
|
6546
|
+
this.S(window).on('scroll', function () {
|
5954
6547
|
self.update_sticky_positioning();
|
5955
6548
|
});
|
5956
6549
|
},
|
5957
6550
|
|
5958
|
-
update_sticky_positioning: function() {
|
6551
|
+
update_sticky_positioning : function () {
|
5959
6552
|
var klass = '.' + this.settings.sticky_class,
|
5960
6553
|
$window = this.S(window),
|
5961
6554
|
self = this;
|
5962
6555
|
|
5963
6556
|
if (self.settings.sticky_topbar && self.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(), this.settings)) {
|
5964
|
-
var distance = this.settings.sticky_topbar.data('stickyoffset');
|
6557
|
+
var distance = this.settings.sticky_topbar.data('stickyoffset') + this.settings.start_offset;
|
5965
6558
|
if (!self.S(klass).hasClass('expanded')) {
|
5966
6559
|
if ($window.scrollTop() > (distance)) {
|
5967
6560
|
if (!self.S(klass).hasClass('fixed')) {
|