Skip to content

Commit

Permalink
Better JS file orgnization for PNI (#12700)
Browse files Browse the repository at this point in the history
* Better JS file orgnization for PNI

* moved pni-mobile-nav.js and renamed it to mobile-category-nav.js
  • Loading branch information
mmmavis committed Aug 21, 2024
1 parent f185c0f commit dda5f64
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions source/js/buyers-guide/bg-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import injectMultipageNav from "../multipage-nav.js";

import primaryNav from "../primary-nav.js";

import HomepageSlider from "./homepage-c-slider.js";
import NewsletterBox from "./newsletter-box.js";
import HomepageSlider from "./template-js-handler/homepage-c-slider.js";
import NewsletterBox from "./template-js-handler/newsletter-box.js";
import PNIMobileCategoryNav from "./template-js-handler/mobile-category-nav.js";
import AnalyticsEvents from "./analytics-events.js";
import initializeSentry from "../common/sentry-config.js";
import PNIMobileNav from "./pni-mobile-nav.js";

// Initializing component a11y browser console logging
if (process.env.NODE_ENV === "development") {
Expand Down Expand Up @@ -78,7 +78,7 @@ let main = {
Promise.all(apps).then(() => {
document.body.classList.add(`react-loaded`);
this.initPageSpecificScript();
PNIMobileNav.init();
PNIMobileCategoryNav.init();
// bind custom analytics only once everything's up and loaded
// Analytics events does give errors quite often, do not add JS after this
AnalyticsEvents.init();
Expand Down
2 changes: 1 addition & 1 deletion source/js/buyers-guide/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { injectReactComponents } from "./inject-react";
export { bindEventHandlers } from "./template-js-handler";
import injectProductTabs from "./product-tab.js";
import injectProductTabs from "./template-js-handler/product-tab.js";

injectProductTabs();
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CREEPINESS_LABELS from "./components/creepiness-labels.js";
import CREEPINESS_LABELS from "../components/creepiness-labels.js";

/**
* Logic to render the "Creep-O-Meter" face at the bottom right of the PNI homepage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* If the navigation menu button is clicked, open the navigation panel.
*/

const PNIMobileNav = {
const PNIMobileCategoryNav = {
init: () => {
const mobileNav = document.querySelector("#pni-mobile-category-nav");

Expand All @@ -17,4 +17,4 @@ const PNIMobileNav = {
},
};

export default PNIMobileNav;
export default PNIMobileCategoryNav;
File renamed without changes.
File renamed without changes.

0 comments on commit dda5f64

Please sign in to comment.