From aa901a52b4c9649e3bdfbf20ee81521a2dfdadc5 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Thu, 5 Oct 2023 08:02:31 -0700 Subject: [PATCH] :bug: font inputs rendered twice fix In the Settings > Appearance> Font tab, the input fields for body and header fonts were getting rendered twice. We had duplicate code in two different files that called fontselect() on both elements. Because JS was getting called twice, two input fields were displayed. Removing one of them resolves the issue. Issue: - https://github.com/scientist-softserv/adventist-dl/issues/590 --- app/assets/javascripts/admin_font_select.js | 6 ------ app/assets/javascripts/application.js | 1 - 2 files changed, 7 deletions(-) delete mode 100644 app/assets/javascripts/admin_font_select.js diff --git a/app/assets/javascripts/admin_font_select.js b/app/assets/javascripts/admin_font_select.js deleted file mode 100644 index 7fa065108..000000000 --- a/app/assets/javascripts/admin_font_select.js +++ /dev/null @@ -1,6 +0,0 @@ -Blacklight.onLoad(function() { - if($("#admin_appearance_body_font").length > 0){ - $("#admin_appearance_body_font").fontselect({lookahead: 20}); - $("#admin_appearance_headline_font").fontselect({lookahead: 20}); - } -}); diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index fe1ce9b26..df9e83c18 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -25,7 +25,6 @@ //= require tether // Required by Blacklight //= require blacklight/blacklight -//= require admin_font_select // Moved the Hyku JS *above* the Hyrax JS to resolve #1187 (following // a pattern found in ScholarSphere)