themepile-abstractio 1.0.2
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 +15 -0
- data/.gitignore +28 -0
- data/.rbenv-version +1 -0
- data/CONTRIBUTING.md +53 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +136 -0
- data/Rakefile +2 -0
- data/abstractio.gemspec +18 -0
- data/js/foundation/foundation.alerts.js +50 -0
- data/js/foundation/foundation.clearing.js +516 -0
- data/js/foundation/foundation.cookie.js +74 -0
- data/js/foundation/foundation.dropdown.js +159 -0
- data/js/foundation/foundation.forms.js +516 -0
- data/js/foundation/foundation.joyride.js +842 -0
- data/js/foundation/foundation.js +403 -0
- data/js/foundation/foundation.magellan.js +130 -0
- data/js/foundation/foundation.orbit.js +373 -0
- data/js/foundation/foundation.placeholder.js +159 -0
- data/js/foundation/foundation.reveal.js +276 -0
- data/js/foundation/foundation.section.js +409 -0
- data/js/foundation/foundation.tooltips.js +206 -0
- data/js/foundation/foundation.topbar.js +252 -0
- data/js/foundation/index.js +16 -0
- data/js/vendor/custom.modernizr.js +4 -0
- data/js/vendor/jquery.js +9597 -0
- data/js/vendor/zepto.js +1884 -0
- data/lib/abstractio.rb +17 -0
- data/lib/abstractio/engine.rb +20 -0
- data/lib/abstractio/generators/USAGE +15 -0
- data/lib/abstractio/generators/install_generator.rb +54 -0
- data/lib/abstractio/generators/templates/application.html.erb +46 -0
- data/lib/abstractio/generators/templates/application.html.haml +31 -0
- data/lib/abstractio/generators/templates/application.html.slim +28 -0
- data/lib/abstractio/version.rb +3 -0
- data/lib/themepile-abstractio.rb +17 -0
- data/scss/abstractio.scss +46 -0
- data/scss/abstractio/_variables.scss +1224 -0
- data/scss/abstractio/components/_alert-boxes.scss +107 -0
- data/scss/abstractio/components/_block-grid.scss +68 -0
- data/scss/abstractio/components/_breadcrumbs.scss +125 -0
- data/scss/abstractio/components/_button-groups.scss +89 -0
- data/scss/abstractio/components/_buttons.scss +227 -0
- data/scss/abstractio/components/_clearing.scss +224 -0
- data/scss/abstractio/components/_custom-forms.scss +263 -0
- data/scss/abstractio/components/_dropdown-buttons.scss +115 -0
- data/scss/abstractio/components/_dropdown.scss +150 -0
- data/scss/abstractio/components/_flex-video.scss +46 -0
- data/scss/abstractio/components/_forms.scss +362 -0
- data/scss/abstractio/components/_global.scss +280 -0
- data/scss/abstractio/components/_grid.scss +186 -0
- data/scss/abstractio/components/_inline-lists.scss +53 -0
- data/scss/abstractio/components/_joyride.scss +215 -0
- data/scss/abstractio/components/_keystrokes.scss +57 -0
- data/scss/abstractio/components/_labels.scss +85 -0
- data/scss/abstractio/components/_magellan.scss +23 -0
- data/scss/abstractio/components/_orbit.scss +213 -0
- data/scss/abstractio/components/_pagination.scss +100 -0
- data/scss/abstractio/components/_panels.scss +77 -0
- data/scss/abstractio/components/_pricing-tables.scss +131 -0
- data/scss/abstractio/components/_progress-bars.scss +71 -0
- data/scss/abstractio/components/_reveal.scss +132 -0
- data/scss/abstractio/components/_section.scss +318 -0
- data/scss/abstractio/components/_side-nav.scss +69 -0
- data/scss/abstractio/components/_split-buttons.scss +167 -0
- data/scss/abstractio/components/_sub-nav.scss +68 -0
- data/scss/abstractio/components/_switch.scss +251 -0
- data/scss/abstractio/components/_tables.scss +84 -0
- data/scss/abstractio/components/_thumbs.scss +48 -0
- data/scss/abstractio/components/_tooltips.scss +117 -0
- data/scss/abstractio/components/_top-bar.scss +495 -0
- data/scss/abstractio/components/_type.scss +426 -0
- data/scss/abstractio/components/_visibility.scss +322 -0
- data/scss/normalize.scss +402 -0
- data/templates/project/.gitignore +44 -0
- data/templates/project/MIT-LICENSE.txt +20 -0
- data/templates/project/config.rb +26 -0
- data/templates/project/humans.txt +8 -0
- data/templates/project/index.html +124 -0
- data/templates/project/manifest.rb +45 -0
- data/templates/project/robots.txt +4 -0
- data/templates/project/scss/app.scss +48 -0
- data/templates/upgrade/manifest.rb +34 -0
- metadata +153 -0
@@ -0,0 +1,206 @@
|
|
1
|
+
/*jslint unparam: true, browser: true, indent: 2 */
|
2
|
+
|
3
|
+
;(function ($, window, document, undefined) {
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
Foundation.libs.tooltips = {
|
7
|
+
name: 'tooltips',
|
8
|
+
|
9
|
+
version : '4.1.7',
|
10
|
+
|
11
|
+
settings : {
|
12
|
+
selector : '.has-tip',
|
13
|
+
additionalInheritableClasses : [],
|
14
|
+
tooltipClass : '.tooltip',
|
15
|
+
appendTo: 'body',
|
16
|
+
'disable-for-touch': false,
|
17
|
+
tipTemplate : function (selector, content) {
|
18
|
+
return '<span data-selector="' + selector + '" class="'
|
19
|
+
+ Foundation.libs.tooltips.settings.tooltipClass.substring(1)
|
20
|
+
+ '">' + content + '<span class="nub"></span></span>';
|
21
|
+
}
|
22
|
+
},
|
23
|
+
|
24
|
+
cache : {},
|
25
|
+
|
26
|
+
init : function (scope, method, options) {
|
27
|
+
Foundation.inherit(this, 'data_options');
|
28
|
+
var self = this;
|
29
|
+
|
30
|
+
if (typeof method === 'object') {
|
31
|
+
$.extend(true, this.settings, method);
|
32
|
+
} else if (typeof options !== 'undefined') {
|
33
|
+
$.extend(true, this.settings, options);
|
34
|
+
}
|
35
|
+
|
36
|
+
if (typeof method != 'string') {
|
37
|
+
if (Modernizr.touch) {
|
38
|
+
$(this.scope)
|
39
|
+
.on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip',
|
40
|
+
'[data-tooltip]', function (e) {
|
41
|
+
var settings = $.extend({}, self.settings, self.data_options($(this)));
|
42
|
+
if (!settings['disable-for-touch']) {
|
43
|
+
e.preventDefault();
|
44
|
+
$(settings.tooltipClass).hide();
|
45
|
+
self.showOrCreateTip($(this));
|
46
|
+
}
|
47
|
+
})
|
48
|
+
.on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip',
|
49
|
+
this.settings.tooltipClass, function (e) {
|
50
|
+
e.preventDefault();
|
51
|
+
$(this).fadeOut(150);
|
52
|
+
});
|
53
|
+
} else {
|
54
|
+
$(this.scope)
|
55
|
+
.on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip',
|
56
|
+
'[data-tooltip]', function (e) {
|
57
|
+
var $this = $(this);
|
58
|
+
|
59
|
+
if (e.type === 'mouseover' || e.type === 'mouseenter') {
|
60
|
+
self.showOrCreateTip($this);
|
61
|
+
} else if (e.type === 'mouseout' || e.type === 'mouseleave') {
|
62
|
+
self.hide($this);
|
63
|
+
}
|
64
|
+
});
|
65
|
+
}
|
66
|
+
|
67
|
+
// $(this.scope).data('fndtn-tooltips', true);
|
68
|
+
} else {
|
69
|
+
return this[method].call(this, options);
|
70
|
+
}
|
71
|
+
|
72
|
+
},
|
73
|
+
|
74
|
+
showOrCreateTip : function ($target) {
|
75
|
+
var $tip = this.getTip($target);
|
76
|
+
|
77
|
+
if ($tip && $tip.length > 0) {
|
78
|
+
return this.show($target);
|
79
|
+
}
|
80
|
+
|
81
|
+
return this.create($target);
|
82
|
+
},
|
83
|
+
|
84
|
+
getTip : function ($target) {
|
85
|
+
var selector = this.selector($target),
|
86
|
+
tip = null;
|
87
|
+
|
88
|
+
if (selector) {
|
89
|
+
tip = $('span[data-selector=' + selector + ']' + this.settings.tooltipClass);
|
90
|
+
}
|
91
|
+
|
92
|
+
return (typeof tip === 'object') ? tip : false;
|
93
|
+
},
|
94
|
+
|
95
|
+
selector : function ($target) {
|
96
|
+
var id = $target.attr('id'),
|
97
|
+
dataSelector = $target.attr('data-tooltip') || $target.attr('data-selector');
|
98
|
+
|
99
|
+
if ((id && id.length < 1 || !id) && typeof dataSelector != 'string') {
|
100
|
+
dataSelector = 'tooltip' + Math.random().toString(36).substring(7);
|
101
|
+
$target.attr('data-selector', dataSelector);
|
102
|
+
}
|
103
|
+
|
104
|
+
return (id && id.length > 0) ? id : dataSelector;
|
105
|
+
},
|
106
|
+
|
107
|
+
create : function ($target) {
|
108
|
+
var $tip = $(this.settings.tipTemplate(this.selector($target), $('<div></div>').html($target.attr('title')).html())),
|
109
|
+
classes = this.inheritable_classes($target);
|
110
|
+
|
111
|
+
$tip.addClass(classes).appendTo(this.settings.appendTo);
|
112
|
+
if (Modernizr.touch) {
|
113
|
+
$tip.append('<span class="tap-to-close">tap to close </span>');
|
114
|
+
}
|
115
|
+
$target.removeAttr('title').attr('title','');
|
116
|
+
this.show($target);
|
117
|
+
},
|
118
|
+
|
119
|
+
reposition : function (target, tip, classes) {
|
120
|
+
var width, nub, nubHeight, nubWidth, column, objPos;
|
121
|
+
|
122
|
+
tip.css('visibility', 'hidden').show();
|
123
|
+
|
124
|
+
width = target.data('width');
|
125
|
+
nub = tip.children('.nub');
|
126
|
+
nubHeight = this.outerHeight(nub);
|
127
|
+
nubWidth = this.outerHeight(nub);
|
128
|
+
|
129
|
+
objPos = function (obj, top, right, bottom, left, width) {
|
130
|
+
return obj.css({
|
131
|
+
'top' : (top) ? top : 'auto',
|
132
|
+
'bottom' : (bottom) ? bottom : 'auto',
|
133
|
+
'left' : (left) ? left : 'auto',
|
134
|
+
'right' : (right) ? right : 'auto',
|
135
|
+
'width' : (width) ? width : 'auto'
|
136
|
+
}).end();
|
137
|
+
};
|
138
|
+
|
139
|
+
objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', target.offset().left, width);
|
140
|
+
|
141
|
+
if ($(window).width() < 767) {
|
142
|
+
objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', 12.5, $(this.scope).width());
|
143
|
+
tip.addClass('tip-override');
|
144
|
+
objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
|
145
|
+
} else {
|
146
|
+
var left = target.offset().left;
|
147
|
+
if (Foundation.rtl) {
|
148
|
+
left = target.offset().left + target.offset().width - this.outerWidth(tip);
|
149
|
+
}
|
150
|
+
objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', left, width);
|
151
|
+
tip.removeClass('tip-override');
|
152
|
+
if (classes && classes.indexOf('tip-top') > -1) {
|
153
|
+
objPos(tip, (target.offset().top - this.outerHeight(tip)), 'auto', 'auto', left, width)
|
154
|
+
.removeClass('tip-override');
|
155
|
+
} else if (classes && classes.indexOf('tip-left') > -1) {
|
156
|
+
objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left - this.outerWidth(tip) - nubHeight), width)
|
157
|
+
.removeClass('tip-override');
|
158
|
+
} else if (classes && classes.indexOf('tip-right') > -1) {
|
159
|
+
objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left + this.outerWidth(target) + nubHeight), width)
|
160
|
+
.removeClass('tip-override');
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
tip.css('visibility', 'visible').hide();
|
165
|
+
},
|
166
|
+
|
167
|
+
inheritable_classes : function (target) {
|
168
|
+
var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'noradius'].concat(this.settings.additionalInheritableClasses),
|
169
|
+
classes = target.attr('class'),
|
170
|
+
filtered = classes ? $.map(classes.split(' '), function (el, i) {
|
171
|
+
if ($.inArray(el, inheritables) !== -1) {
|
172
|
+
return el;
|
173
|
+
}
|
174
|
+
}).join(' ') : '';
|
175
|
+
|
176
|
+
return $.trim(filtered);
|
177
|
+
},
|
178
|
+
|
179
|
+
show : function ($target) {
|
180
|
+
var $tip = this.getTip($target);
|
181
|
+
|
182
|
+
this.reposition($target, $tip, $target.attr('class'));
|
183
|
+
$tip.fadeIn(150);
|
184
|
+
},
|
185
|
+
|
186
|
+
hide : function ($target) {
|
187
|
+
var $tip = this.getTip($target);
|
188
|
+
|
189
|
+
$tip.fadeOut(150);
|
190
|
+
},
|
191
|
+
|
192
|
+
// deprecate reload
|
193
|
+
reload : function () {
|
194
|
+
var $self = $(this);
|
195
|
+
|
196
|
+
return ($self.data('fndtn-tooltips')) ? $self.foundationTooltips('destroy').foundationTooltips('init') : $self.foundationTooltips('init');
|
197
|
+
},
|
198
|
+
|
199
|
+
off : function () {
|
200
|
+
$(this.scope).off('.fndtn.tooltip');
|
201
|
+
$(this.settings.tooltipClass).each(function (i) {
|
202
|
+
$('[data-tooltip]').get(i).attr('title', $(this).text());
|
203
|
+
}).remove();
|
204
|
+
}
|
205
|
+
};
|
206
|
+
}(Foundation.zj, this, this.document));
|
@@ -0,0 +1,252 @@
|
|
1
|
+
/*jslint unparam: true, browser: true, indent: 2 */
|
2
|
+
|
3
|
+
;(function ($, window, document, undefined) {
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
Foundation.libs.topbar = {
|
7
|
+
name : 'topbar',
|
8
|
+
|
9
|
+
version : '4.1.7',
|
10
|
+
|
11
|
+
settings : {
|
12
|
+
index : 0,
|
13
|
+
stickyClass : 'sticky',
|
14
|
+
custom_back_text: true,
|
15
|
+
back_text: 'Back',
|
16
|
+
scrolltop : true, // jump to top when sticky nav menu toggle is clicked
|
17
|
+
init : false
|
18
|
+
},
|
19
|
+
|
20
|
+
init : function (section, method, options) {
|
21
|
+
Foundation.inherit(this, 'data_options');
|
22
|
+
var self = this;
|
23
|
+
|
24
|
+
if (typeof method === 'object') {
|
25
|
+
$.extend(true, this.settings, method);
|
26
|
+
} else if (typeof options !== 'undefined') {
|
27
|
+
$.extend(true, this.settings, options);
|
28
|
+
}
|
29
|
+
|
30
|
+
if (typeof method != 'string') {
|
31
|
+
|
32
|
+
$('.top-bar, [data-topbar]').each(function () {
|
33
|
+
$.extend(true, self.settings, self.data_options($(this)));
|
34
|
+
self.settings.$w = $(window);
|
35
|
+
self.settings.$topbar = $(this);
|
36
|
+
self.settings.$section = self.settings.$topbar.find('section');
|
37
|
+
self.settings.$titlebar = self.settings.$topbar.children('ul').first();
|
38
|
+
|
39
|
+
|
40
|
+
self.settings.$topbar.data('index', 0);
|
41
|
+
|
42
|
+
var breakpoint = $("<div class='top-bar-js-breakpoint'/>").insertAfter(self.settings.$topbar);
|
43
|
+
self.settings.breakPoint = breakpoint.width();
|
44
|
+
breakpoint.remove();
|
45
|
+
|
46
|
+
self.assemble();
|
47
|
+
|
48
|
+
if (self.settings.$topbar.parent().hasClass('fixed')) {
|
49
|
+
$('body').css('padding-top', self.outerHeight(self.settings.$topbar));
|
50
|
+
}
|
51
|
+
});
|
52
|
+
|
53
|
+
if (!self.settings.init) {
|
54
|
+
this.events();
|
55
|
+
}
|
56
|
+
|
57
|
+
return this.settings.init;
|
58
|
+
} else {
|
59
|
+
// fire method
|
60
|
+
return this[method].call(this, options);
|
61
|
+
}
|
62
|
+
},
|
63
|
+
|
64
|
+
events : function () {
|
65
|
+
var self = this;
|
66
|
+
var offst = this.outerHeight($('.top-bar, [data-topbar]'));
|
67
|
+
$(this.scope)
|
68
|
+
.on('click.fndtn.topbar', '.top-bar .toggle-topbar, [data-topbar] .toggle-topbar', function (e) {
|
69
|
+
var topbar = $(this).closest('.top-bar, [data-topbar]'),
|
70
|
+
section = topbar.find('section, .section'),
|
71
|
+
titlebar = topbar.children('ul').first();
|
72
|
+
|
73
|
+
if (!topbar.data('height')) self.largestUL();
|
74
|
+
|
75
|
+
e.preventDefault();
|
76
|
+
|
77
|
+
if (self.breakpoint()) {
|
78
|
+
topbar
|
79
|
+
.toggleClass('expanded')
|
80
|
+
.css('min-height', '');
|
81
|
+
}
|
82
|
+
|
83
|
+
if (!topbar.hasClass('expanded')) {
|
84
|
+
if (!self.rtl) {
|
85
|
+
section.css({left: '0%'});
|
86
|
+
section.find('>.name').css({left: '100%'});
|
87
|
+
} else {
|
88
|
+
section.css({right: '0%'});
|
89
|
+
section.find('>.name').css({right: '100%'});
|
90
|
+
}
|
91
|
+
section.find('li.moved').removeClass('moved');
|
92
|
+
topbar.data('index', 0);
|
93
|
+
|
94
|
+
if (topbar.hasClass('fixed')) {
|
95
|
+
topbar.parent().addClass('fixed');
|
96
|
+
topbar.removeClass('fixed');
|
97
|
+
$('body').css('padding-top',offst);
|
98
|
+
}
|
99
|
+
} else if (topbar.parent().hasClass('fixed')) {
|
100
|
+
topbar.parent().removeClass('fixed');
|
101
|
+
topbar.addClass('fixed');
|
102
|
+
$('body').css('padding-top','0');
|
103
|
+
if (self.settings.scrolltop) {
|
104
|
+
window.scrollTo(0,0);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
})
|
108
|
+
|
109
|
+
.on('click.fndtn.topbar', '.top-bar .has-dropdown>a, [data-topbar] .has-dropdown>a', function (e) {
|
110
|
+
var topbar = $(this).closest('.top-bar, [data-topbar]'),
|
111
|
+
section = topbar.find('section, .section'),
|
112
|
+
titlebar = topbar.children('ul').first(),
|
113
|
+
dropdownHeight = $(this).next('.dropdown').outerHeight();
|
114
|
+
|
115
|
+
if (Modernizr.touch || self.breakpoint()) {
|
116
|
+
e.preventDefault();
|
117
|
+
}
|
118
|
+
|
119
|
+
if (self.breakpoint()) {
|
120
|
+
var $this = $(this),
|
121
|
+
$selectedLi = $this.closest('li');
|
122
|
+
|
123
|
+
topbar.data('index', topbar.data('index') + 1);
|
124
|
+
$selectedLi.addClass('moved');
|
125
|
+
if (!self.rtl) {
|
126
|
+
section.css({left: -(100 * topbar.data('index')) + '%'});
|
127
|
+
section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
|
128
|
+
} else {
|
129
|
+
section.css({right: -(100 * topbar.data('index')) + '%'});
|
130
|
+
section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
|
131
|
+
}
|
132
|
+
|
133
|
+
$('.top-bar, [data-topbar]').css('min-height', dropdownHeight);
|
134
|
+
|
135
|
+
$this.siblings('ul')
|
136
|
+
.height(topbar.data('height') + self.outerHeight(titlebar, true));
|
137
|
+
topbar
|
138
|
+
.css('min-height', topbar.data('height') + self.outerHeight(titlebar, true) * 2)
|
139
|
+
}
|
140
|
+
});
|
141
|
+
|
142
|
+
$(window).on('resize.fndtn.topbar', function () {
|
143
|
+
if (!self.breakpoint()) {
|
144
|
+
$('.top-bar, [data-topbar]')
|
145
|
+
.css('min-height', '')
|
146
|
+
.removeClass('expanded');
|
147
|
+
}
|
148
|
+
}.bind(this));
|
149
|
+
|
150
|
+
// Go up a level on Click
|
151
|
+
$(this.scope).on('click.fndtn', '.top-bar .has-dropdown .back, [data-topbar] .has-dropdown .back', function (e) {
|
152
|
+
e.preventDefault();
|
153
|
+
|
154
|
+
var $this = $(this),
|
155
|
+
topbar = $this.closest('.top-bar, [data-topbar]'),
|
156
|
+
section = topbar.find('section, .section'),
|
157
|
+
$movedLi = $this.closest('li.moved'),
|
158
|
+
$previousLevelUl = $movedLi.parent();
|
159
|
+
|
160
|
+
topbar.data('index', topbar.data('index') - 1);
|
161
|
+
if (!self.rtl) {
|
162
|
+
section.css({left: -(100 * topbar.data('index')) + '%'});
|
163
|
+
section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
|
164
|
+
} else {
|
165
|
+
section.css({right: -(100 * topbar.data('index')) + '%'});
|
166
|
+
section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
|
167
|
+
}
|
168
|
+
|
169
|
+
if (topbar.data('index') === 0) {
|
170
|
+
topbar.css('min-height', 0);
|
171
|
+
}
|
172
|
+
|
173
|
+
setTimeout(function () {
|
174
|
+
$movedLi.removeClass('moved');
|
175
|
+
}, 300);
|
176
|
+
});
|
177
|
+
},
|
178
|
+
|
179
|
+
breakpoint : function () {
|
180
|
+
return $(window).width() <= this.settings.breakPoint || $('html').hasClass('lt-ie9');
|
181
|
+
},
|
182
|
+
|
183
|
+
assemble : function () {
|
184
|
+
var self = this;
|
185
|
+
// Pull element out of the DOM for manipulation
|
186
|
+
this.settings.$section.detach();
|
187
|
+
|
188
|
+
this.settings.$section.find('.has-dropdown>a').each(function () {
|
189
|
+
var $link = $(this),
|
190
|
+
$dropdown = $link.siblings('.dropdown'),
|
191
|
+
$titleLi = $('<li class="title back js-generated"><h5><a href="#"></a></h5></li>');
|
192
|
+
|
193
|
+
// Copy link to subnav
|
194
|
+
if (self.settings.custom_back_text == true) {
|
195
|
+
$titleLi.find('h5>a').html('« ' + self.settings.back_text);
|
196
|
+
} else {
|
197
|
+
$titleLi.find('h5>a').html('« ' + $link.html());
|
198
|
+
}
|
199
|
+
$dropdown.prepend($titleLi);
|
200
|
+
});
|
201
|
+
|
202
|
+
// Put element back in the DOM
|
203
|
+
this.settings.$section.appendTo(this.settings.$topbar);
|
204
|
+
|
205
|
+
// check for sticky
|
206
|
+
this.sticky();
|
207
|
+
},
|
208
|
+
|
209
|
+
largestUL : function () {
|
210
|
+
var uls = this.settings.$topbar.find('section ul ul'),
|
211
|
+
largest = uls.first(),
|
212
|
+
total = 0,
|
213
|
+
self = this;
|
214
|
+
|
215
|
+
uls.each(function () {
|
216
|
+
if ($(this).children('li').length > largest.children('li').length) {
|
217
|
+
largest = $(this);
|
218
|
+
}
|
219
|
+
});
|
220
|
+
|
221
|
+
largest.children('li').each(function () { total += self.outerHeight($(this), true); });
|
222
|
+
|
223
|
+
this.settings.$topbar.data('height', total);
|
224
|
+
},
|
225
|
+
|
226
|
+
sticky : function () {
|
227
|
+
var klass = '.' + this.settings.stickyClass;
|
228
|
+
if ($(klass).length > 0) {
|
229
|
+
var distance = $(klass).length ? $(klass).offset().top: 0,
|
230
|
+
$window = $(window);
|
231
|
+
var offst = this.outerHeight($('.top-bar'));
|
232
|
+
|
233
|
+
$window.scroll(function() {
|
234
|
+
if ($window.scrollTop() >= (distance)) {
|
235
|
+
$(klass).addClass("fixed");
|
236
|
+
$('body').css('padding-top',offst);
|
237
|
+
}
|
238
|
+
|
239
|
+
else if ($window.scrollTop() < distance) {
|
240
|
+
$(klass).removeClass("fixed");
|
241
|
+
$('body').css('padding-top','0');
|
242
|
+
}
|
243
|
+
});
|
244
|
+
}
|
245
|
+
},
|
246
|
+
|
247
|
+
off : function () {
|
248
|
+
$(this.scope).off('.fndtn.topbar');
|
249
|
+
$(window).off('.fndtn.topbar');
|
250
|
+
}
|
251
|
+
};
|
252
|
+
}(Foundation.zj, this, this.document));
|