From eb26f2d7d79c5ba325dce704a8706145709efbd8 Mon Sep 17 00:00:00 2001 From: PhilipDeFraties Date: Thu, 26 Oct 2023 11:20:17 -0600 Subject: [PATCH 1/3] change name of file to _replaceImagePlaceholdersOnLoad.es6 change logic to run on `window.onload` --- .../_practice_partner_practices_utilities.es6 | 9 --------- .../javascripts/_replaceImagePlaceholdersOnLoad.es6 | 3 +++ 2 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 app/assets/javascripts/_practice_partner_practices_utilities.es6 create mode 100644 app/assets/javascripts/_replaceImagePlaceholdersOnLoad.es6 diff --git a/app/assets/javascripts/_practice_partner_practices_utilities.es6 b/app/assets/javascripts/_practice_partner_practices_utilities.es6 deleted file mode 100644 index 662c204ba..000000000 --- a/app/assets/javascripts/_practice_partner_practices_utilities.es6 +++ /dev/null @@ -1,9 +0,0 @@ -(($) => { - const $document = $(document); - - function execPageBuilderFunctions() { - replaceImagePlaceholders(); - } - - $document.on('turbolinks:load', execPageBuilderFunctions); -})(window.jQuery); diff --git a/app/assets/javascripts/_replaceImagePlaceholdersOnLoad.es6 b/app/assets/javascripts/_replaceImagePlaceholdersOnLoad.es6 new file mode 100644 index 000000000..4b536d2e9 --- /dev/null +++ b/app/assets/javascripts/_replaceImagePlaceholdersOnLoad.es6 @@ -0,0 +1,3 @@ +window.onload = function() { + replaceImagePlaceholders(); +} From 75ed8e2359fba641de4e6b075c432e66021a9ed5 Mon Sep 17 00:00:00 2001 From: PhilipDeFraties Date: Thu, 26 Oct 2023 11:21:44 -0600 Subject: [PATCH 2/3] remove tag for `_practice_card_utilities` and `_practice_partner_practices_utilities` add tag for `_replaceImagePlaceholdersOnLoad` --- app/views/practice_partners/show.html.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/practice_partners/show.html.erb b/app/views/practice_partners/show.html.erb index 54d222b61..64b23fb4b 100644 --- a/app/views/practice_partners/show.html.erb +++ b/app/views/practice_partners/show.html.erb @@ -1,7 +1,6 @@ <% provide :head_tags do %> - <%= javascript_include_tag '_practice_card_utilities', 'data-turbolinks-track': 'load' %> <%= javascript_include_tag 'shared/_signed_resource' %> - <%= javascript_include_tag '_practice_partner_practices_utilities', 'data-turbolinks-track': 'reload' %> + <%= javascript_include_tag '_replaceImagePlaceholdersOnLoad', 'data-turbolinks-track': 'reload' %> <% end %>
From e96ccd1ce16bc498299bf0b19c5bfa7323964c14 Mon Sep 17 00:00:00 2001 From: PhilipDeFraties Date: Thu, 26 Oct 2023 11:22:09 -0600 Subject: [PATCH 3/3] add tags for `shared/_signed_resource` and `_replaceImagePlaceholdersOnLoad` --- app/views/users/show.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index ba872cced..c0f3aedfa 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,3 +1,7 @@ +<% provide :head_tags do %> + <%= javascript_include_tag 'shared/_signed_resource' %> + <%= javascript_include_tag '_replaceImagePlaceholdersOnLoad', 'data-turbolinks-track': 'reload' %> +<% end %>