Use Haml javascript tag to make autocomplete work

This commit is contained in:
Hugo Daniel
2019-07-25 11:20:51 +02:00
parent 0a88738faa
commit 2d872c25bf

View File

@@ -60,13 +60,13 @@
$("input#product_inherits_properties").change ->
$("#inherited_properties").toggle $(this).is(':checked')
= javascript_tag do
:javascript
var properties = #{raw(@properties.to_json)};
console.log(properties)
$("#product_properties input.autocomplete").live("keydown", function(){
already_auto_completed = $(this).is('ac_input');
if (!already_auto_completed) {
$(this).autocomplete({source: properties});
$(this).focus();
}
already_auto_completed = $(this).is('ac_input');
if (!already_auto_completed) {
$(this).autocomplete({source: properties});
$(this).focus();
}
});