diff --git a/fec/fec/static/js/modules/audit_tags.js b/fec/fec/static/js/modules/audit_tags.js index 5a96809ee..799ad20be 100644 --- a/fec/fec/static/js/modules/audit_tags.js +++ b/fec/fec/static/js/modules/audit_tags.js @@ -20,12 +20,12 @@ export default function auditTags() { $('.tag__item.sub').contents()[0].nodeValue = `Sub Category: ${current_sub}`; }); - $('.js-close_sub').click(function() { // TODO: jQuery deprecation + $('.js-close_sub').on('click', function() { $('#primary_category_id').trigger('change'); $('#sub_category_id').val('all'); }); - $('.js-close_primary').click(function() { // TODO: jQuery deprecation + $('.js-close_primary').on('click', function() { $('#primary_category_id').val('all'); $('#primary_category_id').trigger('change'); $('.tag__item.primary button').hide(); diff --git a/fec/fec/static/js/modules/calendar.js b/fec/fec/static/js/modules/calendar.js index bdda2ea1c..d24882019 100644 --- a/fec/fec/static/js/modules/calendar.js +++ b/fec/fec/static/js/modules/calendar.js @@ -339,7 +339,7 @@ Calendar.prototype.handleEventClick = function(calEvent, jsEvent) { // Simulate clicks when hitting enter on certain full-calendar elements Calendar.prototype.simulateClick = function(e) { if (e.keyCode === 13) { - $(e.target).click(); // TODO: jQuery deprecation + $(e.target).trigger('click'); } }; diff --git a/fec/fec/static/js/modules/dropdowns.js b/fec/fec/static/js/modules/dropdowns.js index 9a3baf934..b77a60658 100644 --- a/fec/fec/static/js/modules/dropdowns.js +++ b/fec/fec/static/js/modules/dropdowns.js @@ -145,7 +145,7 @@ Dropdown.prototype.handleDropdownItemClick = function(e) { const $input = this.$selected.find('#' + $button.data('label')); if (!$button.hasClass('is-checked')) { - $input.click(); // TODO: jQuery deprecation + $input.trigger('click'); } }; diff --git a/fec/fec/static/js/modules/filters/filter-set.js b/fec/fec/static/js/modules/filters/filter-set.js index b82bf668c..c6407755b 100644 --- a/fec/fec/static/js/modules/filters/filter-set.js +++ b/fec/fec/static/js/modules/filters/filter-set.js @@ -166,7 +166,7 @@ FilterSet.prototype.handleTagRemoved = function(e, opts) { const type = $input.get(0).type; if (type === 'checkbox' || type === 'radio') { - $input.click(); // TODO: jQuery deprecation + $input.trigger('click'); } else if (type === 'text' || type === 'select-one') { $input.val(''); $input.get(0).dispatchEvent(new Event('change', { bubbles: true })); diff --git a/fec/fec/templates/404.html b/fec/fec/templates/404.html index 33caac1a3..368385762 100644 --- a/fec/fec/templates/404.html +++ b/fec/fec/templates/404.html @@ -7,8 +7,7 @@

Page not found

Sorry, we couldn't find the page you're looking for.

- {# TODO: jQuery deprecation of .click() #} -

We work hard to keep our URLs up to date, but please let us know if you think something is missing or broken. Use the feedback box on the bottom of any page or contact the FEC.

+

We work hard to keep our URLs up to date, but please let us know if you think something is missing or broken. Use the feedback box on the bottom of any page or contact the FEC.

diff --git a/fec/fec/templates/500.html b/fec/fec/templates/500.html index dcc3d79d7..85c0f8c52 100644 --- a/fec/fec/templates/500.html +++ b/fec/fec/templates/500.html @@ -7,9 +7,8 @@

Server error

- {# TODO: jQuery deprecation of .click() #}

Sorry, this page failed to load. Check the FEC’s API status page to see if we are experiencing a temporary outage. If not, please try again, and thanks for your patience.

-

If you'd like to contact our team, use the feedback box on the bottom of any page or contact the FEC.

+

If you'd like to contact our team, use the feedback box on the bottom of any page or contact the FEC.

diff --git a/fec/fec/tests/js/calendar.js b/fec/fec/tests/js/calendar.js index 05a0bd916..49797b183 100644 --- a/fec/fec/tests/js/calendar.js +++ b/fec/fec/tests/js/calendar.js @@ -250,17 +250,17 @@ describe('calendar tooltip', function() { }); it('closes on click away', function() { - $(document.body).click(); // TODO: jQuery deprecation + $(document.body).trigger('click'); expect($('.cal-details').length).to.equal(0); }); it('stays open if you click inside it', function() { - this.calendarTooltip.$content.find('a').click(); // TODO: jQuery deprecation + this.calendarTooltip.$content.find('a').trigger('click'); expect($('.cal-details').length).to.equal(1); }); it('closes on clicking the close button', function() { - this.calendarTooltip.$content.find('.js-close').click(); // TODO: jQuery deprecation + this.calendarTooltip.$content.find('.js-close').trigger('click'); expect($('.cal-details').length).to.equal(0); }); diff --git a/fec/fec/tests/js/checkbox-filter.js b/fec/fec/tests/js/checkbox-filter.js index 9fe800d17..a6254522e 100644 --- a/fec/fec/tests/js/checkbox-filter.js +++ b/fec/fec/tests/js/checkbox-filter.js @@ -136,7 +136,7 @@ describe('checkbox filters', function() { }); it('removes checkbox on clicking the button', function() { - this.filter.$elm.find('.js-remove').click(); // TODO: jQuery deprecation + this.filter.$elm.find('.js-remove').trigger('click'); expect(this.filter.$elm.find('li').length).to.equal(0); }); diff --git a/fec/fec/tests/js/contact-form.js b/fec/fec/tests/js/contact-form.js index 5daa9ffa5..cd724f39e 100644 --- a/fec/fec/tests/js/contact-form.js +++ b/fec/fec/tests/js/contact-form.js @@ -82,7 +82,7 @@ describe('Contact form', function() { $('#id_u_committee').val('12345'); $('#id_u_other_reason').val('Some other reason'); $('select').val('other'); - this.form.$cancel.click(); // TODO: jQuery deprecation + this.form.$cancel.trigger('click'); expect(this.form.committeeId.val()).to.equal(''); expect($('select').val()).to.equal(null); expect($('#id_u_other_reason').val()).to.equal(''); diff --git a/fec/fec/tests/js/dropdowns.js b/fec/fec/tests/js/dropdowns.js index 2c89bca29..ecb8d5e86 100644 --- a/fec/fec/tests/js/dropdowns.js +++ b/fec/fec/tests/js/dropdowns.js @@ -65,15 +65,15 @@ describe('dropdown', function() { }); it('toggles', function() { - this.dropdown.$button.click(); // TODO: jQuery deprecation + this.dropdown.$button.trigger('click'); expect(isOpen(this.dropdown)).to.be.true; - this.dropdown.$button.click(); // TODO: jQuery deprecation + this.dropdown.$button.trigger('click'); expect(isClosed(this.dropdown)).to.be.true; }); it('handles a check', function() { var checkbox = this.dropdown.$panel.find('#A'); - checkbox.click(); // TODO: jQuery deprecation + checkbox.trigger('click'); expect(checkbox.is(':checked')).to.be.true; }); @@ -103,8 +103,8 @@ describe('dropdown', function() { it('unchecks an input', function() { var checkbox = this.dropdown.$panel.find('#B'); - checkbox.click(); // TODO: jQuery deprecation - checkbox.click(); // TODO: jQuery deprecation + checkbox.trigger('click'); + checkbox.trigger('click'); var dropdownItem = this.dropdown.$panel.find('.dropdown__item--selected'); expect(dropdownItem.hasClass('is-checked')).to.be.false; }); @@ -121,8 +121,8 @@ describe('dropdown', function() { it('removes an unchecked input', function() { var checkbox = this.dropdown.$panel.find('#B'); - checkbox.click(); // TODO: jQuery deprecation - checkbox.click(); // TODO: jQuery deprecation + checkbox.trigger('click'); + checkbox.trigger('click'); expect(checkbox.is(':checked')).to.be.false; this.dropdown.handleCheckboxRemoval(checkbox); var selectedItems = this.dropdown.$selected.find('.dropdown__item'); diff --git a/fec/fec/tests/js/tables.js b/fec/fec/tests/js/tables.js index a6013466b..de7259d36 100644 --- a/fec/fec/tests/js/tables.js +++ b/fec/fec/tests/js/tables.js @@ -106,7 +106,7 @@ describe('data table', function() { }); it('does nothing on click', function() { - this.table.$exportButton.click(); // TODO: jQuery deprecation + this.table.$exportButton.trigger('click'); expect(DataTable_FEC.prototype.export).not.to.have.been.called; }); });