foundation-rails 5.0.3.1 → 5.1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +6 -2
- data/bower.json +7 -0
- data/lib/foundation/rails/version.rb +1 -1
- data/update-gem.sh +13 -0
- data/vendor/assets/javascripts/foundation.js +2 -1
- data/vendor/assets/javascripts/foundation/foundation.abide.js +67 -33
- data/vendor/assets/javascripts/foundation/foundation.accordion.js +19 -11
- data/vendor/assets/javascripts/foundation/foundation.alert.js +8 -5
- data/vendor/assets/javascripts/foundation/foundation.clearing.js +74 -52
- data/vendor/assets/javascripts/foundation/foundation.dropdown.js +52 -46
- data/vendor/assets/javascripts/foundation/foundation.equalizer.js +63 -0
- data/vendor/assets/javascripts/foundation/foundation.interchange.js +47 -26
- data/vendor/assets/javascripts/foundation/foundation.joyride.js +42 -36
- data/vendor/assets/javascripts/foundation/foundation.js +286 -118
- data/vendor/assets/javascripts/foundation/foundation.magellan.js +139 -98
- data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +8 -6
- data/vendor/assets/javascripts/foundation/foundation.orbit.js +29 -21
- data/vendor/assets/javascripts/foundation/foundation.reveal.js +58 -50
- data/vendor/assets/javascripts/foundation/foundation.tab.js +22 -10
- data/vendor/assets/javascripts/foundation/foundation.tooltip.js +38 -26
- data/vendor/assets/javascripts/foundation/foundation.topbar.js +79 -73
- data/vendor/assets/stylesheets/foundation/_functions.scss +37 -18
- data/vendor/assets/stylesheets/foundation/_settings.scss +115 -110
- data/vendor/assets/stylesheets/foundation/components/_block-grid.scss +14 -9
- data/vendor/assets/stylesheets/foundation/components/_breadcrumbs.scss +2 -2
- data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +1 -1
- data/vendor/assets/stylesheets/foundation/components/_clearing.scss +13 -1
- data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +1 -1
- data/vendor/assets/stylesheets/foundation/components/_flex-video.scss +1 -1
- data/vendor/assets/stylesheets/foundation/components/_forms.scss +23 -29
- data/vendor/assets/stylesheets/foundation/components/_global.scss +23 -54
- data/vendor/assets/stylesheets/foundation/components/_grid.scss +38 -31
- data/vendor/assets/stylesheets/foundation/components/_inline-lists.scss +2 -2
- data/vendor/assets/stylesheets/foundation/components/_joyride.scss +2 -2
- data/vendor/assets/stylesheets/foundation/components/_magellan.scss +2 -2
- data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +96 -96
- data/vendor/assets/stylesheets/foundation/components/_orbit.scss +3 -0
- data/vendor/assets/stylesheets/foundation/components/_progress-bars.scss +2 -2
- data/vendor/assets/stylesheets/foundation/components/_reveal.scss +8 -3
- data/vendor/assets/stylesheets/foundation/components/_side-nav.scss +10 -5
- data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +6 -3
- data/vendor/assets/stylesheets/foundation/components/_tabs.scss +2 -0
- data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +11 -1
- data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +20 -7
- data/vendor/assets/stylesheets/foundation/components/_type.scss +82 -4
- data/vendor/assets/stylesheets/foundation/components/_visibility.scss +2 -2
- metadata +5 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Foundation.libs.tab = {
|
|
6
6
|
name : 'tab',
|
|
7
7
|
|
|
8
|
-
version : '5.0
|
|
8
|
+
version : '5.1.0',
|
|
9
9
|
|
|
10
10
|
settings : {
|
|
11
11
|
active_class: 'active',
|
|
@@ -17,28 +17,40 @@
|
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
events : function () {
|
|
20
|
-
|
|
20
|
+
var self = this,
|
|
21
|
+
S = this.S;
|
|
22
|
+
|
|
23
|
+
S(this.scope).off('.tab').on('click.fndtn.tab', '[' + this.attr_name() + '] > dd > a', function (e) {
|
|
21
24
|
e.preventDefault();
|
|
25
|
+
e.stopPropagation();
|
|
22
26
|
|
|
23
|
-
var tab =
|
|
24
|
-
tabs = tab.closest('[
|
|
25
|
-
target =
|
|
27
|
+
var tab = S(this).parent(),
|
|
28
|
+
tabs = tab.closest('[' + self.attr_name() + ']'),
|
|
29
|
+
target = S('#' + this.href.split('#')[1]),
|
|
26
30
|
siblings = tab.siblings(),
|
|
27
|
-
settings = tabs.data('
|
|
31
|
+
settings = tabs.data(self.attr_name(true) + '-init');
|
|
28
32
|
|
|
29
33
|
// allow usage of data-tab-content attribute instead of href
|
|
30
|
-
if (
|
|
31
|
-
target =
|
|
34
|
+
if (S(this).data(self.data_attr('tab-content'))) {
|
|
35
|
+
target = S('#' + S(this).data(self.data_attr('tab-content')).split('#')[1]);
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
tab.addClass(settings.active_class).
|
|
38
|
+
tab.addClass(settings.active_class).triggerHandler('opened');
|
|
35
39
|
siblings.removeClass(settings.active_class);
|
|
36
40
|
target.siblings().removeClass(settings.active_class).end().addClass(settings.active_class);
|
|
37
41
|
settings.callback(tab);
|
|
38
|
-
tabs.
|
|
42
|
+
tabs.triggerHandler('toggled', [tab]);
|
|
39
43
|
});
|
|
40
44
|
},
|
|
41
45
|
|
|
46
|
+
data_attr: function (str) {
|
|
47
|
+
if (this.namespace.length > 0) {
|
|
48
|
+
return this.namespace + '-' + str;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return str;
|
|
52
|
+
},
|
|
53
|
+
|
|
42
54
|
off : function () {},
|
|
43
55
|
|
|
44
56
|
reflow : function () {}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Foundation.libs.tooltip = {
|
|
5
5
|
name : 'tooltip',
|
|
6
6
|
|
|
7
|
-
version : '5.0
|
|
7
|
+
version : '5.1.0',
|
|
8
8
|
|
|
9
9
|
settings : {
|
|
10
10
|
additional_inheritable_classes : [],
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
append_to: 'body',
|
|
13
13
|
touch_close_text: 'Tap To Close',
|
|
14
14
|
disable_for_touch: false,
|
|
15
|
+
hover_delay: 200,
|
|
15
16
|
tip_template : function (selector, content) {
|
|
16
17
|
return '<span data-selector="' + selector + '" class="'
|
|
17
18
|
+ Foundation.libs.tooltip.settings.tooltip_class.substring(1)
|
|
@@ -22,39 +23,44 @@
|
|
|
22
23
|
cache : {},
|
|
23
24
|
|
|
24
25
|
init : function (scope, method, options) {
|
|
26
|
+
Foundation.inherit(this, 'random_str');
|
|
25
27
|
this.bindings(method, options);
|
|
26
28
|
},
|
|
27
29
|
|
|
28
30
|
events : function () {
|
|
29
|
-
var self = this
|
|
31
|
+
var self = this,
|
|
32
|
+
S = self.S;
|
|
30
33
|
|
|
31
34
|
if (Modernizr.touch) {
|
|
32
|
-
|
|
35
|
+
S(document)
|
|
33
36
|
.off('.tooltip')
|
|
34
37
|
.on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip',
|
|
35
|
-
'[
|
|
36
|
-
var settings = $.extend({}, self.settings, self.data_options(
|
|
38
|
+
'[' + this.attr_name() + ']:not(a)', function (e) {
|
|
39
|
+
var settings = $.extend({}, self.settings, self.data_options(S(this)));
|
|
37
40
|
if (!settings.disable_for_touch) {
|
|
38
41
|
e.preventDefault();
|
|
39
|
-
|
|
40
|
-
self.showOrCreateTip(
|
|
42
|
+
S(settings.tooltip_class).hide();
|
|
43
|
+
self.showOrCreateTip(S(this));
|
|
41
44
|
}
|
|
42
45
|
})
|
|
43
46
|
.on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip',
|
|
44
47
|
this.settings.tooltip_class, function (e) {
|
|
45
48
|
e.preventDefault();
|
|
46
|
-
|
|
49
|
+
S(this).fadeOut(150);
|
|
47
50
|
});
|
|
48
51
|
} else {
|
|
49
|
-
|
|
52
|
+
S(document)
|
|
50
53
|
.off('.tooltip')
|
|
51
54
|
.on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip',
|
|
52
|
-
'[
|
|
53
|
-
var $this =
|
|
55
|
+
'[' + this.attr_name() + ']', function (e) {
|
|
56
|
+
var $this = S(this);
|
|
54
57
|
|
|
55
58
|
if (/enter|over/i.test(e.type)) {
|
|
56
|
-
|
|
59
|
+
this.timer = setTimeout(function () {
|
|
60
|
+
var tip = self.showOrCreateTip($this);
|
|
61
|
+
}.bind(this), self.settings.hover_delay);
|
|
57
62
|
} else if (e.type === 'mouseout' || e.type === 'mouseleave') {
|
|
63
|
+
clearTimeout(this.timer);
|
|
58
64
|
self.hide($this);
|
|
59
65
|
}
|
|
60
66
|
});
|
|
@@ -76,7 +82,7 @@
|
|
|
76
82
|
tip = null;
|
|
77
83
|
|
|
78
84
|
if (selector) {
|
|
79
|
-
tip =
|
|
85
|
+
tip = this.S('span[data-selector="' + selector + '"]' + this.settings.tooltip_class);
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
return (typeof tip === 'object') ? tip : false;
|
|
@@ -84,10 +90,10 @@
|
|
|
84
90
|
|
|
85
91
|
selector : function ($target) {
|
|
86
92
|
var id = $target.attr('id'),
|
|
87
|
-
dataSelector = $target.attr(
|
|
93
|
+
dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');
|
|
88
94
|
|
|
89
95
|
if ((id && id.length < 1 || !id) && typeof dataSelector != 'string') {
|
|
90
|
-
dataSelector = 'tooltip' +
|
|
96
|
+
dataSelector = 'tooltip' + this.random_str(6);
|
|
91
97
|
$target.attr('data-selector', dataSelector);
|
|
92
98
|
}
|
|
93
99
|
|
|
@@ -115,9 +121,13 @@
|
|
|
115
121
|
nub = tip.children('.nub');
|
|
116
122
|
nubHeight = nub.outerHeight();
|
|
117
123
|
nubWidth = nub.outerHeight();
|
|
118
|
-
|
|
119
|
-
tip.css({'width' : (width) ? width : 'auto'});
|
|
120
124
|
|
|
125
|
+
if(this.small()) {
|
|
126
|
+
tip.css({'width' : '100%' });
|
|
127
|
+
} else {
|
|
128
|
+
tip.css({'width' : (width) ? width : 'auto'});
|
|
129
|
+
}
|
|
130
|
+
|
|
121
131
|
objPos = function (obj, top, right, bottom, left, width) {
|
|
122
132
|
return obj.css({
|
|
123
133
|
'top' : (top) ? top : 'auto',
|
|
@@ -130,16 +140,18 @@
|
|
|
130
140
|
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', target.offset().left);
|
|
131
141
|
|
|
132
142
|
if (this.small()) {
|
|
133
|
-
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', 12.5,
|
|
143
|
+
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', 12.5, this.S(this.scope).width());
|
|
134
144
|
tip.addClass('tip-override');
|
|
135
|
-
objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
|
|
145
|
+
objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left + 10);
|
|
136
146
|
} else {
|
|
137
147
|
var left = target.offset().left;
|
|
138
148
|
if (Foundation.rtl) {
|
|
139
|
-
left = target.offset().left + target.
|
|
149
|
+
left = target.offset().left + target.outerWidth() - tip.outerWidth();
|
|
140
150
|
}
|
|
151
|
+
|
|
141
152
|
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', left);
|
|
142
153
|
tip.removeClass('tip-override');
|
|
154
|
+
nub.removeAttr( 'style' );
|
|
143
155
|
if (classes && classes.indexOf('tip-top') > -1) {
|
|
144
156
|
objPos(tip, (target.offset().top - tip.outerHeight() - 10), 'auto', 'auto', left)
|
|
145
157
|
.removeClass('tip-override');
|
|
@@ -160,7 +172,7 @@
|
|
|
160
172
|
},
|
|
161
173
|
|
|
162
174
|
inheritable_classes : function (target) {
|
|
163
|
-
var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', '
|
|
175
|
+
var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'radius', 'round'].concat(this.settings.additional_inheritable_classes),
|
|
164
176
|
classes = target.attr('class'),
|
|
165
177
|
filtered = classes ? $.map(classes.split(' '), function (el, i) {
|
|
166
178
|
if ($.inArray(el, inheritables) !== -1) {
|
|
@@ -175,13 +187,13 @@
|
|
|
175
187
|
var $tip = this.getTip($target);
|
|
176
188
|
|
|
177
189
|
this.reposition($target, $tip, $target.attr('class'));
|
|
178
|
-
$tip.fadeIn(150);
|
|
190
|
+
return $tip.fadeIn(150);
|
|
179
191
|
},
|
|
180
192
|
|
|
181
193
|
hide : function ($target) {
|
|
182
194
|
var $tip = this.getTip($target);
|
|
183
195
|
|
|
184
|
-
$tip.fadeOut(150);
|
|
196
|
+
return $tip.fadeOut(150);
|
|
185
197
|
},
|
|
186
198
|
|
|
187
199
|
// deprecate reload
|
|
@@ -192,9 +204,9 @@
|
|
|
192
204
|
},
|
|
193
205
|
|
|
194
206
|
off : function () {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
$('[
|
|
207
|
+
this.S(this.scope).off('.fndtn.tooltip');
|
|
208
|
+
this.S(this.settings.tooltip_class).each(function (i) {
|
|
209
|
+
$('[' + this.attr_name() + ']').get(i).attr('title', $(this).text());
|
|
198
210
|
}).remove();
|
|
199
211
|
},
|
|
200
212
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Foundation.libs.topbar = {
|
|
5
5
|
name : 'topbar',
|
|
6
6
|
|
|
7
|
-
version: '5.0
|
|
7
|
+
version: '5.1.0',
|
|
8
8
|
|
|
9
9
|
settings : {
|
|
10
10
|
index : 0,
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
init : function (section, method, options) {
|
|
20
|
-
Foundation.inherit(this, '
|
|
20
|
+
Foundation.inherit(this, 'add_custom_rule register_media throttle');
|
|
21
21
|
var self = this;
|
|
22
22
|
|
|
23
23
|
self.register_media('topbar', 'foundation-mq-topbar');
|
|
24
24
|
|
|
25
25
|
this.bindings(method, options);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
var topbar =
|
|
29
|
-
settings = topbar.data('
|
|
30
|
-
section =
|
|
27
|
+
self.S('[' + this.attr_name() + ']', this.scope).each(function () {
|
|
28
|
+
var topbar = self.S(this),
|
|
29
|
+
settings = topbar.data(self.attr_name(true) + '-init'),
|
|
30
|
+
section = self.S('section', this),
|
|
31
31
|
titlebar = $('> ul', this).first();
|
|
32
32
|
|
|
33
33
|
topbar.data('index', 0);
|
|
@@ -45,16 +45,16 @@
|
|
|
45
45
|
if (!settings.assembled) self.assemble(topbar);
|
|
46
46
|
|
|
47
47
|
if (settings.is_hover) {
|
|
48
|
-
|
|
48
|
+
self.S('.has-dropdown', topbar).addClass('not-click');
|
|
49
49
|
} else {
|
|
50
|
-
|
|
50
|
+
self.S('.has-dropdown', topbar).removeClass('not-click');
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// Pad body when sticky (scrolled) or fixed.
|
|
54
|
-
self.
|
|
54
|
+
self.add_custom_rule('.f-topbar-fixed { padding-top: ' + topbar.data('height') + 'px }');
|
|
55
55
|
|
|
56
56
|
if (topbarContainer.hasClass('fixed')) {
|
|
57
|
-
|
|
57
|
+
self.S('body').addClass('f-topbar-fixed');
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
var self = this;
|
|
65
65
|
|
|
66
66
|
if (toggleEl) {
|
|
67
|
-
var topbar =
|
|
67
|
+
var topbar = self.S(toggleEl).closest('[' + this.attr_name() + ']');
|
|
68
68
|
} else {
|
|
69
|
-
var topbar =
|
|
69
|
+
var topbar = self.S('[' + this.attr_name() + ']');
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
var settings = topbar.data('
|
|
72
|
+
var settings = topbar.data(this.attr_name(true) + '-init');
|
|
73
73
|
|
|
74
|
-
var section =
|
|
74
|
+
var section = self.S('section, .section', topbar);
|
|
75
75
|
|
|
76
76
|
if (self.breakpoint()) {
|
|
77
77
|
if (!self.rtl) {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
$('>.name', section).css({right: '100%'});
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
self.S('li.moved', section).removeClass('moved');
|
|
86
86
|
topbar.data('index', 0);
|
|
87
87
|
|
|
88
88
|
topbar
|
|
@@ -95,13 +95,13 @@
|
|
|
95
95
|
if (topbar.hasClass('fixed')) {
|
|
96
96
|
topbar.parent().addClass('fixed');
|
|
97
97
|
topbar.removeClass('fixed');
|
|
98
|
-
|
|
98
|
+
self.S('body').addClass('f-topbar-fixed');
|
|
99
99
|
}
|
|
100
100
|
} else if (topbar.parent().hasClass('fixed')) {
|
|
101
101
|
if (settings.scrolltop) {
|
|
102
102
|
topbar.parent().removeClass('fixed');
|
|
103
103
|
topbar.addClass('fixed');
|
|
104
|
-
|
|
104
|
+
self.S('body').removeClass('f-topbar-fixed');
|
|
105
105
|
|
|
106
106
|
window.scrollTo(0,0);
|
|
107
107
|
} else {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
} else {
|
|
122
122
|
topbar.addClass('fixed');
|
|
123
123
|
topbar.parent().addClass('expanded');
|
|
124
|
-
|
|
124
|
+
self.S('body').addClass('f-topbar-fixed');
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
}
|
|
@@ -130,18 +130,20 @@
|
|
|
130
130
|
timer : null,
|
|
131
131
|
|
|
132
132
|
events : function (bar) {
|
|
133
|
-
var self = this
|
|
134
|
-
|
|
133
|
+
var self = this,
|
|
134
|
+
S = this.S;
|
|
135
|
+
|
|
136
|
+
S(this.scope)
|
|
135
137
|
.off('.topbar')
|
|
136
|
-
.on('click.fndtn.topbar', '[
|
|
138
|
+
.on('click.fndtn.topbar', '[' + this.attr_name() + '] .toggle-topbar', function (e) {
|
|
137
139
|
e.preventDefault();
|
|
138
140
|
self.toggle(this);
|
|
139
141
|
})
|
|
140
|
-
.on('click.fndtn.topbar', '[
|
|
141
|
-
var li =
|
|
142
|
-
target =
|
|
143
|
-
topbar = li.closest('[
|
|
144
|
-
settings = topbar.data('
|
|
142
|
+
.on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) {
|
|
143
|
+
var li = S(this),
|
|
144
|
+
target = S(e.target),
|
|
145
|
+
topbar = li.closest('[' + self.attr_name() + ']'),
|
|
146
|
+
settings = topbar.data(self.attr_name(true) + '-init');
|
|
145
147
|
|
|
146
148
|
if(target.data('revealId')) {
|
|
147
149
|
self.toggle();
|
|
@@ -169,13 +171,13 @@
|
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
})
|
|
172
|
-
.on('click.fndtn.topbar', '[
|
|
174
|
+
.on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown>a', function (e) {
|
|
173
175
|
if (self.breakpoint()) {
|
|
174
176
|
|
|
175
177
|
e.preventDefault();
|
|
176
178
|
|
|
177
|
-
var $this =
|
|
178
|
-
topbar = $this.closest('[
|
|
179
|
+
var $this = S(this),
|
|
180
|
+
topbar = $this.closest('[' + self.attr_name() + ']'),
|
|
179
181
|
section = topbar.find('section, .section'),
|
|
180
182
|
dropdownHeight = $this.next('.dropdown').outerHeight(),
|
|
181
183
|
$selectedLi = $this.closest('li');
|
|
@@ -195,28 +197,28 @@
|
|
|
195
197
|
}
|
|
196
198
|
});
|
|
197
199
|
|
|
198
|
-
|
|
200
|
+
S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {
|
|
199
201
|
self.resize.call(self);
|
|
200
202
|
}, 50)).trigger('resize');
|
|
201
203
|
|
|
202
|
-
|
|
203
|
-
var parent =
|
|
204
|
+
S('body').off('.topbar').on('click.fndtn.topbar touchstart.fndtn.topbar', function (e) {
|
|
205
|
+
var parent = S(e.target).closest('li').closest('li.hover');
|
|
204
206
|
|
|
205
207
|
if (parent.length > 0) {
|
|
206
208
|
return;
|
|
207
209
|
}
|
|
208
210
|
|
|
209
|
-
|
|
211
|
+
S('[' + self.attr_name() + '] li').removeClass('hover');
|
|
210
212
|
});
|
|
211
213
|
|
|
212
214
|
// Go up a level on Click
|
|
213
|
-
|
|
215
|
+
S(this.scope).on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown .back', function (e) {
|
|
214
216
|
e.preventDefault();
|
|
215
217
|
|
|
216
|
-
var $this =
|
|
217
|
-
topbar = $this.closest('[
|
|
218
|
+
var $this = S(this),
|
|
219
|
+
topbar = $this.closest('[' + self.attr_name() + ']'),
|
|
218
220
|
section = topbar.find('section, .section'),
|
|
219
|
-
settings = topbar.data('
|
|
221
|
+
settings = topbar.data(self.attr_name(true) + '-init'),
|
|
220
222
|
$movedLi = $this.closest('li.moved'),
|
|
221
223
|
$previousLevelUl = $movedLi.parent();
|
|
222
224
|
|
|
@@ -244,9 +246,9 @@
|
|
|
244
246
|
|
|
245
247
|
resize : function () {
|
|
246
248
|
var self = this;
|
|
247
|
-
|
|
248
|
-
var topbar =
|
|
249
|
-
settings = topbar.data('
|
|
249
|
+
self.S('[' + this.attr_name() + ']').each(function () {
|
|
250
|
+
var topbar = self.S(this),
|
|
251
|
+
settings = topbar.data(self.attr_name(true) + '-init');
|
|
250
252
|
|
|
251
253
|
var stickyContainer = topbar.parent('.' + self.settings.sticky_class);
|
|
252
254
|
var stickyOffset;
|
|
@@ -270,7 +272,7 @@
|
|
|
270
272
|
stickyContainer.removeClass('fixed');
|
|
271
273
|
|
|
272
274
|
stickyOffset = stickyContainer.offset().top;
|
|
273
|
-
if(
|
|
275
|
+
if(self.S(document.body).hasClass('f-topbar-fixed')) {
|
|
274
276
|
stickyOffset -= topbar.data('height');
|
|
275
277
|
}
|
|
276
278
|
|
|
@@ -291,31 +293,33 @@
|
|
|
291
293
|
|
|
292
294
|
assemble : function (topbar) {
|
|
293
295
|
var self = this,
|
|
294
|
-
settings = topbar.data('
|
|
295
|
-
section =
|
|
296
|
+
settings = topbar.data(this.attr_name(true) + '-init'),
|
|
297
|
+
section = self.S('section', topbar),
|
|
296
298
|
titlebar = $('> ul', topbar).first();
|
|
297
299
|
|
|
298
300
|
// Pull element out of the DOM for manipulation
|
|
299
301
|
section.detach();
|
|
300
302
|
|
|
301
|
-
|
|
302
|
-
var $link =
|
|
303
|
+
self.S('.has-dropdown>a', section).each(function () {
|
|
304
|
+
var $link = self.S(this),
|
|
303
305
|
$dropdown = $link.siblings('.dropdown'),
|
|
304
306
|
url = $link.attr('href');
|
|
305
307
|
|
|
306
|
-
if (
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
308
|
+
if (!$dropdown.find('.title.back').length) {
|
|
309
|
+
if (settings.mobile_show_parent_link && url && url.length > 1) {
|
|
310
|
+
var $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li><a class="parent-link js-generated" href="' + url + '">' + $link.text() +'</a></li>');
|
|
311
|
+
} else {
|
|
312
|
+
var $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li>');
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Copy link to subnav
|
|
316
|
+
if (settings.custom_back_text == true) {
|
|
317
|
+
$('h5>a', $titleLi).html(settings.back_text);
|
|
318
|
+
} else {
|
|
319
|
+
$('h5>a', $titleLi).html('« ' + $link.html());
|
|
320
|
+
}
|
|
321
|
+
$dropdown.prepend($titleLi);
|
|
317
322
|
}
|
|
318
|
-
$dropdown.prepend($titleLi);
|
|
319
323
|
});
|
|
320
324
|
|
|
321
325
|
// Put element back in the DOM
|
|
@@ -328,43 +332,45 @@
|
|
|
328
332
|
},
|
|
329
333
|
|
|
330
334
|
assembled : function (topbar) {
|
|
331
|
-
topbar.data(
|
|
335
|
+
topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled: true}));
|
|
332
336
|
},
|
|
333
337
|
|
|
334
338
|
height : function (ul) {
|
|
335
339
|
var total = 0,
|
|
336
340
|
self = this;
|
|
337
341
|
|
|
338
|
-
$('> li', ul).each(function () { total +=
|
|
342
|
+
$('> li', ul).each(function () { total += self.S(this).outerHeight(true); });
|
|
339
343
|
|
|
340
344
|
return total;
|
|
341
345
|
},
|
|
342
346
|
|
|
343
347
|
sticky : function () {
|
|
344
|
-
var $window =
|
|
348
|
+
var $window = this.S(window),
|
|
345
349
|
self = this;
|
|
346
350
|
|
|
347
|
-
|
|
351
|
+
this.S(window).on('scroll', function() {
|
|
348
352
|
self.update_sticky_positioning();
|
|
349
353
|
});
|
|
350
354
|
},
|
|
351
355
|
|
|
352
356
|
update_sticky_positioning: function() {
|
|
353
|
-
var klass = '.' + this.settings.sticky_class
|
|
354
|
-
|
|
357
|
+
var klass = '.' + this.settings.sticky_class,
|
|
358
|
+
$window = this.S(window),
|
|
359
|
+
self = this;
|
|
360
|
+
|
|
355
361
|
|
|
356
|
-
if (
|
|
362
|
+
if (self.S(klass).length > 0) {
|
|
357
363
|
var distance = this.settings.sticky_topbar.data('stickyoffset');
|
|
358
|
-
if (
|
|
364
|
+
if (!self.S(klass).hasClass('expanded')) {
|
|
359
365
|
if ($window.scrollTop() > (distance)) {
|
|
360
|
-
if (
|
|
361
|
-
|
|
362
|
-
|
|
366
|
+
if (!self.S(klass).hasClass('fixed')) {
|
|
367
|
+
self.S(klass).addClass('fixed');
|
|
368
|
+
self.S('body').addClass('f-topbar-fixed');
|
|
363
369
|
}
|
|
364
370
|
} else if ($window.scrollTop() <= distance) {
|
|
365
|
-
if (
|
|
366
|
-
|
|
367
|
-
|
|
371
|
+
if (self.S(klass).hasClass('fixed')) {
|
|
372
|
+
self.S(klass).removeClass('fixed');
|
|
373
|
+
self.S('body').removeClass('f-topbar-fixed');
|
|
368
374
|
}
|
|
369
375
|
}
|
|
370
376
|
}
|
|
@@ -372,8 +378,8 @@
|
|
|
372
378
|
},
|
|
373
379
|
|
|
374
380
|
off : function () {
|
|
375
|
-
|
|
376
|
-
|
|
381
|
+
this.S(this.scope).off('.fndtn.topbar');
|
|
382
|
+
this.S(window).off('.fndtn.topbar');
|
|
377
383
|
},
|
|
378
384
|
|
|
379
385
|
reflow : function () {}
|