Skip to content

Commit

Permalink
Use Haml javascript tag to make autocomplete work
Browse files Browse the repository at this point in the history
  • Loading branch information
HugsDaniel committed Jul 25, 2019
1 parent 0a88738 commit 2d872c2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/views/spree/admin/product_properties/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});

0 comments on commit 2d872c2

Please sign in to comment.