foundation-rails 6.2.4.0 → 6.3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/Rakefile +2 -0
- data/bower.json +2 -2
- data/lib/foundation/rails/version.rb +1 -1
- data/lib/generators/foundation/templates/_settings.scss +117 -70
- data/lib/generators/foundation/templates/foundation_and_overrides.scss +2 -1
- data/vendor/assets/_vendor/normalize-scss/sass/_normalize.scss +3 -0
- data/vendor/assets/_vendor/normalize-scss/sass/normalize/_import-now.scss +11 -0
- data/vendor/assets/_vendor/normalize-scss/sass/normalize/_normalize-mixin.scss +676 -0
- data/vendor/assets/_vendor/normalize-scss/sass/normalize/_variables.scss +36 -0
- data/vendor/assets/_vendor/normalize-scss/sass/normalize/_vertical-rhythm.scss +61 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/functions/_purge.scss +38 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/functions/_remove.scss +31 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/functions/_replace.scss +46 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/functions/_to-list.scss +27 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/helpers/_missing-dependencies.scss +25 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/helpers/_true.scss +13 -0
- data/vendor/assets/js/foundation.abide.js.es6 +28 -0
- data/vendor/assets/js/foundation.accordion.js.es6 +1 -1
- data/vendor/assets/js/foundation.accordionMenu.js.es6 +9 -1
- data/vendor/assets/js/foundation.core.js.es6 +4 -4
- data/vendor/assets/js/foundation.drilldown.js.es6 +128 -14
- data/vendor/assets/js/foundation.dropdown.js.es6 +48 -42
- data/vendor/assets/js/foundation.dropdownMenu.js.es6 +20 -18
- data/vendor/assets/js/foundation.equalizer.js.es6 +12 -6
- data/vendor/assets/js/foundation.interchange.js.es6 +3 -2
- data/vendor/assets/js/foundation.js.es6 +2 -1
- data/vendor/assets/js/foundation.magellan.js.es6 +28 -9
- data/vendor/assets/js/foundation.offcanvas.js.es6 +90 -123
- data/vendor/assets/js/foundation.orbit.js.es6 +61 -10
- data/vendor/assets/js/foundation.responsiveMenu.js.es6 +2 -0
- data/vendor/assets/js/foundation.responsiveToggle.js.es6 +52 -12
- data/vendor/assets/js/foundation.reveal.js.es6 +48 -48
- data/vendor/assets/js/foundation.slider.js.es6 +124 -42
- data/vendor/assets/js/foundation.sticky.js.es6 +11 -9
- data/vendor/assets/js/foundation.tabs.js.es6 +164 -35
- data/vendor/assets/js/foundation.toggler.js.es6 +3 -0
- data/vendor/assets/js/foundation.tooltip.js.es6 +20 -10
- data/vendor/assets/js/foundation.util.box.js.es6 +2 -2
- data/vendor/assets/js/foundation.util.keyboard.js.es6 +37 -0
- data/vendor/assets/js/foundation.util.mediaQuery.js.es6 +16 -0
- data/vendor/assets/js/foundation.util.motion.js.es6 +7 -1
- data/vendor/assets/js/foundation.util.nest.js.es6 +10 -5
- data/vendor/assets/js/foundation.util.timerAndImageLoader.js.es6 +6 -4
- data/vendor/assets/js/foundation.util.triggers.js.es6 +54 -36
- data/vendor/assets/js/foundation.zf.responsiveAccordionTabs.js.es6 +240 -0
- data/vendor/assets/scss/_global.scss +25 -450
- data/vendor/assets/scss/components/_accordion-menu.scss +8 -4
- data/vendor/assets/scss/components/_accordion.scss +43 -22
- data/vendor/assets/scss/components/_badge.scss +17 -9
- data/vendor/assets/scss/components/_breadcrumbs.scss +7 -5
- data/vendor/assets/scss/components/_button-group.scss +54 -6
- data/vendor/assets/scss/components/_button.scss +27 -16
- data/vendor/assets/scss/components/_callout.scss +3 -2
- data/vendor/assets/scss/components/_card.scss +121 -0
- data/vendor/assets/scss/components/_close-button.scss +54 -13
- data/vendor/assets/scss/components/_drilldown.scss +19 -5
- data/vendor/assets/scss/components/_dropdown-menu.scss +23 -18
- data/vendor/assets/scss/components/_dropdown.scss +14 -7
- data/vendor/assets/scss/components/_flex-video.scss +1 -63
- data/vendor/assets/scss/components/_float.scss +1 -1
- data/vendor/assets/scss/components/_label.scss +16 -8
- data/vendor/assets/scss/components/_media-object.scss +2 -3
- data/vendor/assets/scss/components/_menu.scss +68 -33
- data/vendor/assets/scss/components/_off-canvas.scss +231 -80
- data/vendor/assets/scss/components/_orbit.scss +8 -6
- data/vendor/assets/scss/components/_pagination.scss +42 -22
- data/vendor/assets/scss/components/_progress-bar.scss +1 -1
- data/vendor/assets/scss/components/_responsive-embed.scss +66 -0
- data/vendor/assets/scss/components/_reveal.scss +17 -11
- data/vendor/assets/scss/components/_slider.scss +6 -1
- data/vendor/assets/scss/components/_sticky.scss +3 -3
- data/vendor/assets/scss/components/_switch.scss +47 -36
- data/vendor/assets/scss/components/_table.scss +83 -23
- data/vendor/assets/scss/components/_tabs.scss +54 -23
- data/vendor/assets/scss/components/_thumbnail.scss +17 -4
- data/vendor/assets/scss/components/_title-bar.scss +5 -6
- data/vendor/assets/scss/components/_tooltip.scss +15 -12
- data/vendor/assets/scss/components/_top-bar.scss +11 -8
- data/vendor/assets/scss/forms/_checkbox.scss +2 -1
- data/vendor/assets/scss/forms/_error.scss +10 -6
- data/vendor/assets/scss/forms/_fieldset.scss +7 -7
- data/vendor/assets/scss/forms/_input-group.scss +17 -11
- data/vendor/assets/scss/forms/_label.scss +2 -0
- data/vendor/assets/scss/forms/_meter.scss +9 -10
- data/vendor/assets/scss/forms/_progress.scss +9 -9
- data/vendor/assets/scss/forms/_range.scss +20 -15
- data/vendor/assets/scss/forms/_select.scss +26 -8
- data/vendor/assets/scss/forms/_text.scss +19 -16
- data/vendor/assets/scss/foundation.scss +19 -3
- data/vendor/assets/scss/grid/_classes.scss +31 -14
- data/vendor/assets/scss/grid/_column.scss +10 -24
- data/vendor/assets/scss/grid/_flex-grid.scss +84 -76
- data/vendor/assets/scss/grid/_grid.scss +0 -16
- data/vendor/assets/scss/grid/_gutter.scss +53 -5
- data/vendor/assets/scss/grid/_layout.scss +3 -3
- data/vendor/assets/scss/grid/_position.scss +3 -3
- data/vendor/assets/scss/grid/_row.scss +24 -19
- data/vendor/assets/scss/settings/_settings.scss +117 -70
- data/vendor/assets/scss/typography/_base.scss +110 -44
- data/vendor/assets/scss/typography/_helpers.scss +1 -0
- data/vendor/assets/scss/typography/_print.scss +7 -3
- data/vendor/assets/scss/typography/_typography.scss +0 -2
- data/vendor/assets/scss/util/_breakpoint.scss +28 -19
- data/vendor/assets/scss/util/_color.scss +69 -16
- data/vendor/assets/scss/util/_flex.scss +20 -3
- data/vendor/assets/scss/util/_math.scss +72 -0
- data/vendor/assets/scss/util/_mixins.scss +63 -26
- data/vendor/assets/scss/util/_selector.scss +3 -2
- data/vendor/assets/scss/util/_unit.scss +61 -4
- data/vendor/assets/scss/util/_util.scss +1 -0
- data/vendor/assets/scss/util/_value.scss +33 -0
- metadata +17 -2
@@ -58,7 +58,12 @@ class Sticky {
|
|
58
58
|
}
|
59
59
|
|
60
60
|
_this._setSizes(function(){
|
61
|
-
|
61
|
+
var scroll = window.pageYOffset;
|
62
|
+
_this._calc(false, scroll);
|
63
|
+
//Unstick the element will ensure that proper classes are set.
|
64
|
+
if (!_this.isStuck) {
|
65
|
+
_this._removeSticky((scroll >= _this.topPoint) ? false : true);
|
66
|
+
}
|
62
67
|
});
|
63
68
|
_this._events(id.split('-').reverse().join('-'));
|
64
69
|
});
|
@@ -204,7 +209,6 @@ class Sticky {
|
|
204
209
|
css[mrgn] = `${this.options[mrgn]}em`;
|
205
210
|
css[stickTo] = 0;
|
206
211
|
css[notStuckTo] = 'auto';
|
207
|
-
css['left'] = this.$container.offset().left + parseInt(window.getComputedStyle(this.$container[0])["padding-left"], 10);
|
208
212
|
this.isStuck = true;
|
209
213
|
this.$element.removeClass(`is-anchored is-at-${notStuckTo}`)
|
210
214
|
.addClass(`is-stuck is-at-${stickTo}`)
|
@@ -246,7 +250,6 @@ class Sticky {
|
|
246
250
|
css['top'] = anchorPt;
|
247
251
|
}
|
248
252
|
|
249
|
-
css['left'] = '';
|
250
253
|
this.isStuck = false;
|
251
254
|
this.$element.removeClass(`is-stuck is-at-${stickTo}`)
|
252
255
|
.addClass(`is-anchored is-at-${topOrBottom}`)
|
@@ -266,14 +269,15 @@ class Sticky {
|
|
266
269
|
* @private
|
267
270
|
*/
|
268
271
|
_setSizes(cb) {
|
269
|
-
this.canStick = Foundation.MediaQuery.
|
272
|
+
this.canStick = Foundation.MediaQuery.is(this.options.stickyOn);
|
270
273
|
if (!this.canStick) {
|
271
274
|
if (cb && typeof cb === 'function') { cb(); }
|
272
275
|
}
|
273
276
|
var _this = this,
|
274
277
|
newElemWidth = this.$container[0].getBoundingClientRect().width,
|
275
278
|
comp = window.getComputedStyle(this.$container[0]),
|
276
|
-
|
279
|
+
pdngl = parseInt(comp['padding-left'], 10),
|
280
|
+
pdngr = parseInt(comp['padding-right'], 10);
|
277
281
|
|
278
282
|
if (this.$anchor && this.$anchor.length) {
|
279
283
|
this.anchorHeight = this.$anchor[0].getBoundingClientRect().height;
|
@@ -282,7 +286,7 @@ class Sticky {
|
|
282
286
|
}
|
283
287
|
|
284
288
|
this.$element.css({
|
285
|
-
'max-width': `${newElemWidth -
|
289
|
+
'max-width': `${newElemWidth - pdngl - pdngr}px`
|
286
290
|
});
|
287
291
|
|
288
292
|
var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight;
|
@@ -295,9 +299,7 @@ class Sticky {
|
|
295
299
|
});
|
296
300
|
this.elemHeight = newContainerHeight;
|
297
301
|
|
298
|
-
if (this.isStuck) {
|
299
|
-
this.$element.css({"left":this.$container.offset().left + parseInt(comp['padding-left'], 10)});
|
300
|
-
} else {
|
302
|
+
if (!this.isStuck) {
|
301
303
|
if (this.$element.hasClass('is-at-bottom')) {
|
302
304
|
var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight;
|
303
305
|
this.$element.css('top', anchorPt);
|
@@ -42,13 +42,14 @@ class Tabs {
|
|
42
42
|
_init() {
|
43
43
|
var _this = this;
|
44
44
|
|
45
|
+
this.$element.attr({'role': 'tablist'});
|
45
46
|
this.$tabTitles = this.$element.find(`.${this.options.linkClass}`);
|
46
47
|
this.$tabContent = $(`[data-tabs-content="${this.$element[0].id}"]`);
|
47
48
|
|
48
49
|
this.$tabTitles.each(function(){
|
49
50
|
var $elem = $(this),
|
50
51
|
$link = $elem.find('a'),
|
51
|
-
isActive = $elem.hasClass(
|
52
|
+
isActive = $elem.hasClass(`${_this.options.linkActiveClass}`),
|
52
53
|
hash = $link[0].hash.slice(1),
|
53
54
|
linkId = $link[0].id ? $link[0].id : `${hash}-label`,
|
54
55
|
$tabContent = $(`#${hash}`);
|
@@ -69,7 +70,37 @@ class Tabs {
|
|
69
70
|
});
|
70
71
|
|
71
72
|
if(isActive && _this.options.autoFocus){
|
72
|
-
$
|
73
|
+
$(window).load(function() {
|
74
|
+
$('html, body').animate({ scrollTop: $elem.offset().top }, _this.options.deepLinkSmudgeDelay, () => {
|
75
|
+
$link.focus();
|
76
|
+
});
|
77
|
+
});
|
78
|
+
}
|
79
|
+
|
80
|
+
//use browser to open a tab, if it exists in this tabset
|
81
|
+
if (_this.options.deepLink) {
|
82
|
+
var anchor = window.location.hash;
|
83
|
+
//need a hash and a relevant anchor in this tabset
|
84
|
+
if(anchor.length) {
|
85
|
+
var $link = $elem.find('[href="'+anchor+'"]');
|
86
|
+
if ($link.length) {
|
87
|
+
_this.selectTab($(anchor));
|
88
|
+
|
89
|
+
//roll up a little to show the titles
|
90
|
+
if (_this.options.deepLinkSmudge) {
|
91
|
+
$(window).load(function() {
|
92
|
+
var offset = $elem.offset();
|
93
|
+
$('html, body').animate({ scrollTop: offset.top }, _this.options.deepLinkSmudgeDelay);
|
94
|
+
});
|
95
|
+
}
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Fires when the zplugin has deeplinked at pageload
|
99
|
+
* @event Tabs#deeplink
|
100
|
+
*/
|
101
|
+
$elem.trigger('deeplink.zf.tabs', [$link, $(anchor)]);
|
102
|
+
}
|
103
|
+
}
|
73
104
|
}
|
74
105
|
});
|
75
106
|
|
@@ -94,10 +125,10 @@ class Tabs {
|
|
94
125
|
this._addKeyHandler();
|
95
126
|
this._addClickHandler();
|
96
127
|
this._setHeightMqHandler = null;
|
97
|
-
|
128
|
+
|
98
129
|
if (this.options.matchHeight) {
|
99
130
|
this._setHeightMqHandler = this._setHeight.bind(this);
|
100
|
-
|
131
|
+
|
101
132
|
$(window).on('changed.zf.mediaquery', this._setHeightMqHandler);
|
102
133
|
}
|
103
134
|
}
|
@@ -114,9 +145,6 @@ class Tabs {
|
|
114
145
|
.on('click.zf.tabs', `.${this.options.linkClass}`, function(e){
|
115
146
|
e.preventDefault();
|
116
147
|
e.stopPropagation();
|
117
|
-
if ($(this).hasClass('is-active')) {
|
118
|
-
return;
|
119
|
-
}
|
120
148
|
_this._handleTabChange($(this));
|
121
149
|
});
|
122
150
|
}
|
@@ -127,12 +155,10 @@ class Tabs {
|
|
127
155
|
*/
|
128
156
|
_addKeyHandler() {
|
129
157
|
var _this = this;
|
130
|
-
var $firstTab = _this.$element.find('li:first-of-type');
|
131
|
-
var $lastTab = _this.$element.find('li:last-of-type');
|
132
158
|
|
133
159
|
this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function(e){
|
134
160
|
if (e.which === 9) return;
|
135
|
-
|
161
|
+
|
136
162
|
|
137
163
|
var $element = $(this),
|
138
164
|
$elements = $element.parent('ul').children('li'),
|
@@ -175,38 +201,95 @@ class Tabs {
|
|
175
201
|
}
|
176
202
|
|
177
203
|
/**
|
178
|
-
* Opens the tab `$targetContent` defined by `$target`.
|
204
|
+
* Opens the tab `$targetContent` defined by `$target`. Collapses active tab.
|
179
205
|
* @param {jQuery} $target - Tab to open.
|
180
206
|
* @fires Tabs#change
|
181
207
|
* @function
|
182
208
|
*/
|
183
209
|
_handleTabChange($target) {
|
184
|
-
var $tabLink = $target.find('[role="tab"]'),
|
185
|
-
hash = $tabLink[0].hash,
|
186
|
-
$targetContent = this.$tabContent.find(hash),
|
187
|
-
$oldTab = this.$element.
|
188
|
-
find(`.${this.options.linkClass}.is-active`)
|
189
|
-
.removeClass('is-active')
|
190
|
-
.find('[role="tab"]')
|
191
|
-
.attr({ 'aria-selected': 'false' });
|
192
|
-
|
193
|
-
$(`#${$oldTab.attr('aria-controls')}`)
|
194
|
-
.removeClass('is-active')
|
195
|
-
.attr({ 'aria-hidden': 'true' });
|
196
210
|
|
197
|
-
|
211
|
+
/**
|
212
|
+
* Check for active class on target. Collapse if exists.
|
213
|
+
*/
|
214
|
+
if ($target.hasClass(`${this.options.linkActiveClass}`)) {
|
215
|
+
if(this.options.activeCollapse) {
|
216
|
+
this._collapseTab($target);
|
217
|
+
|
218
|
+
/**
|
219
|
+
* Fires when the zplugin has successfully collapsed tabs.
|
220
|
+
* @event Tabs#collapse
|
221
|
+
*/
|
222
|
+
this.$element.trigger('collapse.zf.tabs', [$target]);
|
223
|
+
}
|
224
|
+
return;
|
225
|
+
}
|
226
|
+
|
227
|
+
var $oldTab = this.$element.
|
228
|
+
find(`.${this.options.linkClass}.${this.options.linkActiveClass}`),
|
229
|
+
$tabLink = $target.find('[role="tab"]'),
|
230
|
+
hash = $tabLink[0].hash,
|
231
|
+
$targetContent = this.$tabContent.find(hash);
|
232
|
+
|
233
|
+
//close old tab
|
234
|
+
this._collapseTab($oldTab);
|
235
|
+
|
236
|
+
//open new tab
|
237
|
+
this._openTab($target);
|
198
238
|
|
199
|
-
|
239
|
+
//either replace or update browser history
|
240
|
+
if (this.options.deepLink) {
|
241
|
+
var anchor = $target.find('a').attr('href');
|
200
242
|
|
201
|
-
|
202
|
-
|
203
|
-
|
243
|
+
if (this.options.updateHistory) {
|
244
|
+
history.pushState({}, '', anchor);
|
245
|
+
} else {
|
246
|
+
history.replaceState({}, '', anchor);
|
247
|
+
}
|
248
|
+
}
|
204
249
|
|
205
250
|
/**
|
206
251
|
* Fires when the plugin has successfully changed tabs.
|
207
252
|
* @event Tabs#change
|
208
253
|
*/
|
209
|
-
this.$element.trigger('change.zf.tabs', [$target]);
|
254
|
+
this.$element.trigger('change.zf.tabs', [$target, $targetContent]);
|
255
|
+
|
256
|
+
//fire to children a mutation event
|
257
|
+
$targetContent.find("[data-mutate]").trigger("mutateme.zf.trigger");
|
258
|
+
}
|
259
|
+
|
260
|
+
/**
|
261
|
+
* Opens the tab `$targetContent` defined by `$target`.
|
262
|
+
* @param {jQuery} $target - Tab to Open.
|
263
|
+
* @function
|
264
|
+
*/
|
265
|
+
_openTab($target) {
|
266
|
+
var $tabLink = $target.find('[role="tab"]'),
|
267
|
+
hash = $tabLink[0].hash,
|
268
|
+
$targetContent = this.$tabContent.find(hash);
|
269
|
+
|
270
|
+
$target.addClass(`${this.options.linkActiveClass}`);
|
271
|
+
|
272
|
+
$tabLink.attr({'aria-selected': 'true'});
|
273
|
+
|
274
|
+
$targetContent
|
275
|
+
.addClass(`${this.options.panelActiveClass}`)
|
276
|
+
.attr({'aria-hidden': 'false'});
|
277
|
+
}
|
278
|
+
|
279
|
+
/**
|
280
|
+
* Collapses `$targetContent` defined by `$target`.
|
281
|
+
* @param {jQuery} $target - Tab to Open.
|
282
|
+
* @function
|
283
|
+
*/
|
284
|
+
_collapseTab($target) {
|
285
|
+
var $target_anchor = $target
|
286
|
+
.removeClass(`${this.options.linkActiveClass}`)
|
287
|
+
.find('[role="tab"]')
|
288
|
+
.attr({ 'aria-selected': 'false' });
|
289
|
+
|
290
|
+
$(`#${$target_anchor.attr('aria-controls')}`)
|
291
|
+
.removeClass(`${this.options.panelActiveClass}`)
|
292
|
+
.attr({ 'aria-hidden': 'true' });
|
210
293
|
}
|
211
294
|
|
212
295
|
/**
|
@@ -245,7 +328,7 @@ class Tabs {
|
|
245
328
|
.css('height', '')
|
246
329
|
.each(function() {
|
247
330
|
var panel = $(this),
|
248
|
-
isActive = panel.hasClass(
|
331
|
+
isActive = panel.hasClass(`${this.options.panelActiveClass}`);
|
249
332
|
|
250
333
|
if (!isActive) {
|
251
334
|
panel.css({'visibility': 'hidden', 'display': 'block'});
|
@@ -287,8 +370,37 @@ class Tabs {
|
|
287
370
|
}
|
288
371
|
|
289
372
|
Tabs.defaults = {
|
373
|
+
/**
|
374
|
+
* Allows the window to scroll to content of pane specified by hash anchor
|
375
|
+
* @option
|
376
|
+
* @example false
|
377
|
+
*/
|
378
|
+
deepLink: false,
|
379
|
+
|
380
|
+
/**
|
381
|
+
* Adjust the deep link scroll to make sure the top of the tab panel is visible
|
382
|
+
* @option
|
383
|
+
* @example false
|
384
|
+
*/
|
385
|
+
deepLinkSmudge: false,
|
386
|
+
|
387
|
+
/**
|
388
|
+
* Animation time (ms) for the deep link adjustment
|
389
|
+
* @option
|
390
|
+
* @example 300
|
391
|
+
*/
|
392
|
+
deepLinkSmudgeDelay: 300,
|
393
|
+
|
394
|
+
/**
|
395
|
+
* Update the browser history with the open tab
|
396
|
+
* @option
|
397
|
+
* @example false
|
398
|
+
*/
|
399
|
+
updateHistory: false,
|
400
|
+
|
290
401
|
/**
|
291
402
|
* Allows the window to scroll to content of active pane on load if set to true.
|
403
|
+
* Not recommended if more than one tab panel per page.
|
292
404
|
* @option
|
293
405
|
* @example false
|
294
406
|
*/
|
@@ -308,6 +420,13 @@ Tabs.defaults = {
|
|
308
420
|
*/
|
309
421
|
matchHeight: false,
|
310
422
|
|
423
|
+
/**
|
424
|
+
* Allows active tabs to collapse when clicked.
|
425
|
+
* @option
|
426
|
+
* @example false
|
427
|
+
*/
|
428
|
+
activeCollapse: false,
|
429
|
+
|
311
430
|
/**
|
312
431
|
* Class applied to `li`'s in tab link list.
|
313
432
|
* @option
|
@@ -315,17 +434,27 @@ Tabs.defaults = {
|
|
315
434
|
*/
|
316
435
|
linkClass: 'tabs-title',
|
317
436
|
|
437
|
+
/**
|
438
|
+
* Class applied to the active `li` in tab link list.
|
439
|
+
* @option
|
440
|
+
* @example 'is-active'
|
441
|
+
*/
|
442
|
+
linkActiveClass: 'is-active',
|
443
|
+
|
318
444
|
/**
|
319
445
|
* Class applied to the content containers.
|
320
446
|
* @option
|
321
447
|
* @example 'tabs-panel'
|
322
448
|
*/
|
323
|
-
panelClass: 'tabs-panel'
|
324
|
-
};
|
449
|
+
panelClass: 'tabs-panel',
|
325
450
|
|
326
|
-
|
327
|
-
|
328
|
-
|
451
|
+
/**
|
452
|
+
* Class applied to the active content container.
|
453
|
+
* @option
|
454
|
+
* @example 'is-active'
|
455
|
+
*/
|
456
|
+
panelActiveClass: 'is-active'
|
457
|
+
};
|
329
458
|
|
330
459
|
// Window exports
|
331
460
|
Foundation.plugin(Tabs, 'Tabs');
|
@@ -96,6 +96,7 @@ class Toggler {
|
|
96
96
|
}
|
97
97
|
|
98
98
|
this._updateARIA(isOn);
|
99
|
+
this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
99
100
|
}
|
100
101
|
|
101
102
|
_toggleAnimate() {
|
@@ -105,12 +106,14 @@ class Toggler {
|
|
105
106
|
Foundation.Motion.animateIn(this.$element, this.animationIn, function() {
|
106
107
|
_this._updateARIA(true);
|
107
108
|
this.trigger('on.zf.toggler');
|
109
|
+
this.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
108
110
|
});
|
109
111
|
}
|
110
112
|
else {
|
111
113
|
Foundation.Motion.animateOut(this.$element, this.animationOut, function() {
|
112
114
|
_this._updateARIA(false);
|
113
115
|
this.trigger('off.zf.toggler');
|
116
|
+
this.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
114
117
|
});
|
115
118
|
}
|
116
119
|
}
|
@@ -40,9 +40,15 @@ class Tooltip {
|
|
40
40
|
this.options.tipText = this.options.tipText || this.$element.attr('title');
|
41
41
|
this.template = this.options.template ? $(this.options.template) : this._buildTemplate(elemId);
|
42
42
|
|
43
|
-
this.
|
43
|
+
if (this.options.allowHtml) {
|
44
|
+
this.template.appendTo(document.body)
|
45
|
+
.html(this.options.tipText)
|
46
|
+
.hide();
|
47
|
+
} else {
|
48
|
+
this.template.appendTo(document.body)
|
44
49
|
.text(this.options.tipText)
|
45
50
|
.hide();
|
51
|
+
}
|
46
52
|
|
47
53
|
this.$element.attr({
|
48
54
|
'title': '',
|
@@ -165,7 +171,7 @@ class Tooltip {
|
|
165
171
|
* @function
|
166
172
|
*/
|
167
173
|
show() {
|
168
|
-
if (this.options.showOn !== 'all' && !Foundation.MediaQuery.
|
174
|
+
if (this.options.showOn !== 'all' && !Foundation.MediaQuery.is(this.options.showOn)) {
|
169
175
|
// console.error('The screen is too small to display this tooltip');
|
170
176
|
return false;
|
171
177
|
}
|
@@ -333,12 +339,9 @@ class Tooltip {
|
|
333
339
|
*/
|
334
340
|
destroy() {
|
335
341
|
this.$element.attr('title', this.template.text())
|
336
|
-
.off('.zf.trigger .zf.
|
337
|
-
|
338
|
-
.removeAttr('aria-describedby')
|
339
|
-
.removeAttr('data-yeti-box')
|
340
|
-
.removeAttr('data-toggle')
|
341
|
-
.removeAttr('data-resize');
|
342
|
+
.off('.zf.trigger .zf.tooltip')
|
343
|
+
.removeClass('has-tip top right left')
|
344
|
+
.removeAttr('aria-describedby aria-haspopup data-disable-hover data-resize data-toggle data-tooltip data-yeti-box');
|
342
345
|
|
343
346
|
this.template.remove();
|
344
347
|
|
@@ -432,7 +435,14 @@ Tooltip.defaults = {
|
|
432
435
|
* @option
|
433
436
|
* @example 12
|
434
437
|
*/
|
435
|
-
hOffset: 12
|
438
|
+
hOffset: 12,
|
439
|
+
/**
|
440
|
+
* Allow HTML in tooltip. Warning: If you are loading user-generated content into tooltips,
|
441
|
+
* allowing HTML may open yourself up to XSS attacks.
|
442
|
+
* @option
|
443
|
+
* @example false
|
444
|
+
*/
|
445
|
+
allowHtml: false
|
436
446
|
};
|
437
447
|
|
438
448
|
/**
|
@@ -442,4 +452,4 @@ Tooltip.defaults = {
|
|
442
452
|
// Window exports
|
443
453
|
Foundation.plugin(Tooltip, 'Tooltip');
|
444
454
|
|
445
|
-
}(jQuery);
|
455
|
+
}(jQuery);
|
@@ -175,13 +175,13 @@ function GetOffsets(element, anchor, position, vOffset, hOffset, isOverflow) {
|
|
175
175
|
case 'left bottom':
|
176
176
|
return {
|
177
177
|
left: $anchorDims.offset.left,
|
178
|
-
top: $anchorDims.offset.top + $anchorDims.height
|
178
|
+
top: $anchorDims.offset.top + $anchorDims.height + vOffset
|
179
179
|
};
|
180
180
|
break;
|
181
181
|
case 'right bottom':
|
182
182
|
return {
|
183
183
|
left: $anchorDims.offset.left + $anchorDims.width + hOffset - $eleDims.width,
|
184
|
-
top: $anchorDims.offset.top + $anchorDims.height
|
184
|
+
top: $anchorDims.offset.top + $anchorDims.height + vOffset
|
185
185
|
};
|
186
186
|
break;
|
187
187
|
default:
|