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();