From 8fa7364e5bba2d4c8ed4363eda802cfb3b1fb99e Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sun, 12 May 2019 20:28:43 -0500 Subject: [PATCH] unnecessary hack --- .../components/_parallax_header.html.erb | 7 ------- .../content/form/_rich_text_input.html.erb | 21 +++++++------------ 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/app/views/content/components/_parallax_header.html.erb b/app/views/content/components/_parallax_header.html.erb index 781735fe..b655403a 100644 --- a/app/views/content/components/_parallax_header.html.erb +++ b/app/views/content/components/_parallax_header.html.erb @@ -12,10 +12,3 @@ - -<%= content_for :javascript do %> - $('.slider').slider({ - height: 200, - indicators: false - }); -<% end %> diff --git a/app/views/content/form/_rich_text_input.html.erb b/app/views/content/form/_rich_text_input.html.erb index 515d526e..6842494e 100644 --- a/app/views/content/form/_rich_text_input.html.erb +++ b/app/views/content/form/_rich_text_input.html.erb @@ -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 %>