From 9eddc854e473e6f5e9ca72c1320de25a26a2b250 Mon Sep 17 00:00:00 2001 From: John Carroll Date: Mon, 30 Sep 2024 16:19:38 -0400 Subject: [PATCH 1/5] add a11y.js to init.js --- fec/fec/static/js/init.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fec/fec/static/js/init.js b/fec/fec/static/js/init.js index feb6bf3fe5..bee4b568a2 100644 --- a/fec/fec/static/js/init.js +++ b/fec/fec/static/js/init.js @@ -3,6 +3,7 @@ * If present, this file initializes… * .js-accordion, .js-dropdown, .js-form-nav, .js-post-content, .js-scroll, .js-sticky-side */ +import { default as A11yDialog } from 'a11y-dialog'; import { Accordion } from 'aria-accordion/src/accordion.js'; import { default as Sticky } from 'component-sticky/index.js'; @@ -73,4 +74,16 @@ $(function() { } $p.nextAll().remove(); }); + + $('.js-modal').each(function() { + new A11yDialog(this); + this.addEventListener('dialog:show', function() { + $('body').css('overflow', 'hidden'); + }); + this.addEventListener('dialog:hide', function() { + $('body').css('overflow', 'scroll'); + }); + }); + }); + From ecddea918e78c9ffb498fd61870897abb7d78358 Mon Sep 17 00:00:00 2001 From: John Carroll Date: Wed, 2 Oct 2024 14:41:11 -0400 Subject: [PATCH 2/5] move a11y to global.js --- fec/fec/static/js/data-init.js | 12 +----------- fec/fec/static/js/global.js | 11 +++++++++++ fec/fec/static/js/init.js | 13 +------------ 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/fec/fec/static/js/data-init.js b/fec/fec/static/js/data-init.js index f3cee0660e..57a64c40eb 100644 --- a/fec/fec/static/js/data-init.js +++ b/fec/fec/static/js/data-init.js @@ -5,7 +5,7 @@ // Implementing a polyfill for js native WeakMap // in order to patch functionality in an included library // require('es6-weak-map/implement'); -import { default as A11yDialog } from 'a11y-dialog'; + import { Accordion } from 'aria-accordion/src/accordion.js'; import { default as Sticky } from 'component-sticky/index.js'; @@ -69,16 +69,6 @@ $(function() { new Search($(this)); }); - $('.js-modal').each(function() { - new A11yDialog(this); - this.addEventListener('dialog:show', function() { - $('body').css('overflow', 'hidden'); - }); - this.addEventListener('dialog:hide', function() { - $('body').css('overflow', 'scroll'); - }); - }); - // Initialize cycle selects $('.js-cycle').each(function(idx, elm) { CycleSelect.build($(elm)); diff --git a/fec/fec/static/js/global.js b/fec/fec/static/js/global.js index 868eed4046..eeebe158b4 100644 --- a/fec/fec/static/js/global.js +++ b/fec/fec/static/js/global.js @@ -3,6 +3,7 @@ */ import Glossary from 'glossary-panel/src/glossary.js'; +import { default as A11yDialog } from 'a11y-dialog'; import { default as terms } from './data/terms.json' assert { type: 'json' }; import Feedback from './modules/feedback.js'; import SiteNav from './modules/site-nav.js'; @@ -56,4 +57,14 @@ $(function() { window.submitFeedback = function(token) { feedbackWidget.submit(token); }; + + $('.js-modal').each(function() { + new A11yDialog(this); + this.addEventListener('dialog:show', function() { + $('body').css('overflow', 'hidden'); + }); + this.addEventListener('dialog:hide', function() { + $('body').css('overflow', 'scroll'); + }); + }); }); diff --git a/fec/fec/static/js/init.js b/fec/fec/static/js/init.js index bee4b568a2..aab40be9f2 100644 --- a/fec/fec/static/js/init.js +++ b/fec/fec/static/js/init.js @@ -3,7 +3,7 @@ * If present, this file initializes… * .js-accordion, .js-dropdown, .js-form-nav, .js-post-content, .js-scroll, .js-sticky-side */ -import { default as A11yDialog } from 'a11y-dialog'; + import { Accordion } from 'aria-accordion/src/accordion.js'; import { default as Sticky } from 'component-sticky/index.js'; @@ -74,16 +74,5 @@ $(function() { } $p.nextAll().remove(); }); - - $('.js-modal').each(function() { - new A11yDialog(this); - this.addEventListener('dialog:show', function() { - $('body').css('overflow', 'hidden'); - }); - this.addEventListener('dialog:hide', function() { - $('body').css('overflow', 'scroll'); - }); - }); - }); From b0322e686bd9794132b656c933734f030c75ceae Mon Sep 17 00:00:00 2001 From: John Carroll Date: Fri, 4 Oct 2024 09:39:18 -0400 Subject: [PATCH 3/5] rm data_init from full_width page --- fec/home/templates/home/full_width_page.html | 1 - 1 file changed, 1 deletion(-) diff --git a/fec/home/templates/home/full_width_page.html b/fec/home/templates/home/full_width_page.html index 5548803263..f712c4c50e 100644 --- a/fec/home/templates/home/full_width_page.html +++ b/fec/home/templates/home/full_width_page.html @@ -56,6 +56,5 @@ {% block extra_js %} - {% tags_for_js_chunks 'data-init.js' '' %} {% tags_for_js_chunks 'reporting-dates-tables.js' '' %} {% endblock %} From 4e9a73bdcd70baa68fb78abbeb25a9fcaaf63796 Mon Sep 17 00:00:00 2001 From: John Carroll Date: Fri, 4 Oct 2024 09:41:20 -0400 Subject: [PATCH 4/5] feature deploy task --- tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index d6cc61ea65..4b62083919 100644 --- a/tasks.py +++ b/tasks.py @@ -75,7 +75,7 @@ def _detect_space(repo, branch=None, yes=False): ('stage', lambda _, branch: branch.startswith('release')), ('dev', lambda _, branch: branch == 'develop'), # Uncomment below and adjust branch name to deploy desired feature branch to the feature space - # ('feature', lambda _, branch: branch == '[BRANCH NAME]'), + ('feature', lambda _, branch: branch == 'feature/6493-add-a11y-modal-to-init-js'), ) From 0ceb03138309f054e94133b7a8004f60ed2d4c75 Mon Sep 17 00:00:00 2001 From: John Carroll Date: Tue, 8 Oct 2024 02:23:40 -0400 Subject: [PATCH 5/5] rm feature deploy task --- tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 4b62083919..d6cc61ea65 100644 --- a/tasks.py +++ b/tasks.py @@ -75,7 +75,7 @@ def _detect_space(repo, branch=None, yes=False): ('stage', lambda _, branch: branch.startswith('release')), ('dev', lambda _, branch: branch == 'develop'), # Uncomment below and adjust branch name to deploy desired feature branch to the feature space - ('feature', lambda _, branch: branch == 'feature/6493-add-a11y-modal-to-init-js'), + # ('feature', lambda _, branch: branch == '[BRANCH NAME]'), )