mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Use Haml javascript tag to make autocomplete work
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user