Skip to content

Commit e2317e7

Browse files
timokaetagliala
authored andcommitted
Fix jQuery 3 deprecations
`focus` and `delegate` have been deprecated respectively in jQuery 3.3.0 and 3.0.0 This commit replaces `focus` with `trigger` (available since v1.0.0) and `delegate` with `on` (available since v1.7.0) Ref: - https://api.jquery.com/category/deprecated/deprecated-3.0/ - jquery/api.jquery.com#972
1 parent 5537c8b commit e2317e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vendor/assets/javascripts/data-confirm-modal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
});
251251

252252
modal.on('shown.bs.modal', function () {
253-
verification.focus();
253+
verification.trigger('focus');
254254
});
255255

256256
modal.on('hidden.bs.modal', function () {
@@ -274,7 +274,7 @@
274274
focus_element = modal.find('.' + focus_element);
275275

276276
modal.on('shown.bs.modal', function () {
277-
focus_element.focus();
277+
focus_element.trigger('focus');
278278
});
279279

280280
$('body').append(modal);
@@ -330,7 +330,7 @@
330330
*/
331331
var window_confirm = window.confirm;
332332

333-
$(document).delegate(settings.elements.join(', '), 'confirm', function() {
333+
$(document).on('confirm', settings.elements.join(', '), function() {
334334
var modal = $(this).getConfirmModal();
335335

336336
if (!modal.is(':visible')) {

0 commit comments

Comments
 (0)