From c3eab22b4e54356e535118d5f1ae9a312426f828 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Wed, 13 Mar 2024 21:38:45 -0700 Subject: [PATCH] Downgrade jQuery on homepage to be the same version as everywhere else I noticed an issue where Turbo-loading between the Your Items page and the homepage would clobber each other's copy of jQuery, breaking things sometimes. e.g. go to Your Items, then go to home, then go to Your Items, and the page's JS fails because `$.fn.live` isn't defined. I briefly tested the homepage and it didn't seem to actually depend on any features from the later version of jQuery? At least not that I noticed! So I'll just downgrade for consistency. (I also tried upgrading the Your Items page, but there's too much usage of `$.fn.live`, which is replaced with a notably different syntax in jQuery 2.0+.) --- app/helpers/application_helper.rb | 1 - app/views/outfits/new.html.haml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 21e10c96..73a9cf9c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -108,7 +108,6 @@ module ApplicationHelper JAVASCRIPT_LIBRARIES = { :jquery => 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js', - :jquery20 => 'https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js', :jquery_tmpl => 'https://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js', } diff --git a/app/views/outfits/new.html.haml b/app/views/outfits/new.html.haml index 5f915c00..1ed13e6f 100644 --- a/app/views/outfits/new.html.haml +++ b/app/views/outfits/new.html.haml @@ -123,7 +123,7 @@ = t '.preview.pet_not_found' - content_for :javascripts do - = include_javascript_libraries :jquery20, :jquery_tmpl + = include_javascript_libraries :jquery, :jquery_tmpl = javascript_include_tag 'ajax_auth', 'lib/jquery.timeago', defer: true - content_for :javascripts_body do