foundation-rails 5.4.3.1 → 5.4.3.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.
- data/bower.json +2 -2
- data/lib/foundation/rails/version.rb +1 -1
- data/vendor/assets/_settings.scss +33 -34
- data/vendor/assets/javascripts/foundation/foundation.abide.js +18 -13
- data/vendor/assets/javascripts/foundation/foundation.accordion.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.alert.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.clearing.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.dropdown.js +30 -27
- data/vendor/assets/javascripts/foundation/foundation.equalizer.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.interchange.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.joyride.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.magellan.js +5 -5
- data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.orbit.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.reveal.js +2 -1
- data/vendor/assets/javascripts/foundation/foundation.slider.js +10 -11
- data/vendor/assets/javascripts/foundation/foundation.tab.js +16 -22
- data/vendor/assets/javascripts/foundation/foundation.tooltip.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.topbar.js +1 -1
- data/vendor/assets/stylesheets/foundation/_functions.scss +3 -3
- data/vendor/assets/stylesheets/foundation/_settings.scss +33 -34
- data/vendor/assets/stylesheets/foundation/components/_accordion.scss +6 -5
- data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +21 -23
- data/vendor/assets/stylesheets/foundation/components/_buttons.scss +8 -0
- data/vendor/assets/stylesheets/foundation/components/_dropdown.scss +23 -10
- data/vendor/assets/stylesheets/foundation/components/_global.scss +8 -3
- data/vendor/assets/stylesheets/foundation/components/_labels.scss +2 -1
- data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +22 -19
- data/vendor/assets/stylesheets/foundation/components/_panels.scss +2 -0
- data/vendor/assets/stylesheets/foundation/components/_reveal.scss +2 -2
- data/vendor/assets/stylesheets/foundation/components/_switches.scss +1 -1
- data/vendor/assets/stylesheets/foundation/components/_tables.scss +3 -3
- data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +1 -1
- data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +2 -1
- data/vendor/assets/stylesheets/foundation/components/_type.scss +1 -1
- metadata +4 -4
data/bower.json
CHANGED
@@ -86,32 +86,15 @@ $include-html-global-classes: $include-html-classes;
|
|
86
86
|
// c. Global
|
87
87
|
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
88
88
|
|
89
|
-
// We use these to define default font
|
90
|
-
// $font-
|
91
|
-
// $font-
|
92
|
-
|
93
|
-
// Global
|
89
|
+
// We use these to define default font stacks
|
90
|
+
// $font-family-sans-serif: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
|
91
|
+
// $font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif;
|
92
|
+
// $font-family-monospace: Consolas, "Liberation Mono", Courier, monospace;
|
94
93
|
|
95
94
|
// We use these to define default font weights
|
96
95
|
// $font-weight-normal: normal !default;
|
97
96
|
// $font-weight-bold: bold !default;
|
98
97
|
|
99
|
-
// We use these to control various global styles
|
100
|
-
// $body-bg: $white;
|
101
|
-
// $body-font-color: $jet;
|
102
|
-
// $body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
|
103
|
-
// $body-font-weight: $font-weight-normal;
|
104
|
-
// $body-font-style: normal;
|
105
|
-
|
106
|
-
// We use this to control font-smoothing
|
107
|
-
// $font-smoothing: antialiased;
|
108
|
-
|
109
|
-
// We use these to control text direction settings
|
110
|
-
// $text-direction: ltr;
|
111
|
-
// $opposite-direction: right;
|
112
|
-
// $default-float: left;
|
113
|
-
// $last-child-float: $opposite-direction;
|
114
|
-
|
115
98
|
// We use these as default colors throughout
|
116
99
|
// $primary-color: #008CBA;
|
117
100
|
// $secondary-color: #e7e7e7;
|
@@ -140,6 +123,22 @@ $include-html-global-classes: $include-html-classes;
|
|
140
123
|
// $jet : #222222;
|
141
124
|
// $black : #000000;
|
142
125
|
|
126
|
+
// We use these to control various global styles
|
127
|
+
// $body-bg: $white;
|
128
|
+
// $body-font-color: $jet;
|
129
|
+
// $body-font-family: $font-family-sans-serif;
|
130
|
+
// $body-font-weight: $font-weight-normal;
|
131
|
+
// $body-font-style: normal;
|
132
|
+
|
133
|
+
// We use this to control font-smoothing
|
134
|
+
// $font-smoothing: antialiased;
|
135
|
+
|
136
|
+
// We use these to control text direction settings
|
137
|
+
// $text-direction: ltr;
|
138
|
+
// $opposite-direction: right;
|
139
|
+
// $default-float: left;
|
140
|
+
// $last-child-float: $opposite-direction;
|
141
|
+
|
143
142
|
// We use these to make sure border radius matches unless we want it different.
|
144
143
|
// $global-radius: 3px;
|
145
144
|
// $global-rounded: 1000px;
|
@@ -245,7 +244,7 @@ $include-html-global-classes: $include-html-classes;
|
|
245
244
|
|
246
245
|
// We use these to style <code> tags
|
247
246
|
// $code-color: $oil;
|
248
|
-
// $code-font-family:
|
247
|
+
// $code-font-family: $font-family-monospace;
|
249
248
|
// $code-font-weight: $font-weight-normal;
|
250
249
|
// $code-background-color: scale-color($secondary-color, $lightness: 70%);
|
251
250
|
// $code-border-size: 1px;
|
@@ -313,7 +312,6 @@ $include-html-global-classes: $include-html-classes;
|
|
313
312
|
// $microformat-abbr-font-weight: $font-weight-bold;
|
314
313
|
// $microformat-abbr-font-decoration: none;
|
315
314
|
|
316
|
-
|
317
315
|
// 01. Accordion
|
318
316
|
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
319
317
|
|
@@ -383,7 +381,6 @@ $include-html-global-classes: $include-html-classes;
|
|
383
381
|
// $block-grid-default-spacing: rem-calc(20);
|
384
382
|
// $align-block-grid-to-grid: false;
|
385
383
|
|
386
|
-
|
387
384
|
// Enables media queries for block-grid classes. Set to false if writing semantic HTML.
|
388
385
|
// $block-grid-media-queries: true;
|
389
386
|
|
@@ -554,6 +551,10 @@ $include-html-global-classes: $include-html-classes;
|
|
554
551
|
// We use this to control the styles for when the dropdown has custom content.
|
555
552
|
// $f-dropdown-content-padding: rem-calc(20);
|
556
553
|
|
554
|
+
// Default radius for dropdown.
|
555
|
+
// $f-dropdown-radius: $global-radius;
|
556
|
+
|
557
|
+
|
557
558
|
// 09. Dropdown Buttons
|
558
559
|
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
559
560
|
|
@@ -677,7 +678,6 @@ $include-html-global-classes: $include-html-classes;
|
|
677
678
|
// $select-bg-color: $ghost;
|
678
679
|
// $select-hover-bg-color: scale-color($select-bg-color, $lightness: -3%);
|
679
680
|
|
680
|
-
|
681
681
|
// 12. Icon Bar
|
682
682
|
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
683
683
|
|
@@ -714,7 +714,7 @@ $include-html-global-classes: $include-html-classes;
|
|
714
714
|
// We use this to control the list items
|
715
715
|
// $inline-list-display: block;
|
716
716
|
|
717
|
-
// We use this to control any
|
717
|
+
// We use this to control any elements within list items
|
718
718
|
// $inline-list-children-display: block;
|
719
719
|
|
720
720
|
// 14. Joyride
|
@@ -730,7 +730,7 @@ $include-html-global-classes: $include-html-classes;
|
|
730
730
|
// $joyride-tip-radius: 4px;
|
731
731
|
// $joyride-tip-position-offset: 22px;
|
732
732
|
|
733
|
-
// Here, we're setting the tip
|
733
|
+
// Here, we're setting the tip font styles
|
734
734
|
// $joyride-tip-font-color: $white;
|
735
735
|
// $joyride-tip-font-size: rem-calc(14);
|
736
736
|
// $joyride-tip-header-weight: $font-weight-bold;
|
@@ -779,7 +779,7 @@ $include-html-global-classes: $include-html-classes;
|
|
779
779
|
// $include-html-label-classes: $include-html-classes;
|
780
780
|
|
781
781
|
// We use these to style the labels
|
782
|
-
// $label-padding: rem-calc(4 8
|
782
|
+
// $label-padding: rem-calc(4 8 4);
|
783
783
|
// $label-radius: $global-radius;
|
784
784
|
|
785
785
|
// We use these to style the label text
|
@@ -822,6 +822,7 @@ $include-html-global-classes: $include-html-classes;
|
|
822
822
|
// Off Canvas Menu Variables
|
823
823
|
// $off-canvas-width: rem-calc(250);
|
824
824
|
// $off-canvas-bg: $oil;
|
825
|
+
// $off-canvas-bg-hover: scale-color($tabbar-bg, $lightness: -30%);
|
825
826
|
|
826
827
|
// Off Canvas Menu List Variables
|
827
828
|
// $off-canvas-label-padding: 0.3rem rem-calc(15);
|
@@ -1021,7 +1022,6 @@ $include-html-global-classes: $include-html-classes;
|
|
1021
1022
|
// $price-cta-align: center;
|
1022
1023
|
// $price-cta-padding: rem-calc(20 20 0);
|
1023
1024
|
|
1024
|
-
|
1025
1025
|
// 23. Progress Bar
|
1026
1026
|
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
1027
1027
|
|
@@ -1052,7 +1052,7 @@ $include-html-global-classes: $include-html-classes;
|
|
1052
1052
|
|
1053
1053
|
// $include-html-range-slider-classes: $include-html-classes;
|
1054
1054
|
|
1055
|
-
// These
|
1055
|
+
// These variables define the slider bar styles
|
1056
1056
|
// $range-slider-bar-width: 100%;
|
1057
1057
|
// $range-slider-bar-height: rem-calc(16);
|
1058
1058
|
|
@@ -1067,7 +1067,7 @@ $include-html-global-classes: $include-html-classes;
|
|
1067
1067
|
// $range-slider-vertical-bar-width: rem-calc(16);
|
1068
1068
|
// $range-slider-vertical-bar-height: rem-calc(200);
|
1069
1069
|
|
1070
|
-
// These
|
1070
|
+
// These variables define the slider handle styles
|
1071
1071
|
// $range-slider-handle-width: rem-calc(32);
|
1072
1072
|
// $range-slider-handle-height: rem-calc(22);
|
1073
1073
|
// $range-slider-handle-position-top: rem-calc(-5);
|
@@ -1210,7 +1210,6 @@ $include-html-global-classes: $include-html-classes;
|
|
1210
1210
|
// $sub-nav-border-radius: 3px;
|
1211
1211
|
// $sub-nav-font-color-hover: scale-color($sub-nav-font-color, $lightness: -25%);
|
1212
1212
|
|
1213
|
-
|
1214
1213
|
// We use these to control the active item styles
|
1215
1214
|
// $sub-nav-active-font-weight: $font-weight-normal;
|
1216
1215
|
// $sub-nav-active-bg: $primary-color;
|
@@ -1222,7 +1221,6 @@ $include-html-global-classes: $include-html-classes;
|
|
1222
1221
|
// $sub-nav-item-divider: "";
|
1223
1222
|
// $sub-nav-item-divider-margin: rem-calc(12);
|
1224
1223
|
|
1225
|
-
|
1226
1224
|
// 29. Switch
|
1227
1225
|
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
1228
1226
|
|
@@ -1289,7 +1287,8 @@ $include-html-global-classes: $include-html-classes;
|
|
1289
1287
|
// $table-row-font-color: $jet;
|
1290
1288
|
// $table-line-height: rem-calc(18);
|
1291
1289
|
|
1292
|
-
// These are for controlling the display and margin of tables
|
1290
|
+
// These are for controlling the layout, display and margin of tables
|
1291
|
+
// $table-layout: auto;
|
1293
1292
|
// $table-display: table-cell;
|
1294
1293
|
// $table-margin-bottom: rem-calc(20);
|
1295
1294
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
Foundation.libs.abide = {
|
5
5
|
name : 'abide',
|
6
6
|
|
7
|
-
version : '5.4.
|
7
|
+
version : '5.4.3',
|
8
8
|
|
9
9
|
settings : {
|
10
10
|
live_validate : true,
|
@@ -22,7 +22,7 @@
|
|
22
22
|
cvv : /^([0-9]){3,4}$/,
|
23
23
|
|
24
24
|
// http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
|
25
|
-
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])?)
|
25
|
+
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])?)+$/,
|
26
26
|
|
27
27
|
url: /^(https?|ftp|file|ssh):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/,
|
28
28
|
// abc.de
|
@@ -36,6 +36,8 @@
|
|
36
36
|
dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
|
37
37
|
// MM/DD/YYYY
|
38
38
|
month_day_year : /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
|
39
|
+
// DD/MM/YYYY
|
40
|
+
day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
|
39
41
|
|
40
42
|
// #FFF or #FFFFFF
|
41
43
|
color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
|
@@ -167,7 +169,8 @@
|
|
167
169
|
is_radio = el.type === "radio",
|
168
170
|
is_checkbox = el.type === "checkbox",
|
169
171
|
label = this.S('label[for="' + el.getAttribute('id') + '"]'),
|
170
|
-
valid_length = (required) ? (el.value.length > 0) : true
|
172
|
+
valid_length = (required) ? (el.value.length > 0) : true,
|
173
|
+
el_validations = [];
|
171
174
|
|
172
175
|
var parent, valid;
|
173
176
|
|
@@ -182,25 +185,25 @@
|
|
182
185
|
|
183
186
|
if (validator) {
|
184
187
|
valid = this.settings.validators[validator].apply(this, [el, required, parent]);
|
185
|
-
|
188
|
+
el_validations.push(valid);
|
186
189
|
}
|
187
190
|
|
188
191
|
if (is_radio && required) {
|
189
|
-
|
192
|
+
el_validations.push(this.valid_radio(el, required));
|
190
193
|
} else if (is_checkbox && required) {
|
191
|
-
|
194
|
+
el_validations.push(this.valid_checkbox(el, required));
|
192
195
|
} else {
|
193
|
-
|
196
|
+
|
194
197
|
if (el_patterns[i][1].test(value) && valid_length ||
|
195
198
|
!required && el.value.length < 1 || $(el).attr('disabled')) {
|
196
|
-
|
199
|
+
el_validations.push(true);
|
197
200
|
} else {
|
198
|
-
|
201
|
+
el_validations.push(false);
|
199
202
|
}
|
200
203
|
|
201
|
-
|
204
|
+
el_validations = [el_validations.every(function(valid){return valid;})];
|
202
205
|
|
203
|
-
if(
|
206
|
+
if(el_validations[0]){
|
204
207
|
this.S(el).removeAttr(this.invalid_attr);
|
205
208
|
el.setAttribute('aria-invalid', 'false');
|
206
209
|
el.removeAttribute('aria-describedby');
|
@@ -225,10 +228,10 @@
|
|
225
228
|
}
|
226
229
|
$(el).triggerHandler('invalid');
|
227
230
|
}
|
228
|
-
|
231
|
+
validations.push(el_validations[0]);
|
229
232
|
}
|
230
233
|
}
|
231
|
-
|
234
|
+
validations = [validations.every(function(valid){return valid;})];
|
232
235
|
return validations;
|
233
236
|
},
|
234
237
|
|
@@ -276,9 +279,11 @@
|
|
276
279
|
if (valid) {
|
277
280
|
this.S(el).removeAttr(this.invalid_attr);
|
278
281
|
parent.removeClass('error');
|
282
|
+
if (label.length > 0 && settings.error_labels) label.removeClass('error');
|
279
283
|
} else {
|
280
284
|
this.S(el).attr(this.invalid_attr, '');
|
281
285
|
parent.addClass('error');
|
286
|
+
if (label.length > 0 && settings.error_labels) label.addClass('error');
|
282
287
|
}
|
283
288
|
|
284
289
|
return valid;
|
@@ -4,10 +4,11 @@
|
|
4
4
|
Foundation.libs.dropdown = {
|
5
5
|
name : 'dropdown',
|
6
6
|
|
7
|
-
version : '5.4.
|
7
|
+
version : '5.4.3',
|
8
8
|
|
9
9
|
settings : {
|
10
10
|
active_class: 'open',
|
11
|
+
mega_class: 'mega',
|
11
12
|
align: 'bottom',
|
12
13
|
is_hover: false,
|
13
14
|
opened: function(){},
|
@@ -49,11 +50,11 @@
|
|
49
50
|
}
|
50
51
|
|
51
52
|
var settings = target.data(self.attr_name(true) + '-init') || self.settings;
|
52
|
-
|
53
|
+
|
53
54
|
if(S(e.target).data(self.data_attr()) && settings.is_hover) {
|
54
55
|
self.closeall.call(self);
|
55
56
|
}
|
56
|
-
|
57
|
+
|
57
58
|
if (settings.is_hover) self.open.apply(self, [dropdown, target]);
|
58
59
|
})
|
59
60
|
.on('mouseleave.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) {
|
@@ -63,7 +64,7 @@
|
|
63
64
|
var settings = $this.data(self.data_attr(true) + '-init') || self.settings;
|
64
65
|
if (settings.is_hover) self.close.call(self, S('#' + $this.data(self.data_attr())));
|
65
66
|
} else {
|
66
|
-
var target
|
67
|
+
var target = S('[' + self.attr_name() + '="' + S(this).attr('id') + '"]'),
|
67
68
|
settings = target.data(self.attr_name(true) + '-init') || self.settings;
|
68
69
|
if (settings.is_hover) self.close.call(self, $this);
|
69
70
|
}
|
@@ -75,8 +76,8 @@
|
|
75
76
|
if (S(e.target).closest('[' + self.attr_name() + ']').length > 0) {
|
76
77
|
return;
|
77
78
|
}
|
78
|
-
if (!(S(e.target).data('revealId')) &&
|
79
|
-
(parent.length > 0 && (S(e.target).is('[' + self.attr_name() + '-content]') ||
|
79
|
+
if (!(S(e.target).data('revealId')) &&
|
80
|
+
(parent.length > 0 && (S(e.target).is('[' + self.attr_name() + '-content]') ||
|
80
81
|
$.contains(parent.first()[0], e.target)))) {
|
81
82
|
e.stopPropagation();
|
82
83
|
return;
|
@@ -122,7 +123,7 @@
|
|
122
123
|
closeall: function() {
|
123
124
|
var self = this;
|
124
125
|
$.each(self.S('[' + this.attr_name() + '-content]'), function() {
|
125
|
-
self.close.call(self, self.S(this))
|
126
|
+
self.close.call(self, self.S(this));
|
126
127
|
});
|
127
128
|
},
|
128
129
|
|
@@ -133,7 +134,7 @@
|
|
133
134
|
dropdown.prev('[' + this.attr_name() + ']').addClass(this.settings.active_class);
|
134
135
|
dropdown.data('target', target.get(0)).trigger('opened').trigger('opened.fndtn.dropdown', [dropdown, target]);
|
135
136
|
dropdown.attr('aria-hidden', 'false');
|
136
|
-
target.attr('aria-expanded', 'true')
|
137
|
+
target.attr('aria-expanded', 'true');
|
137
138
|
dropdown.focus();
|
138
139
|
},
|
139
140
|
|
@@ -173,12 +174,13 @@
|
|
173
174
|
},
|
174
175
|
|
175
176
|
css : function (dropdown, target) {
|
176
|
-
var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8)
|
177
|
-
|
177
|
+
var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8),
|
178
|
+
settings = target.data(this.attr_name(true) + '-init') || this.settings;
|
179
|
+
|
178
180
|
this.clear_idx();
|
179
181
|
|
180
182
|
if (this.small()) {
|
181
|
-
var p = this.dirs.bottom.call(dropdown, target);
|
183
|
+
var p = this.dirs.bottom.call(dropdown, target, settings);
|
182
184
|
|
183
185
|
dropdown.attr('style', '').removeClass('drop-left drop-right drop-top').css({
|
184
186
|
position : 'absolute',
|
@@ -189,7 +191,6 @@
|
|
189
191
|
|
190
192
|
dropdown.css(Foundation.rtl ? 'right':'left', left_offset);
|
191
193
|
} else {
|
192
|
-
var settings = target.data(this.attr_name(true) + '-init') || this.settings;
|
193
194
|
|
194
195
|
this.style(dropdown, target, settings);
|
195
196
|
}
|
@@ -198,7 +199,7 @@
|
|
198
199
|
},
|
199
200
|
|
200
201
|
style : function (dropdown, target, settings) {
|
201
|
-
var css = $.extend({position: 'absolute'},
|
202
|
+
var css = $.extend({position: 'absolute'},
|
202
203
|
this.dirs[settings.align].call(dropdown, target, settings));
|
203
204
|
|
204
205
|
dropdown.attr('style', '').css(css);
|
@@ -220,29 +221,27 @@
|
|
220
221
|
},
|
221
222
|
top: function (t, s) {
|
222
223
|
var self = Foundation.libs.dropdown,
|
223
|
-
p = self.dirs._base.call(this, t)
|
224
|
-
pip_offset_base = 8;
|
224
|
+
p = self.dirs._base.call(this, t);
|
225
225
|
|
226
226
|
this.addClass('drop-top');
|
227
227
|
|
228
|
-
if (t.outerWidth() < this.outerWidth() || self.small()) {
|
229
|
-
self.adjust_pip(
|
228
|
+
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
|
229
|
+
self.adjust_pip(this,t,s,p);
|
230
230
|
}
|
231
231
|
|
232
232
|
if (Foundation.rtl) {
|
233
|
-
return {left: p.left - this.outerWidth() + t.outerWidth(),
|
233
|
+
return {left: p.left - this.outerWidth() + t.outerWidth(),
|
234
234
|
top: p.top - this.outerHeight()};
|
235
235
|
}
|
236
236
|
|
237
237
|
return {left: p.left, top: p.top - this.outerHeight()};
|
238
238
|
},
|
239
|
-
bottom: function (t,
|
239
|
+
bottom: function (t,s) {
|
240
240
|
var self = Foundation.libs.dropdown,
|
241
|
-
p = self.dirs._base.call(this, t)
|
242
|
-
pip_offset_base = 8;
|
241
|
+
p = self.dirs._base.call(this, t);
|
243
242
|
|
244
|
-
if (t.outerWidth() < this.outerWidth() || self.small()) {
|
245
|
-
self.adjust_pip(
|
243
|
+
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
|
244
|
+
self.adjust_pip(this,t,s,p);
|
246
245
|
}
|
247
246
|
|
248
247
|
if (self.rtl) {
|
@@ -268,11 +267,15 @@
|
|
268
267
|
},
|
269
268
|
|
270
269
|
// Insert rule to style psuedo elements
|
271
|
-
adjust_pip : function (
|
272
|
-
var sheet = Foundation.stylesheet
|
270
|
+
adjust_pip : function (dropdown,target,settings,position) {
|
271
|
+
var sheet = Foundation.stylesheet,
|
272
|
+
pip_offset_base = 8;
|
273
273
|
|
274
|
-
if (
|
275
|
-
pip_offset_base
|
274
|
+
if (dropdown.hasClass(settings.mega_class)) {
|
275
|
+
pip_offset_base = position.left + (target.outerWidth()/2) - 8;
|
276
|
+
}
|
277
|
+
else if (this.small()) {
|
278
|
+
pip_offset_base += position.left - 8;
|
276
279
|
}
|
277
280
|
|
278
281
|
this.rule_idx = sheet.cssRules.length;
|