unnecessary hack

This commit is contained in:
Andrew Brown 2019-05-12 20:28:43 -05:00
parent 706f8b59af
commit 8fa7364e5b
2 changed files with 8 additions and 20 deletions

View File

@ -12,10 +12,3 @@
</li>
</ul>
</div>
<%= content_for :javascript do %>
$('.slider').slider({
height: 200,
indicators: false
});
<% end %>

View File

@ -49,19 +49,14 @@
<% if defined?(autocomplete) && autocomplete %>
<%= content_for :javascript do %>
$(function() {
// This setTimeout is an unfortunate hack to ensure this runs after initializing materialize
setTimeout(function() {
//console.log("Initializing autocomplete for #<%= "#{content_name}_#{field[:label]}" %>");
$('.js-autocomplete-<%= field[:id].to_s %>').autocomplete({
limit: 5,
data: {
<% autocomplete.each do |autocomplete_option| %>
"<%= autocomplete_option %>": null,
<% end %>
}
});
}, 1000);
$('.js-autocomplete-<%= field[:id].to_s %>').autocomplete({
limit: 5,
data: {
<% autocomplete.each do |autocomplete_option| %>
"<%= autocomplete_option %>": null,
<% end %>
}
});
});
<% end %>
<% end %>