foundation-rails 5.4.5.0 → 5.5.0.0
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/foundation-rails.gemspec +1 -1
- data/lib/foundation/rails/generators/install_generator.rb +4 -4
- data/lib/foundation/rails/templates/application.html.erb +3 -2
- data/lib/foundation/rails/templates/application.html.haml +1 -1
- data/lib/foundation/rails/templates/application.html.slim +1 -1
- data/lib/foundation/rails/version.rb +1 -1
- data/vendor/assets/_settings.scss +25 -21
- data/vendor/assets/javascripts/foundation/foundation.abide.js +28 -23
- data/vendor/assets/javascripts/foundation/foundation.accordion.js +10 -8
- data/vendor/assets/javascripts/foundation/foundation.alert.js +4 -4
- data/vendor/assets/javascripts/foundation/foundation.clearing.js +3 -3
- data/vendor/assets/javascripts/foundation/foundation.dropdown.js +139 -22
- data/vendor/assets/javascripts/foundation/foundation.equalizer.js +1 -2
- data/vendor/assets/javascripts/foundation/foundation.interchange.js +14 -10
- data/vendor/assets/javascripts/foundation/foundation.joyride.js +18 -9
- data/vendor/assets/javascripts/foundation/foundation.js +86 -21
- data/vendor/assets/javascripts/foundation/foundation.magellan.js +15 -6
- data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +14 -14
- data/vendor/assets/javascripts/foundation/foundation.orbit.js +3 -3
- data/vendor/assets/javascripts/foundation/foundation.reveal.js +16 -11
- data/vendor/assets/javascripts/foundation/foundation.slider.js +56 -28
- data/vendor/assets/javascripts/foundation/foundation.tab.js +9 -9
- data/vendor/assets/javascripts/foundation/foundation.tooltip.js +1 -1
- data/vendor/assets/javascripts/foundation/foundation.topbar.js +5 -5
- data/vendor/assets/stylesheets/foundation/_functions.scss +57 -12
- data/vendor/assets/stylesheets/foundation/_settings.scss +25 -21
- data/vendor/assets/stylesheets/foundation/components/_accordion.scss +1 -1
- data/vendor/assets/stylesheets/foundation/components/_alert-boxes.scss +2 -0
- data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +1 -2
- data/vendor/assets/stylesheets/foundation/components/_buttons.scss +4 -5
- data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +11 -10
- data/vendor/assets/stylesheets/foundation/components/_dropdown.scss +1 -0
- data/vendor/assets/stylesheets/foundation/components/_forms.scss +31 -32
- data/vendor/assets/stylesheets/foundation/components/_global.scss +53 -25
- data/vendor/assets/stylesheets/foundation/components/_grid.scss +18 -4
- data/vendor/assets/stylesheets/foundation/components/_icon-bar.scss +51 -15
- data/vendor/assets/stylesheets/foundation/components/_labels.scss +2 -2
- data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +8 -6
- data/vendor/assets/stylesheets/foundation/components/_orbit.scss +11 -11
- data/vendor/assets/stylesheets/foundation/components/_panels.scss +6 -0
- data/vendor/assets/stylesheets/foundation/components/_reveal.scss +6 -3
- data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +1 -3
- data/vendor/assets/stylesheets/foundation/components/_switches.scss +25 -13
- data/vendor/assets/stylesheets/foundation/components/_tabs.scss +2 -2
- data/vendor/assets/stylesheets/foundation/components/_toolbar.scss +3 -3
- data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +64 -53
- data/vendor/assets/stylesheets/foundation/components/_visibility.scss +7 -7
- data/vendor/assets/stylesheets/normalize.scss +5 -3
- metadata +8 -8
data/bower.json
CHANGED
data/foundation-rails.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
-
spec.add_dependency "sass", [">= 3.2.0"]
|
22
|
+
spec.add_dependency "sass", [">= 3.2.0", "< 3.4"]
|
23
23
|
spec.add_dependency "railties", [">= 3.1.0"]
|
24
24
|
spec.add_development_dependency "rake"
|
25
25
|
end
|
@@ -14,7 +14,7 @@ module Foundation
|
|
14
14
|
# rails_ujs breaks, need to incorporate rails-behavior plugin for this to work seamlessly
|
15
15
|
# gsub_file "app/assets/javascripts/application#{detect_js_format[0]}", /\/\/= require jquery\n/, ""
|
16
16
|
insert_into_file "app/assets/javascripts/application#{detect_js_format[0]}", "#{detect_js_format[1]} require foundation\n", :after => "jquery_ujs\n"
|
17
|
-
append_to_file "app/assets/javascripts/application#{detect_js_format[0]}", "
|
17
|
+
append_to_file "app/assets/javascripts/application#{detect_js_format[0]}", "#{detect_js_format[2]}"
|
18
18
|
settings_file = File.join(File.dirname(__FILE__),"..", "..", "..", "..", "vendor", "assets", "stylesheets", "foundation", "_settings.scss")
|
19
19
|
create_file "app/assets/stylesheets/foundation_and_overrides.scss", File.read(settings_file)
|
20
20
|
append_to_file "app/assets/stylesheets/foundation_and_overrides.scss", "\n@import 'foundation';\n"
|
@@ -22,9 +22,9 @@ module Foundation
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def detect_js_format
|
25
|
-
return ['.coffee', '#='] if File.exist?('app/assets/javascripts/application.coffee')
|
26
|
-
return ['.js.coffee', '#='] if File.exist?('app/assets/javascripts/application.js.coffee')
|
27
|
-
return ['.js', '//='] if File.exist?('app/assets/javascripts/application.js')
|
25
|
+
return ['.coffee', '#=', "\n() ->\n $(document).foundation()\n"] if File.exist?('app/assets/javascripts/application.coffee')
|
26
|
+
return ['.js.coffee', '#=', "\n() ->\n $(document).foundation()\n"] if File.exist?('app/assets/javascripts/application.js.coffee')
|
27
|
+
return ['.js', '//=', "\n$(function(){ $(document).foundation(); });\n"] if File.exist?('app/assets/javascripts/application.js')
|
28
28
|
end
|
29
29
|
|
30
30
|
def detect_css_format
|
@@ -8,12 +8,13 @@
|
|
8
8
|
|
9
9
|
<%%= stylesheet_link_tag "application" %>
|
10
10
|
<%%= javascript_include_tag "vendor/modernizr" %>
|
11
|
+
<%%= javascript_include_tag "application" 'data-turbolinks-track' => true %>
|
11
12
|
<%%= csrf_meta_tags %>
|
12
13
|
</head>
|
13
14
|
|
14
15
|
<body>
|
15
16
|
|
16
17
|
<%%= yield %>
|
17
|
-
|
18
|
+
|
18
19
|
</body>
|
19
|
-
</html>
|
20
|
+
</html>
|
@@ -9,10 +9,10 @@
|
|
9
9
|
|
10
10
|
= stylesheet_link_tag "application"
|
11
11
|
= javascript_include_tag "vendor/modernizr"
|
12
|
+
= javascript_include_tag "application", 'data-turbolinks-track' => true
|
12
13
|
= csrf_meta_tag
|
13
14
|
|
14
15
|
%body
|
15
16
|
|
16
17
|
= yield
|
17
18
|
|
18
|
-
= javascript_include_tag "application"
|
@@ -8,10 +8,10 @@ html lang="en"
|
|
8
8
|
|
9
9
|
= stylesheet_link_tag "application"
|
10
10
|
= javascript_include_tag "vendor/modernizr"
|
11
|
+
= javascript_include_tag "application", 'data-turbolinks-track' => true
|
11
12
|
= csrf_meta_tag
|
12
13
|
|
13
14
|
body
|
14
15
|
|
15
16
|
== yield
|
16
17
|
|
17
|
-
= javascript_include_tag "application"
|
@@ -95,14 +95,6 @@ $include-html-global-classes: $include-html-classes;
|
|
95
95
|
// $font-weight-normal: normal !default;
|
96
96
|
// $font-weight-bold: bold !default;
|
97
97
|
|
98
|
-
// We use these as default colors throughout
|
99
|
-
// $primary-color: #008CBA;
|
100
|
-
// $secondary-color: #e7e7e7;
|
101
|
-
// $alert-color: #f04124;
|
102
|
-
// $success-color: #43AC6A;
|
103
|
-
// $warning-color: #f08a24;
|
104
|
-
// $info-color: #a0d3e8;
|
105
|
-
|
106
98
|
// $white : #FFFFFF;
|
107
99
|
// $ghost : #FAFAFA;
|
108
100
|
// $snow : #F9F9F9;
|
@@ -123,6 +115,14 @@ $include-html-global-classes: $include-html-classes;
|
|
123
115
|
// $jet : #222222;
|
124
116
|
// $black : #000000;
|
125
117
|
|
118
|
+
// We use these as default colors throughout
|
119
|
+
// $primary-color: #008CBA;
|
120
|
+
// $secondary-color: #e7e7e7;
|
121
|
+
// $alert-color: #f04124;
|
122
|
+
// $success-color: #43AC6A;
|
123
|
+
// $warning-color: #f08a24;
|
124
|
+
// $info-color: #a0d3e8;
|
125
|
+
|
126
126
|
// We use these to control various global styles
|
127
127
|
// $body-bg: $white;
|
128
128
|
// $body-font-color: $jet;
|
@@ -318,14 +318,14 @@ $include-html-global-classes: $include-html-classes;
|
|
318
318
|
// $include-html-accordion-classes: $include-html-classes;
|
319
319
|
|
320
320
|
// $accordion-navigation-padding: rem-calc(16);
|
321
|
-
// $accordion-navigation-bg-color: $silver
|
321
|
+
// $accordion-navigation-bg-color: $silver;
|
322
322
|
// $accordion-navigation-hover-bg-color: scale-color($accordion-navigation-bg-color, $lightness: -5%);
|
323
323
|
// $accordion-navigation-active-bg-color: scale-color($accordion-navigation-bg-color, $lightness: -3%);
|
324
324
|
// $accordion-navigation-font-color: $jet;
|
325
325
|
// $accordion-navigation-font-size: rem-calc(16);
|
326
326
|
// $accordion-navigation-font-family: $body-font-family;
|
327
327
|
|
328
|
-
// $accordion-content-padding: $column-gutter/2;
|
328
|
+
// $accordion-content-padding: ($column-gutter/2);
|
329
329
|
// $accordion-content-active-bg-color: $white;
|
330
330
|
|
331
331
|
// 02. Alert Boxes
|
@@ -545,7 +545,7 @@ $include-html-global-classes: $include-html-classes;
|
|
545
545
|
// $f-dropdown-font-size: rem-calc(14);
|
546
546
|
// $f-dropdown-list-padding: rem-calc(5, 10);
|
547
547
|
// $f-dropdown-line-height: rem-calc(18);
|
548
|
-
// $f-dropdown-list-hover-bg: $smoke
|
548
|
+
// $f-dropdown-list-hover-bg: $smoke;
|
549
549
|
// $dropdown-mobile-default-float: 0;
|
550
550
|
|
551
551
|
// We use this to control the styles for when the dropdown has custom content.
|
@@ -573,25 +573,25 @@ $include-html-global-classes: $include-html-classes;
|
|
573
573
|
// $dropdown-button-padding-tny: $button-pip-tny * 7;
|
574
574
|
// $dropdown-button-pip-size-tny: $button-pip-tny;
|
575
575
|
// $dropdown-button-pip-opposite-tny: $button-pip-tny * 3;
|
576
|
-
// $dropdown-button-pip-top-tny: -$button-pip-tny / 2 + rem-calc(1);
|
576
|
+
// $dropdown-button-pip-top-tny: (-$button-pip-tny / 2) + rem-calc(1);
|
577
577
|
|
578
578
|
// We use these to style small dropdown buttons
|
579
579
|
// $dropdown-button-padding-sml: $button-pip-sml * 7;
|
580
580
|
// $dropdown-button-pip-size-sml: $button-pip-sml;
|
581
581
|
// $dropdown-button-pip-opposite-sml: $button-pip-sml * 3;
|
582
|
-
// $dropdown-button-pip-top-sml: -$button-pip-sml / 2 + rem-calc(1);
|
582
|
+
// $dropdown-button-pip-top-sml: (-$button-pip-sml / 2) + rem-calc(1);
|
583
583
|
|
584
584
|
// We use these to style medium dropdown buttons
|
585
585
|
// $dropdown-button-padding-med: $button-pip-med * 6 + rem-calc(3);
|
586
586
|
// $dropdown-button-pip-size-med: $button-pip-med - rem-calc(3);
|
587
587
|
// $dropdown-button-pip-opposite-med: $button-pip-med * 2.5;
|
588
|
-
// $dropdown-button-pip-top-med: -$button-pip-med / 2 + rem-calc(2);
|
588
|
+
// $dropdown-button-pip-top-med: (-$button-pip-med / 2) + rem-calc(2);
|
589
589
|
|
590
590
|
// We use these to style large dropdown buttons
|
591
591
|
// $dropdown-button-padding-lrg: $button-pip-lrg * 5 + rem-calc(3);
|
592
592
|
// $dropdown-button-pip-size-lrg: $button-pip-lrg - rem-calc(6);
|
593
593
|
// $dropdown-button-pip-opposite-lrg: $button-pip-lrg * 2.5;
|
594
|
-
// $dropdown-button-pip-top-lrg: -$button-pip-lrg / 2 + rem-calc(3);
|
594
|
+
// $dropdown-button-pip-top-lrg: (-$button-pip-lrg / 2) + rem-calc(3);
|
595
595
|
|
596
596
|
// 10. Flex Video
|
597
597
|
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
@@ -667,6 +667,7 @@ $include-html-global-classes: $include-html-classes;
|
|
667
667
|
// $input-error-message-font-weight: $font-weight-normal;
|
668
668
|
// $input-error-message-font-style: italic;
|
669
669
|
// $input-error-message-font-color: $white;
|
670
|
+
// $input-error-message-bg-color: $alert-color;
|
670
671
|
// $input-error-message-font-color-alt: $oil;
|
671
672
|
|
672
673
|
// We use this to style the glowing effect of inputs when focused
|
@@ -685,9 +686,11 @@ $include-html-global-classes: $include-html-classes;
|
|
685
686
|
// $include-html-icon-bar-classes: $include-html-classes;
|
686
687
|
// $icon-bar-bg: $oil;
|
687
688
|
// $icon-bar-font-color: $white;
|
689
|
+
// $icon-bar-font-color-hover: $icon-bar-font-color;
|
688
690
|
// $icon-bar-font-size: 1rem;
|
689
691
|
// $icon-bar-hover-color: $primary-color;
|
690
692
|
// $icon-bar-icon-color: $white;
|
693
|
+
// $icon-bar-icon-color-hover: $icon-bar-icon-color;
|
691
694
|
// $icon-bar-icon-size: 1.875rem;
|
692
695
|
// $icon-bar-image-width: 1.875rem;
|
693
696
|
// $icon-bar-image-height: 1.875rem;
|
@@ -991,7 +994,7 @@ $include-html-global-classes: $include-html-classes;
|
|
991
994
|
// $price-title-font-family: $body-font-family;
|
992
995
|
|
993
996
|
// We use these to control the price styles
|
994
|
-
// $price-money-bg: $vapor
|
997
|
+
// $price-money-bg: $vapor;
|
995
998
|
// $price-money-padding: rem-calc(15 20);
|
996
999
|
// $price-money-align: center;
|
997
1000
|
// $price-money-color: $oil;
|
@@ -1268,7 +1271,7 @@ $include-html-global-classes: $include-html-classes;
|
|
1268
1271
|
|
1269
1272
|
// These control the background color for the table and even rows
|
1270
1273
|
// $table-bg: $white;
|
1271
|
-
// $table-even-row-bg: $snow
|
1274
|
+
// $table-even-row-bg: $snow;
|
1272
1275
|
|
1273
1276
|
// These control the table cell border style
|
1274
1277
|
// $table-border-style: solid;
|
@@ -1308,7 +1311,7 @@ $include-html-global-classes: $include-html-classes;
|
|
1308
1311
|
// $tabs-navigation-font-family: $body-font-family;
|
1309
1312
|
|
1310
1313
|
// $tabs-content-margin-bottom: rem-calc(24);
|
1311
|
-
// $tabs-content-padding: $column-gutter/2;
|
1314
|
+
// $tabs-content-padding: ($column-gutter/2);
|
1312
1315
|
|
1313
1316
|
// $tabs-vertical-navigation-margin-bottom: 1.25rem;
|
1314
1317
|
|
@@ -1365,7 +1368,7 @@ $include-html-global-classes: $include-html-classes;
|
|
1365
1368
|
// $topbar-bg: $topbar-bg-color;
|
1366
1369
|
|
1367
1370
|
// Height and margin
|
1368
|
-
// $topbar-height:
|
1371
|
+
// $topbar-height: rem-calc(45);
|
1369
1372
|
// $topbar-margin-bottom: 0;
|
1370
1373
|
|
1371
1374
|
// Controlling the styles for the title in the top bar
|
@@ -1376,6 +1379,7 @@ $include-html-global-classes: $include-html-classes;
|
|
1376
1379
|
// $topbar-dropdown-bg: $oil;
|
1377
1380
|
// $topbar-dropdown-link-color: $white;
|
1378
1381
|
// $topbar-dropdown-link-bg: $oil;
|
1382
|
+
// $topbar-dropdown-link-bg-hover: $oil;
|
1379
1383
|
// $topbar-dropdown-link-weight: $font-weight-normal;
|
1380
1384
|
// $topbar-dropdown-toggle-size: 5px;
|
1381
1385
|
// $topbar-dropdown-toggle-color: $white;
|
@@ -1391,12 +1395,12 @@ $include-html-global-classes: $include-html-classes;
|
|
1391
1395
|
// $topbar-link-hover-lightness: -10%; // Darken by 10%
|
1392
1396
|
// $topbar-link-bg: $topbar-bg;
|
1393
1397
|
// $topbar-link-bg-color-hover: $charcoal;
|
1394
|
-
// $topbar-link-bg-hover:
|
1398
|
+
// $topbar-link-bg-hover: $oil;
|
1395
1399
|
// $topbar-link-bg-active: $primary-color;
|
1396
1400
|
// $topbar-link-bg-active-hover: scale-color($primary-color, $lightness: -14%);
|
1397
1401
|
// $topbar-link-font-family: $body-font-family;
|
1398
1402
|
// $topbar-link-text-transform: none;
|
1399
|
-
// $topbar-link-padding: $topbar-height / 3;
|
1403
|
+
// $topbar-link-padding: ($topbar-height / 3);
|
1400
1404
|
// $topbar-back-link-size: $h5-font-size;
|
1401
1405
|
// $topbar-link-dropdown-padding: 20px;
|
1402
1406
|
|
@@ -4,12 +4,14 @@
|
|
4
4
|
Foundation.libs.abide = {
|
5
5
|
name : 'abide',
|
6
6
|
|
7
|
-
version : '5.
|
7
|
+
version : '5.5.0',
|
8
8
|
|
9
9
|
settings : {
|
10
10
|
live_validate : true,
|
11
|
+
validate_on_blur: true,
|
11
12
|
focus_on_invalid : true,
|
12
13
|
error_labels: true, // labels with a for="inputId" will recieve an `error` class
|
14
|
+
error_class: 'error',
|
13
15
|
timeout : 1000,
|
14
16
|
patterns : {
|
15
17
|
alpha: /^[a-zA-Z]+$/,
|
@@ -26,7 +28,7 @@
|
|
26
28
|
|
27
29
|
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
30
|
// abc.de
|
29
|
-
domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,
|
31
|
+
domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
|
30
32
|
|
31
33
|
datetime: /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
|
32
34
|
// YYYY-MM-DD
|
@@ -78,10 +80,12 @@
|
|
78
80
|
.find('input, textarea, select')
|
79
81
|
.off('.abide')
|
80
82
|
.on('blur.fndtn.abide change.fndtn.abide', function (e) {
|
81
|
-
|
83
|
+
if (settings.validate_on_blur === true) {
|
84
|
+
self.validate([this], e);
|
85
|
+
}
|
82
86
|
})
|
83
87
|
.on('keydown.fndtn.abide', function (e) {
|
84
|
-
if (settings.live_validate === true) {
|
88
|
+
if (settings.live_validate === true && e.which != 9) {
|
85
89
|
clearTimeout(self.timer);
|
86
90
|
self.timer = setTimeout(function () {
|
87
91
|
self.validate([this], e);
|
@@ -93,7 +97,7 @@
|
|
93
97
|
reset : function (form) {
|
94
98
|
form.removeAttr(this.invalid_attr);
|
95
99
|
$(this.invalid_attr, form).removeAttr(this.invalid_attr);
|
96
|
-
$('.
|
100
|
+
$('.' + this.settings.error_class, form).not('small').removeClass(this.settings.error_class);
|
97
101
|
},
|
98
102
|
|
99
103
|
validate : function (els, e, is_ajax) {
|
@@ -106,14 +110,14 @@
|
|
106
110
|
for (var i=0; i < validation_count; i++) {
|
107
111
|
if (!validations[i] && (submit_event || is_ajax)) {
|
108
112
|
if (this.settings.focus_on_invalid) els[i].focus();
|
109
|
-
form.trigger('invalid');
|
113
|
+
form.trigger('invalid').trigger('invalid.fndtn.abide');
|
110
114
|
this.S(els[i]).closest('form').attr(this.invalid_attr, '');
|
111
115
|
return false;
|
112
116
|
}
|
113
117
|
}
|
114
118
|
|
115
119
|
if (submit_event || is_ajax) {
|
116
|
-
form.trigger('valid');
|
120
|
+
form.trigger('valid').trigger('valid.fndtn.abide');
|
117
121
|
}
|
118
122
|
|
119
123
|
form.removeAttr(this.invalid_attr);
|
@@ -155,6 +159,7 @@
|
|
155
159
|
return [el, pattern, required];
|
156
160
|
},
|
157
161
|
|
162
|
+
// TODO: Break this up into smaller methods, getting hard to read.
|
158
163
|
check_validation_and_apply_styles : function (el_patterns) {
|
159
164
|
var i = el_patterns.length,
|
160
165
|
validations = [],
|
@@ -207,9 +212,9 @@
|
|
207
212
|
this.S(el).removeAttr(this.invalid_attr);
|
208
213
|
el.setAttribute('aria-invalid', 'false');
|
209
214
|
el.removeAttribute('aria-describedby');
|
210
|
-
parent.removeClass(
|
215
|
+
parent.removeClass(this.settings.error_class);
|
211
216
|
if (label.length > 0 && this.settings.error_labels) {
|
212
|
-
label.removeClass(
|
217
|
+
label.removeClass(this.settings.error_class).removeAttr('role');
|
213
218
|
}
|
214
219
|
$(el).triggerHandler('valid');
|
215
220
|
} else {
|
@@ -217,19 +222,19 @@
|
|
217
222
|
el.setAttribute('aria-invalid', 'true');
|
218
223
|
|
219
224
|
// Try to find the error associated with the input
|
220
|
-
var errorElem = parent.find('small.
|
225
|
+
var errorElem = parent.find('small.'+this.settings.error_class, 'span.'+this.settings.error_class);
|
221
226
|
var errorID = errorElem.length > 0 ? errorElem[0].id : "";
|
222
227
|
if (errorID.length > 0) el.setAttribute('aria-describedby', errorID);
|
223
228
|
|
224
229
|
// el.setAttribute('aria-describedby', $(el).find('.error')[0].id);
|
225
|
-
parent.addClass(
|
230
|
+
parent.addClass(this.settings.error_class);
|
226
231
|
if (label.length > 0 && this.settings.error_labels) {
|
227
|
-
label.addClass(
|
232
|
+
label.addClass(this.settings.error_class).attr('role', 'alert');
|
228
233
|
}
|
229
234
|
$(el).triggerHandler('invalid');
|
230
235
|
}
|
231
|
-
validations.push(el_validations[0]);
|
232
236
|
}
|
237
|
+
validations.push(el_validations[0]);
|
233
238
|
}
|
234
239
|
validations = [validations.every(function(valid){return valid;})];
|
235
240
|
return validations;
|
@@ -240,9 +245,9 @@
|
|
240
245
|
valid = (el.is(':checked') || !required);
|
241
246
|
|
242
247
|
if (valid) {
|
243
|
-
el.removeAttr(this.invalid_attr).parent().removeClass(
|
248
|
+
el.removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
|
244
249
|
} else {
|
245
|
-
el.attr(this.invalid_attr, '').parent().addClass(
|
250
|
+
el.attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
|
246
251
|
}
|
247
252
|
|
248
253
|
return valid;
|
@@ -262,9 +267,9 @@
|
|
262
267
|
// Has to count up to make sure the focus gets applied to the top error
|
263
268
|
for (var i=0; i < count; i++) {
|
264
269
|
if (valid) {
|
265
|
-
this.S(group[i]).removeAttr(this.invalid_attr).parent().removeClass(
|
270
|
+
this.S(group[i]).removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
|
266
271
|
} else {
|
267
|
-
this.S(group[i]).attr(this.invalid_attr, '').parent().addClass(
|
272
|
+
this.S(group[i]).attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
|
268
273
|
}
|
269
274
|
}
|
270
275
|
|
@@ -278,12 +283,12 @@
|
|
278
283
|
|
279
284
|
if (valid) {
|
280
285
|
this.S(el).removeAttr(this.invalid_attr);
|
281
|
-
parent.removeClass(
|
282
|
-
if (label.length > 0 && settings.error_labels) label.removeClass(
|
286
|
+
parent.removeClass(this.settings.error_class);
|
287
|
+
if (label.length > 0 && settings.error_labels) label.removeClass(this.settings.error_class);
|
283
288
|
} else {
|
284
289
|
this.S(el).attr(this.invalid_attr, '');
|
285
|
-
parent.addClass(
|
286
|
-
if (label.length > 0 && settings.error_labels) label.addClass(
|
290
|
+
parent.addClass(this.settings.error_class);
|
291
|
+
if (label.length > 0 && settings.error_labels) label.addClass(this.settings.error_class);
|
287
292
|
}
|
288
293
|
|
289
294
|
return valid;
|
@@ -295,9 +300,9 @@
|
|
295
300
|
valid = others.filter(':checked').length > 0;
|
296
301
|
|
297
302
|
if (valid) {
|
298
|
-
el.removeAttr(this.invalid_attr).parent().removeClass(
|
303
|
+
el.removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
|
299
304
|
} else {
|
300
|
-
el.attr(this.invalid_attr, '').parent().addClass(
|
305
|
+
el.attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
|
301
306
|
}
|
302
307
|
|
303
308
|
if (!doNotValidateOthers) {
|
@@ -4,9 +4,10 @@
|
|
4
4
|
Foundation.libs.accordion = {
|
5
5
|
name : 'accordion',
|
6
6
|
|
7
|
-
version : '5.
|
7
|
+
version : '5.5.0',
|
8
8
|
|
9
9
|
settings : {
|
10
|
+
content_class: 'content',
|
10
11
|
active_class: 'active',
|
11
12
|
multi_expand: false,
|
12
13
|
toggleable: true,
|
@@ -22,23 +23,24 @@
|
|
22
23
|
var S = this.S;
|
23
24
|
S(this.scope)
|
24
25
|
.off('.fndtn.accordion')
|
25
|
-
.on('click.fndtn.accordion', '[' + this.attr_name() + '] >
|
26
|
+
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > .accordion-navigation > a', function (e) {
|
26
27
|
var accordion = S(this).closest('[' + self.attr_name() + ']'),
|
27
28
|
groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
|
28
|
-
settings = accordion.data(self.attr_name(true) + '-init'),
|
29
|
+
settings = accordion.data(self.attr_name(true) + '-init') || self.settings,
|
29
30
|
target = S('#' + this.href.split('#')[1]),
|
30
|
-
aunts = $('>
|
31
|
-
siblings = aunts.children('.
|
31
|
+
aunts = $('> .accordion-navigation', accordion),
|
32
|
+
siblings = aunts.children('.'+settings.content_class),
|
32
33
|
active_content = siblings.filter('.' + settings.active_class);
|
34
|
+
|
33
35
|
e.preventDefault();
|
34
36
|
|
35
37
|
if (accordion.attr(self.attr_name())) {
|
36
|
-
siblings = siblings.add('[' + groupSelector + '] dd > .
|
37
|
-
aunts = aunts.add('[' + groupSelector + ']
|
38
|
+
siblings = siblings.add('[' + groupSelector + '] dd > '+'.'+settings.content_class);
|
39
|
+
aunts = aunts.add('[' + groupSelector + '] .accordion-navigation');
|
38
40
|
}
|
39
41
|
|
40
42
|
if (settings.toggleable && target.is(active_content)) {
|
41
|
-
target.parent('
|
43
|
+
target.parent('.accordion-navigation').toggleClass(settings.active_class, false);
|
42
44
|
target.toggleClass(settings.active_class, false);
|
43
45
|
settings.callback(target);
|
44
46
|
target.triggerHandler('toggled', [accordion]);
|