zurb-foundation 4.0.5 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/{CHANGELOG.md → docs/CHANGELOG.md} +63 -3
- data/docs/Gemfile +1 -0
- data/docs/Gemfile.lock +2 -0
- data/docs/_sidebar-components.html.erb +1 -0
- data/docs/_sidebar.html.erb +1 -0
- data/docs/changelog.html.erb +1 -205
- data/docs/components/alert-boxes.html.erb +1 -1
- data/docs/components/block-grid.html.erb +1 -1
- data/docs/components/breadcrumbs.html.erb +3 -3
- data/docs/components/button-groups.html.erb +1 -1
- data/docs/components/buttons.html.erb +1 -1
- data/docs/components/dropdown-buttons.html.erb +1 -1
- data/docs/components/dropdown.html.erb +1 -1
- data/docs/components/flex-video.html.erb +1 -1
- data/docs/components/forms.html.erb +1 -1
- data/docs/components/global.html.erb +92 -0
- data/docs/components/inline-lists.html.erb +1 -1
- data/docs/components/keystrokes.html.erb +2 -2
- data/docs/components/labels.html.erb +2 -2
- data/docs/components/orbit.html.erb +10 -2
- data/docs/components/pagination.html.erb +1 -1
- data/docs/components/panels.html.erb +1 -1
- data/docs/components/pricing-tables.html.erb +1 -1
- data/docs/components/progress-bars.html.erb +2 -2
- data/docs/components/section.html.erb +18 -0
- data/docs/components/side-nav.html.erb +1 -1
- data/docs/components/split-buttons.html.erb +1 -1
- data/docs/components/sub-nav.html.erb +1 -1
- data/docs/components/switch.html.erb +1 -1
- data/docs/components/thumbnails.html.erb +1 -1
- data/docs/components/top-bar.html.erb +5 -5
- data/docs/css/docs.scss +0 -1
- data/docs/layout.html.erb +2 -3
- data/docs/sass.html.erb +21 -14
- data/js/foundation/foundation.clearing.js +2 -0
- data/js/foundation/foundation.dropdown.js +10 -10
- data/js/foundation/foundation.joyride.js +9 -12
- data/js/foundation/foundation.js +28 -2
- data/js/foundation/foundation.orbit.js +17 -9
- data/js/foundation/foundation.reveal.js +6 -2
- data/js/foundation/foundation.section.js +30 -18
- data/js/foundation/foundation.topbar.js +18 -8
- data/lib/foundation/generators/USAGE +6 -5
- data/lib/foundation/generators/install_generator.rb +9 -9
- data/lib/foundation/generators/templates/application.html.erb +40 -37
- data/lib/foundation/generators/templates/application.html.haml +5 -2
- data/lib/foundation/generators/templates/application.html.slim +6 -5
- data/lib/foundation/version.rb +1 -1
- data/scss/foundation/_foundation-global.scss +19 -4
- data/scss/foundation/components/_alert-boxes.scss +1 -1
- data/scss/foundation/components/_breadcrumbs.scss +4 -4
- data/scss/foundation/components/_button-groups.scss +8 -8
- data/scss/foundation/components/_buttons.scss +4 -3
- data/scss/foundation/components/_custom-forms.scss +175 -171
- data/scss/foundation/components/_dropdown-buttons.scss +1 -1
- data/scss/foundation/components/_dropdown.scss +1 -1
- data/scss/foundation/components/_flex-video.scss +1 -1
- data/scss/foundation/components/_forms.scss +91 -89
- data/scss/foundation/components/_global.scss +7 -2
- data/scss/foundation/components/_grid.scss +3 -3
- data/scss/foundation/components/_inline-lists.scss +1 -1
- data/scss/foundation/components/_keystrokes.scss +2 -2
- data/scss/foundation/components/_labels.scss +3 -3
- data/scss/foundation/components/_magellan.scss +1 -1
- data/scss/foundation/components/_pagination.scss +1 -1
- data/scss/foundation/components/_panels.scss +1 -1
- data/scss/foundation/components/_pricing-tables.scss +1 -1
- data/scss/foundation/components/_progress-bars.scss +2 -2
- data/scss/foundation/components/_reveal.scss +1 -1
- data/scss/foundation/components/_section.scss +1 -1
- data/scss/foundation/components/_side-nav.scss +1 -1
- data/scss/foundation/components/_split-buttons.scss +1 -1
- data/scss/foundation/components/_sub-nav.scss +1 -1
- data/scss/foundation/components/_switch.scss +3 -3
- data/scss/foundation/components/_thumbs.scss +1 -1
- data/scss/foundation/components/_top-bar.scss +4 -1
- data/scss/foundation/components/_visibility.scss +273 -274
- data/templates/project/scss/_settings.scss +4 -4
- data/templates/project/scss/app.scss +8 -8
- data/templates/upgrade/manifest.rb +7 -12
- metadata +6 -6
- data/index.html +0 -113
@@ -101,6 +101,7 @@
|
|
101
101
|
|
102
102
|
$(this.scope)
|
103
103
|
.on('touchstart.fndtn.clearing', '.visible-img', function(e) {
|
104
|
+
if (!e.touches) { e = e.originalEvent; }
|
104
105
|
var data = {
|
105
106
|
start_page_x: e.touches[0].pageX,
|
106
107
|
start_page_y: e.touches[0].pageY,
|
@@ -113,6 +114,7 @@
|
|
113
114
|
e.stopPropagation();
|
114
115
|
})
|
115
116
|
.on('touchmove.fndtn.clearing', '.visible-img', function(e) {
|
117
|
+
if (!e.touches) { e = e.originalEvent; }
|
116
118
|
// Ignore pinch/zoom events
|
117
119
|
if(e.touches.length > 1 || e.scale && e.scale !== 1) return;
|
118
120
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Foundation.libs.dropdown = {
|
7
7
|
name : 'dropdown',
|
8
8
|
|
9
|
-
version : '4.0.
|
9
|
+
version : '4.0.6',
|
10
10
|
|
11
11
|
settings : {
|
12
12
|
activeClass: 'open'
|
@@ -49,10 +49,6 @@
|
|
49
49
|
}
|
50
50
|
});
|
51
51
|
|
52
|
-
$('[data-dropdown-content]').on('click.fndtn.dropdown', function (e) {
|
53
|
-
e.stopPropagation();
|
54
|
-
});
|
55
|
-
|
56
52
|
$(window).on('resize.fndtn.dropdown', self.throttle(function () {
|
57
53
|
self.resize.call(self);
|
58
54
|
}, 50)).trigger('resize');
|
@@ -63,7 +59,7 @@
|
|
63
59
|
toggle : function (target, resize) {
|
64
60
|
var dropdown = $('#' + target.data('dropdown'));
|
65
61
|
|
66
|
-
$('[data-dropdown-content]').not(dropdown).css('left', '-99999px');
|
62
|
+
$('[data-dropdown-content]').not(dropdown).css('left', '-99999px').removeClass(this.settings.activeClass);
|
67
63
|
|
68
64
|
if (dropdown.hasClass(this.settings.activeClass)) {
|
69
65
|
dropdown
|
@@ -86,7 +82,11 @@
|
|
86
82
|
},
|
87
83
|
|
88
84
|
css : function (dropdown, target) {
|
89
|
-
|
85
|
+
if (dropdown.parent()[0] === $('body')[0]) {
|
86
|
+
var position = target.offset();
|
87
|
+
} else {
|
88
|
+
var position = target.position();
|
89
|
+
}
|
90
90
|
|
91
91
|
if (this.small()) {
|
92
92
|
dropdown.css({
|
@@ -94,13 +94,13 @@
|
|
94
94
|
width: '95%',
|
95
95
|
left: '2.5%',
|
96
96
|
'max-width': 'none',
|
97
|
-
top:
|
97
|
+
top: position.top + this.outerHeight(target)
|
98
98
|
});
|
99
99
|
} else {
|
100
100
|
dropdown.attr('style', '').css({
|
101
101
|
position : 'absolute',
|
102
|
-
top:
|
103
|
-
left:
|
102
|
+
top: position.top + this.outerHeight(target),
|
103
|
+
left: position.left
|
104
104
|
});
|
105
105
|
}
|
106
106
|
|
@@ -102,8 +102,7 @@
|
|
102
102
|
int_settings_count = integer_settings.length;
|
103
103
|
|
104
104
|
if (!this.settings.init) this.init();
|
105
|
-
|
106
|
-
|
105
|
+
|
107
106
|
// non configureable settings
|
108
107
|
this.settings.$content_el = $this;
|
109
108
|
this.settings.body_offset = $(this.settings.tipContainer).position();
|
@@ -111,11 +110,6 @@
|
|
111
110
|
this.settings.paused = false;
|
112
111
|
this.settings.attempts = 0;
|
113
112
|
|
114
|
-
// Make sure that settings parsed from data_options are integers where necessary
|
115
|
-
for (var i = int_settings_count - 1; i >= 0; i--) {
|
116
|
-
this.settings[integer_settings[i]] = parseInt(this.settings[integer_settings[i]], 10);
|
117
|
-
}
|
118
|
-
|
119
113
|
this.settings.tipLocationPatterns = {
|
120
114
|
top: ['bottom'],
|
121
115
|
bottom: [], // bottom should not need to be repositioned
|
@@ -130,9 +124,14 @@
|
|
130
124
|
|
131
125
|
// generate the tips and insert into dom.
|
132
126
|
if (!this.settings.cookieMonster || this.settings.cookieMonster && $.cookie(this.settings.cookieName) === null) {
|
133
|
-
|
134
127
|
this.settings.$tip_content.each(function (index) {
|
135
|
-
|
128
|
+
var $this = $(this);
|
129
|
+
$.extend(true, self.settings, self.data_options($this));
|
130
|
+
// Make sure that settings parsed from data_options are integers where necessary
|
131
|
+
for (var i = int_settings_count - 1; i >= 0; i--) {
|
132
|
+
self.settings[integer_settings[i]] = parseInt(self.settings[integer_settings[i]], 10);
|
133
|
+
}
|
134
|
+
self.create({$li : $this, index : index});
|
136
135
|
});
|
137
136
|
|
138
137
|
// show first tip
|
@@ -191,7 +190,6 @@
|
|
191
190
|
},
|
192
191
|
|
193
192
|
create : function (opts) {
|
194
|
-
// backwards compatability with data-text attribute
|
195
193
|
var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'),
|
196
194
|
tipClass = opts.$li.attr('class'),
|
197
195
|
$tip_content = $(this.tip_template({
|
@@ -222,8 +220,7 @@
|
|
222
220
|
|
223
221
|
if (this.settings.$li.length && this.settings.$target.length > 0) {
|
224
222
|
|
225
|
-
this.settings.tipSettings = $.extend(
|
226
|
-
this.settings, this.data_options(this.settings.$li));
|
223
|
+
this.settings.tipSettings = $.extend(this.settings, this.data_options(this.settings.$li));
|
227
224
|
|
228
225
|
this.settings.timer = parseInt(this.settings.timer, 10);
|
229
226
|
|
data/js/foundation/foundation.js
CHANGED
@@ -8,6 +8,25 @@
|
|
8
8
|
|
9
9
|
/*jslint unparam: true, browser: true, indent: 2 */
|
10
10
|
|
11
|
+
// Accommodate running jQuery or Zepto in noConflict() mode by
|
12
|
+
// using an anonymous function to redefine the $ shorthand name.
|
13
|
+
// See http://docs.jquery.com/Using_jQuery_with_Other_Libraries
|
14
|
+
// and http://zeptojs.com/
|
15
|
+
var libFuncName = null;
|
16
|
+
if (typeof jQuery === "undefined" &&
|
17
|
+
typeof Zepto === "undefined" &&
|
18
|
+
typeof $ === "function") {
|
19
|
+
libFuncName = $;
|
20
|
+
} else if (typeof jQuery === "function") {
|
21
|
+
libFuncName = jQuery;
|
22
|
+
} else if (typeof Zepto === "function") {
|
23
|
+
libFuncName = Zepto;
|
24
|
+
} else {
|
25
|
+
throw new TypeError();
|
26
|
+
}
|
27
|
+
|
28
|
+
(function ($) {
|
29
|
+
|
11
30
|
(function () {
|
12
31
|
// add dusty browser stuff
|
13
32
|
if (!Array.prototype.filter) {
|
@@ -209,13 +228,17 @@
|
|
209
228
|
};
|
210
229
|
},
|
211
230
|
|
212
|
-
// parses
|
231
|
+
// parses data-options attribute on page nodes and turns
|
213
232
|
// them into an object
|
214
233
|
data_options : function (el) {
|
215
234
|
var opts = {}, ii, p,
|
216
235
|
opts_arr = (el.attr('data-options') || ':').split(';'),
|
217
236
|
opts_len = opts_arr.length;
|
218
237
|
|
238
|
+
function isNumber (o) {
|
239
|
+
return ! isNaN (o-0) && o !== null && o !== "" && o !== false;
|
240
|
+
}
|
241
|
+
|
219
242
|
function trim(str) {
|
220
243
|
if (typeof str === 'string') return $.trim(str);
|
221
244
|
return str;
|
@@ -227,6 +250,7 @@
|
|
227
250
|
|
228
251
|
if (/true/i.test(p[1])) p[1] = true;
|
229
252
|
if (/false/i.test(p[1])) p[1] = false;
|
253
|
+
if (isNumber(p[1])) p[1] = parseInt(p[1], 10);
|
230
254
|
|
231
255
|
if (p.length === 2) {
|
232
256
|
opts[trim(p[0])] = trim(p[1]);
|
@@ -328,4 +352,6 @@
|
|
328
352
|
});
|
329
353
|
};
|
330
354
|
|
331
|
-
}(this, this.document));
|
355
|
+
}(this, this.document));
|
356
|
+
|
357
|
+
})(libFuncName);
|
@@ -4,6 +4,8 @@
|
|
4
4
|
Foundation.libs = Foundation.libs || {};
|
5
5
|
|
6
6
|
Foundation.libs.orbit = {
|
7
|
+
name: 'orbit',
|
8
|
+
|
7
9
|
version: '4.0.0',
|
8
10
|
|
9
11
|
settings: {
|
@@ -29,12 +31,16 @@
|
|
29
31
|
|
30
32
|
init: function (scope, method, options) {
|
31
33
|
var self = this;
|
34
|
+
Foundation.inherit(self, 'data_options');
|
32
35
|
|
33
36
|
if (typeof method === 'object') {
|
34
37
|
$.extend(true, self.settings, method);
|
35
38
|
}
|
36
39
|
|
37
|
-
$('[data-orbit]', scope).each(
|
40
|
+
$('[data-orbit]', scope).each(function(idx, el) {
|
41
|
+
var scoped_self = $.extend(true, {}, self);
|
42
|
+
scoped_self._init(idx, el);
|
43
|
+
});
|
38
44
|
},
|
39
45
|
|
40
46
|
_container_html: function() {
|
@@ -88,6 +94,8 @@
|
|
88
94
|
$slides_container = $(slider),
|
89
95
|
$container = $slides_container.wrap(self._container_html()).parent(),
|
90
96
|
$slides = $slides_container.children();
|
97
|
+
|
98
|
+
$.extend(true, self.settings, self.data_options($slides_container));
|
91
99
|
|
92
100
|
$container.append(self._prev_html());
|
93
101
|
$container.append(self._next_html());
|
@@ -135,7 +143,7 @@
|
|
135
143
|
|
136
144
|
if ($slide.length === 1) {
|
137
145
|
self._reset_timer($slides_container, true);
|
138
|
-
self.
|
146
|
+
self._goto($slides_container, $slide.index(), function() {});
|
139
147
|
}
|
140
148
|
});
|
141
149
|
|
@@ -143,7 +151,7 @@
|
|
143
151
|
.on('click.fndtn.orbit', '[data-orbit-slide-number]', function(e) {
|
144
152
|
e.preventDefault();
|
145
153
|
self._reset_timer($slides_container, true);
|
146
|
-
self.
|
154
|
+
self._goto($slides_container, $(e.currentTarget).data('orbit-slide-number'),function() {});
|
147
155
|
});
|
148
156
|
|
149
157
|
$container
|
@@ -157,12 +165,12 @@
|
|
157
165
|
.on('orbit:next-slide.fndtn.orbit click.fndtn.orbit', '.' + self.settings.next_class, function(e) {
|
158
166
|
e.preventDefault();
|
159
167
|
self._reset_timer($slides_container, true);
|
160
|
-
self.
|
168
|
+
self._goto($slides_container, 'next', function() {});
|
161
169
|
})
|
162
170
|
.on('orbit:prev-slide.fndtn.orbit click.fndtn.orbit', '.' + self.settings.prev_class, function(e) {
|
163
171
|
e.preventDefault();
|
164
172
|
self._reset_timer($slides_container, true);
|
165
|
-
self.
|
173
|
+
self._goto($slides_container, 'prev', function() {});
|
166
174
|
})
|
167
175
|
.on('orbit:toggle-play-pause.fndtn.orbit click.fndtn.orbit touchstart.fndtn.orbit', '.' + self.settings.timer_container_class, function(e) {
|
168
176
|
e.preventDefault();
|
@@ -209,7 +217,7 @@
|
|
209
217
|
self._stop_timer($slides_container);
|
210
218
|
var direction = (data.delta_x < 0) ? 'next' : 'prev';
|
211
219
|
data.active = true;
|
212
|
-
self.
|
220
|
+
self._goto($slides_container, direction, function() {});
|
213
221
|
}
|
214
222
|
})
|
215
223
|
.on('touchend.fndtn.orbit', function(e) {
|
@@ -234,7 +242,7 @@
|
|
234
242
|
|
235
243
|
var callback = function() {
|
236
244
|
self._reset_timer($slides_container, false);
|
237
|
-
self.
|
245
|
+
self._goto($slides_container, 'next', function() {
|
238
246
|
self._start_timer($slides_container);
|
239
247
|
});
|
240
248
|
};
|
@@ -244,7 +252,7 @@
|
|
244
252
|
progress_pct = ($progress.width() / $timer.width()),
|
245
253
|
delay = self.settings.timer_speed - (progress_pct * self.settings.timer_speed);
|
246
254
|
|
247
|
-
$progress.animate({'width': '100%'}, delay, 'linear', callback)
|
255
|
+
$progress.animate({'width': '100%'}, delay, 'linear', callback);
|
248
256
|
$slides_container.trigger('orbit:timer-started');
|
249
257
|
},
|
250
258
|
|
@@ -292,7 +300,7 @@
|
|
292
300
|
}
|
293
301
|
},
|
294
302
|
|
295
|
-
|
303
|
+
_goto: function($slides_container, index_or_direction, callback) {
|
296
304
|
var self = this,
|
297
305
|
$container = $slides_container.parent(),
|
298
306
|
$slides = $slides_container.children(),
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Foundation.libs.reveal = {
|
7
7
|
name: 'reveal',
|
8
8
|
|
9
|
-
version : '4.0.
|
9
|
+
version : '4.0.6',
|
10
10
|
|
11
11
|
locked : false,
|
12
12
|
|
@@ -44,7 +44,7 @@
|
|
44
44
|
}
|
45
45
|
|
46
46
|
if (typeof method != 'string') {
|
47
|
-
|
47
|
+
this.events();
|
48
48
|
|
49
49
|
return this.settings.init;
|
50
50
|
} else {
|
@@ -56,6 +56,7 @@
|
|
56
56
|
var self = this;
|
57
57
|
|
58
58
|
$(this.scope)
|
59
|
+
.off('.fndtn.reveal')
|
59
60
|
.on('click.fndtn.reveal', '[data-reveal-id]', function (e) {
|
60
61
|
e.preventDefault();
|
61
62
|
if (!self.locked) {
|
@@ -64,6 +65,7 @@
|
|
64
65
|
}
|
65
66
|
})
|
66
67
|
.on('click.fndtn.reveal touchend.click.fndtn.reveal', this.close_targets(), function (e) {
|
68
|
+
e.preventDefault();
|
67
69
|
if (!self.locked) {
|
68
70
|
self.locked = true;
|
69
71
|
self.close.call(self, $(this).closest('.reveal-modal'));
|
@@ -75,6 +77,8 @@
|
|
75
77
|
.on('close.fndtn.reveal', '.reveal-modal', this.settings.close)
|
76
78
|
.on('closed.fndtn.reveal', '.reveal-modal', this.settings.closed)
|
77
79
|
.on('closed.fndtn.reveal', '.reveal-modal', this.close_video);
|
80
|
+
|
81
|
+
return true;
|
78
82
|
},
|
79
83
|
|
80
84
|
open : function (target) {
|
@@ -41,13 +41,15 @@
|
|
41
41
|
|
42
42
|
$(window).on('resize.fndtn.section', self.throttle(function () {
|
43
43
|
self.resize.call(this);
|
44
|
-
}, 30))
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
}, 30))
|
45
|
+
.on('hashchange', function () {
|
46
|
+
if (!self.settings.toggled){
|
47
|
+
self.set_active_from_hash();
|
48
|
+
$(this).trigger('resize');
|
49
|
+
}
|
50
|
+
}).trigger('resize');
|
49
51
|
|
50
|
-
$(
|
52
|
+
$(document).on('click.fndtn.section', function (e) {
|
51
53
|
if ($(e.target).closest('.title').length < 1) {
|
52
54
|
$('[data-section].vertical-nav, [data-section].horizontal-nav')
|
53
55
|
.find('section, .section')
|
@@ -65,6 +67,7 @@
|
|
65
67
|
content = section.find('.content'),
|
66
68
|
parent = section.closest('[data-section]'),
|
67
69
|
self = Foundation.libs.section;
|
70
|
+
self.settings.toggled = true;
|
68
71
|
|
69
72
|
if (!self.settings.deep_linking && content.length > 0) {
|
70
73
|
e.preventDefault();
|
@@ -80,28 +83,33 @@
|
|
80
83
|
.attr('style', '');
|
81
84
|
}
|
82
85
|
} else {
|
86
|
+
var prev_active_section = null,
|
87
|
+
title_height = self.outerHeight(section.find('.title'));
|
88
|
+
|
83
89
|
if (self.small(parent) || self.settings.one_up) {
|
84
|
-
$this
|
85
|
-
.closest('[data-section]')
|
86
|
-
.find('section, .section')
|
87
|
-
.removeClass('active')
|
88
|
-
.attr('style', '');
|
90
|
+
prev_active_section = $this.closest('[data-section]').find('section.active, .section.active');
|
89
91
|
|
90
|
-
|
92
|
+
if (self.small(parent)) {
|
93
|
+
prev_active_section.attr('style', '');
|
94
|
+
} else {
|
95
|
+
prev_active_section.attr('style', 'visibility: hidden; padding-top: '+title_height+'px;');
|
96
|
+
}
|
91
97
|
}
|
92
98
|
|
93
|
-
$('[data-section].vertical-nav, [data-section].horizontal-nav')
|
94
|
-
.find('section, .section')
|
95
|
-
.removeClass('active')
|
96
|
-
.attr('style', '');
|
97
|
-
|
98
99
|
if (self.small(parent)) {
|
99
100
|
section.attr('style', '');
|
101
|
+
} else {
|
102
|
+
section.css('padding-top', title_height);
|
100
103
|
}
|
101
104
|
|
102
105
|
section.addClass('active');
|
106
|
+
if (prev_active_section !== null) {
|
107
|
+
prev_active_section.removeClass('active').attr('style', '');
|
108
|
+
}
|
103
109
|
}
|
104
|
-
|
110
|
+
setTimeout(function () {
|
111
|
+
self.settings.toggled = false;
|
112
|
+
}, 300);
|
105
113
|
self.settings.callback();
|
106
114
|
},
|
107
115
|
|
@@ -168,6 +176,10 @@
|
|
168
176
|
$.extend(true, self.settings, self.data_options(section));
|
169
177
|
|
170
178
|
if (hash.length > 0 && self.settings.deep_linking) {
|
179
|
+
section
|
180
|
+
.find('section, .section')
|
181
|
+
.attr('style', '')
|
182
|
+
.removeClass('active');
|
171
183
|
section
|
172
184
|
.find('.content[data-slug="' + hash + '"]')
|
173
185
|
.closest('section, .section')
|
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
if (typeof method != 'string') {
|
28
28
|
|
29
|
-
$('
|
29
|
+
$('.top-bar').each(function () {
|
30
30
|
self.settings.$w = $(window);
|
31
31
|
self.settings.$topbar = $(this);
|
32
32
|
self.settings.$section = self.settings.$topbar.find('section');
|
@@ -59,14 +59,14 @@
|
|
59
59
|
|
60
60
|
events : function () {
|
61
61
|
var self = this;
|
62
|
-
|
62
|
+
var offst = this.outerHeight($('.top-bar'));
|
63
63
|
$(this.scope)
|
64
64
|
.on('click.fndtn.topbar', '.top-bar .toggle-topbar', function (e) {
|
65
65
|
var topbar = $(this).closest('.top-bar'),
|
66
66
|
section = topbar.find('section, .section'),
|
67
67
|
titlebar = topbar.children('ul').first();
|
68
68
|
|
69
|
-
if (!
|
69
|
+
if (!topbar.data('height')) self.largestUL();
|
70
70
|
|
71
71
|
e.preventDefault();
|
72
72
|
|
@@ -82,6 +82,16 @@
|
|
82
82
|
section.find('li.moved').removeClass('moved');
|
83
83
|
topbar.data('index', 0);
|
84
84
|
}
|
85
|
+
|
86
|
+
if (topbar.parent().hasClass('fixed')) {
|
87
|
+
topbar.parent().removeClass('fixed');
|
88
|
+
$('body').css('padding-top','0');
|
89
|
+
window.scrollTo(0);
|
90
|
+
} else {
|
91
|
+
topbar.parent().addClass('fixed');
|
92
|
+
$('body').css('padding-top',offst);
|
93
|
+
}
|
94
|
+
|
85
95
|
})
|
86
96
|
|
87
97
|
.on('click.fndtn.topbar', '.top-bar .has-dropdown>a', function (e) {
|
@@ -191,18 +201,18 @@
|
|
191
201
|
if ($(klass).length > 0) {
|
192
202
|
var distance = $(klass).length ? $(klass).offset().top: 0,
|
193
203
|
$window = $(window);
|
194
|
-
var offst = this.outerHeight($('
|
204
|
+
var offst = this.outerHeight($('.top-bar'));
|
195
205
|
|
196
206
|
$window.scroll(function() {
|
197
207
|
if ($window.scrollTop() >= (distance)) {
|
198
|
-
|
199
|
-
|
208
|
+
$(klass).addClass("fixed");
|
209
|
+
$('body').css('padding-top',offst);
|
200
210
|
}
|
201
211
|
|
202
|
-
|
212
|
+
else if ($window.scrollTop() < distance) {
|
203
213
|
$(klass).removeClass("fixed");
|
204
214
|
$('body').css('padding-top','0');
|
205
|
-
|
215
|
+
}
|
206
216
|
});
|
207
217
|
}
|
208
218
|
},
|