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
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/calendar-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ CalendarTooltip.prototype.close = function() {
this.$content.remove();
this.exportDropdown.destroy();
this.$container.removeClass('is-active');
this.$container.focus(); // TODO: jQuery deprecation
this.$container.trigger('focus');
this.events.clear();
};
4 changes: 2 additions & 2 deletions fec/fec/static/js/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ Calendar.prototype.managePopoverControl = function(e) {
$popover
.find('.fc-close')
.attr('tabindex', '0')
.focus() // TODO: jQuery deprecation
.trigger('focus')
.on('click', function() {
$target.focus(); // TODO: jQuery deprecation
$target.trigger('focus');
});
};
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function download(url, init, focus) {
}

if (focus) {
item.$button.focus(); // TODO: jQuery deprecation
item.$button.trigger('focus');
}

return item;
Expand Down
10 changes: 5 additions & 5 deletions fec/fec/static/js/modules/dropdowns.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Dropdown.prototype.toggle = function(e) {
Dropdown.prototype.show = function() {
restoreTabindex(this.$panel);
this.$panel.attr('aria-hidden', 'false');
this.$panel.find('input[type="checkbox"]:first').focus(); // TODO: jQuery deprecation (:first and .focus)
this.$panel.find('input[type="checkbox"]').first().trigger('focus');
this.$button.addClass('is-active');
this.isOpen = true;
};
Expand Down Expand Up @@ -120,7 +120,7 @@ Dropdown.prototype.handleKeyup = function(e) {
if (e.keyCode === KEYCODE_ESC) {
if (this.isOpen) {
this.hide();
this.$button.focus(); // TODO: jQuery deprecation
this.$button.trigger('focus');
}
}
};
Expand Down Expand Up @@ -221,14 +221,14 @@ Dropdown.prototype.selectItem = function($input) {
if (next.length) {
$(next[0])
.find('input[type="checkbox"]')
.focus(); // TODO: jQuery deprecation
.trigger('focus');
} else if (prev.length) {
$(prev[0])
.find('input[type="checkbox"]')
.focus(); // TODO: jQuery deprecation
.trigger('focus');
}
} else {
this.$selected.find('input[type="checkbox"]').focus(); // TODO: jQuery deprecation
this.$selected.find('input[type="checkbox"]').trigger('focus');
}
};

Expand Down
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/filters/date-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ DateFilter.prototype.handleGridItemSelect = function(e) {
this.$grid.find('li').unbind('mouseenter mouseleave'); // TODO: jQuery deprecation (.unbind())
this.setValue(value);
this.$grid.addClass('is-invalid');
$nextItem.focus(); // TODO: jQuery deprecation
$nextItem.trigger('focus');
}
};

Expand Down
4 changes: 2 additions & 2 deletions fec/fec/static/js/modules/filters/filter-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ FilterPanel.prototype.show = function(focus) {
this.$body
.find('input, select, button:not(.js-filter-close)')
.first()
.focus(); // TODO: jQuery deprecation
.trigger('focus');
}
};

Expand All @@ -76,7 +76,7 @@ FilterPanel.prototype.hide = function() {
}
this.$body.removeClass('is-open');
this.$content.attr('aria-hidden', true);
this.$focus.focus(); // TODO: jQuery deprecation
this.$focus.trigger('focus');
removeTabindex(this.$form);
$('body').removeClass('is-showing-filters');
this.isOpen = false;
Expand Down
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/filters/filter-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ FilterTypeahead.prototype.handleSelected = function(e, datum) {

this.$elm.find('label[for="' + id + '"]').addClass('is-loading');

this.$button.focus().addClass('is-loading');
this.$button.trigger('focus').addClass('is-loading');
};

FilterTypeahead.prototype.handleAutocomplete = function(e, datum) {
Expand Down
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/filters/text-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TextFilter.prototype.handleChange = function() {
// set the button focus within a timeout
// to prevent change event from firing twice
setTimeout(function() {
button.focus(); // TODO: jQuery deprecation
button.trigger('focus');
}, 0);

if (value.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Search($el, opts) {
$(document.body).on('keyup', function(e) {
// Focus search on "/"
if (e.keyCode === KEYCODE_SLASH) {
$input.first().focus(); // TODO: jQuery deprecation
$input.first().trigger('focus');
}
});
}
2 changes: 1 addition & 1 deletion fec/fec/static/js/modules/skip-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ Skipnav.prototype.focusOnTarget = function(e) {

if (e.keyCode === 13 || e.type === 'click') {
this.$target.attr('tabindex', '0');
this.$target.focus(); // TODO: jQuery deprecation
this.$target.trigger('focus');
}
};
4 changes: 2 additions & 2 deletions fec/fec/static/js/modules/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export function modalRenderFactory(template, fetch) {
$modal.find('.js-pdf_url').remove();
}
// Set focus on the close button
$('.js-hide').focus(); // TODO: jQuery deprecation
$('.js-hide').trigger('focus');

// When under $large-screen
// TODO figure way to share these values with CSS.
Expand All @@ -260,7 +260,7 @@ export function modalRenderFactory(template, fetch) {
}

function hidePanel(api, $modal) {
$('.row-active .js-panel-button').focus(); // TODO: jQuery deprecation
$('.row-active .js-panel-button').trigger('focus');
$('.js-panel-toggle tr').toggleClass('row-active', false);
$('body').toggleClass('panel-active', false);
$modal.attr('aria-hidden', 'true');
Expand Down
4 changes: 2 additions & 2 deletions fec/fec/static/js/pages/contact-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ ContactForm.prototype.initTypeahead = function() {
//focus away to prompt removal of error state, if present. Could only focus into...
//...another field, Attempts to focusout, or focus onto body, did not work.
$('#id_u_contact_title')
.focus() // TODO: jQuery deprecation
.blur(); // TODO: jQuery deprecation
.trigger('focus')
.trigger('blur');
});
};

Expand Down
2 changes: 1 addition & 1 deletion fec/fec/static/js/pages/reporting-dates-tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ ReportingDates.prototype.mediaQueryResponse = function(mql) {
for (const close of jsmodalClose) {
close.addEventListener('click', () => {
jsmodal[0].setAttribute('aria-hidden', 'true');
close.focus(); // TODO: jQuery deprecation
close.trigger('focus');
});
}
});
Expand Down