From fa94392fb6185341774ab567e191cbc502debb2f Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 11 Aug 2021 13:24:09 +0100 Subject: [PATCH] Fix deprecated syntax for live() function --- app/views/admin/producer_properties/index.html.haml | 4 ++-- app/views/spree/admin/product_properties/index.html.haml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/admin/producer_properties/index.html.haml b/app/views/admin/producer_properties/index.html.haml index c66f02a32e..aed1166fba 100644 --- a/app/views/admin/producer_properties/index.html.haml +++ b/app/views/admin/producer_properties/index.html.haml @@ -18,8 +18,8 @@ :javascript var properties = #{raw(@properties.to_json)}; - $("#producer_properties input.autocomplete").live("keydown", function() { - already_auto_completed = $(this).is('ac_input'); + $("#producer_properties").on("keydown", "input.autocomplete", function() { + var already_auto_completed = $(this).is('ac_input'); if (!already_auto_completed) { $(this).autocomplete({source: properties}); $(this).focus(); diff --git a/app/views/spree/admin/product_properties/index.html.haml b/app/views/spree/admin/product_properties/index.html.haml index a595ceadc7..2754133f0c 100644 --- a/app/views/spree/admin/product_properties/index.html.haml +++ b/app/views/spree/admin/product_properties/index.html.haml @@ -61,8 +61,9 @@ :javascript var properties = #{raw(@properties.to_json)}; - $("#product_properties input.autocomplete").live("keydown", function(){ - already_auto_completed = $(this).is('ac_input'); + + $("#product_properties").on("keydown", "input.autocomplete", function(){ + var already_auto_completed = $(this).is('ac_input'); if (!already_auto_completed) { $(this).autocomplete({source: properties}); $(this).focus();