Skip to content

Commit

Permalink
load search when the page loads, rather than when react is done
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomax committed Oct 28, 2021
1 parent 5312002 commit 97ad8a4
Show file tree
Hide file tree
Showing 4 changed files with 359 additions and 349 deletions.
1 change: 1 addition & 0 deletions esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const sources = {
"callpower": `foundation/pages/callpower.js`,
"directory-listing-filters": `foundation/pages/directory-listing-filters.js`,
"bg-main": `buyers-guide/bg-main.js`,
"bg-search": `buyers-guide/search.js`,
polyfills: `polyfills.js`,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{% extends "buyersguide/bg_base.html" %}

{% load env i18n static wagtailimages_tags cache bg_nav_tags %}
{% load static env i18n static wagtailimages_tags cache bg_nav_tags %}

{% block additional_head_elements %}
{{ block.super }}
<script src="{% static "_js/bg-search.compiled.js" %}" async defer></script>
{% endblock %}

{% block bodyclass %}pni catalog{% endblock %}

Expand Down
3 changes: 0 additions & 3 deletions source/js/buyers-guide/bg-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import injectMultipageNav from "../foundation/inject-react/multipage-nav.js";
import primaryNav from "../primary-nav.js";

import HomepageSlider from "./homepage-c-slider.js";
import { SearchFilter, PNIToggle } from "./search.js";
import AnalyticsEvents from "./analytics-events.js";
import initializeSentry from "../common/sentry-config.js";

Expand Down Expand Up @@ -111,8 +110,6 @@ let main = {
initPageSpecificScript() {
if (document.querySelector(`body.pni.catalog`)) {
HomepageSlider.init();
SearchFilter.init();
PNIToggle.init();
}
},
};
Expand Down
Loading

0 comments on commit 97ad8a4

Please sign in to comment.