From ecf9a0720e7d422c75854bd4b60e992b019066df Mon Sep 17 00:00:00 2001 From: lefuturiste Date: Sun, 26 Jul 2020 13:35:03 +0000 Subject: [PATCH] feat: add lazy loading of card on home page feat: add universal organization store fix: optimization for JSON data loaded in home page HTML --- assets/development/scripts/home.js | 158 ++++++++++++++---- assets/production/scripts/home.js | 2 +- assets/production/styles/organization.css | 2 +- src/MediaService.ts | 8 +- src/app.ts | 1 - .../AdminOrganizationController.ts | 96 ++++++----- src/controllers/PublicController.ts | 34 ++-- views/home.twig | 10 +- 8 files changed, 224 insertions(+), 87 deletions(-) diff --git a/assets/development/scripts/home.js b/assets/development/scripts/home.js index 5eaacd8..40252ad 100644 --- a/assets/development/scripts/home.js +++ b/assets/development/scripts/home.js @@ -1,3 +1,6 @@ +/** + * Nav management + */ let navOpened = false; let oldNavText = ""; let oldNavIcon = ""; @@ -9,6 +12,7 @@ let navContent = document.getElementById('nav-content'); let mosaic = document.getElementById('mosaic'); let mosaicHeader = document.getElementById('mosaic-header'); +let tags = [] navEnabler.onclick = async () => { if (!navOpened) { @@ -34,6 +38,9 @@ function createEl(className = false, elName = "div") { return el; } +/** + * Render + */ function renderNavItem(tag) { /* @@ -72,7 +77,8 @@ {% block scripts %}