Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fec/fec/static/js/modules/audit_tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};

Expand Down
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/dropdowns.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};

Expand Down
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/filters/filter-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));
Expand Down
3 changes: 1 addition & 2 deletions fec/fec/templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<div class="message message--alert message--big">
<h1 class="message__title">Page not found</h1>
<p>Sorry, we couldn't find the page you're looking for.</p>
{# TODO: jQuery deprecation of .click() #}
<p>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 <a href="javascript:$('.js-feedback.feedback__toggle.button--cta-secondary').click();" style="text-decoration:none">feedback box</a> on the bottom of any page or <a href="https://www.fec.gov/contact/">contact the FEC</a>.</p>
<p>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 <a href="javascript:$('.js-feedback.feedback__toggle.button--cta-secondary').trigger('click');" style="text-decoration:none">feedback box</a> on the bottom of any page or <a href="https://www.fec.gov/contact/">contact the FEC</a>.</p>
</div>
</div>
</section>
Expand Down
3 changes: 1 addition & 2 deletions fec/fec/templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
<div class="container">
<div class="message message--alert message--big">
<h1 class="message__title">Server error</h1>
{# TODO: jQuery deprecation of .click() #}
<p>Sorry, this page failed to load. Check the FEC’s <a href="https://www.fec.gov/status">API status page</a> to see if we are experiencing a temporary outage. If not, please try again, and thanks for your patience.</p>
<p>If you'd like to contact our team, use the <a href="javascript:$('.js-feedback.feedback__toggle.button--cta-secondary').click();" style="text-decoration:none">feedback box</a> on the bottom of any page or <a href="https://www.fec.gov/contact/">contact the FEC</a>.</p>
<p>If you'd like to contact our team, use the <a href="javascript:$('.js-feedback.feedback__toggle.button--cta-secondary').trigger('click');" style="text-decoration:none">feedback box</a> on the bottom of any page or <a href="https://www.fec.gov/contact/">contact the FEC</a>.</p>
</div>
</div>
</section>
Expand Down
6 changes: 3 additions & 3 deletions fec/fec/tests/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion fec/fec/tests/js/checkbox-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion fec/fec/tests/js/contact-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand Down
14 changes: 7 additions & 7 deletions fec/fec/tests/js/dropdowns.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down Expand Up @@ -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;
});
Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion fec/fec/tests/js/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
});
Expand Down