From b499c0dcddc93dddd202b71b5f7a50ee7ea09d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 17 Aug 2020 13:16:39 +0200 Subject: [PATCH] Solve `bind`method deprecation warning As mentioned at the jQuery 3.0 upgrade guide [1] the `bind` method is deprecated. Replace with `on` method. [1] https://jquery.com/upgrade-guide/3.0/#deprecated-bind-and-delegate --- .../admin/poll/questions/answers/images/destroy.js.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/poll/questions/answers/images/destroy.js.erb b/app/views/admin/poll/questions/answers/images/destroy.js.erb index 3a10a1cff..137451dda 100644 --- a/app/views/admin/poll/questions/answers/images/destroy.js.erb +++ b/app/views/admin/poll/questions/answers/images/destroy.js.erb @@ -1,3 +1,3 @@ -$(".delete").bind("ajax:success", function () { - $(this).closest("div").fadeOut() -}) +$(".delete").on("ajax:success", function () { + $(this).closest("div").fadeOut(); +});