From 698c09c4898a3876062137ffee88a54baee5b5b5 Mon Sep 17 00:00:00 2001 From: "Umang G. Patel" <23169768+robonetphy@users.noreply.github.com> Date: Thu, 13 Oct 2022 08:30:23 +0530 Subject: [PATCH] Add search to sidebar (#215) * remove package json * twig file modified * search bar style added * the background content added * add the switching b/w the shortcut logo * shortcut for search added * add the arrowup and arrowdown short cut * sidebar search added * keyup and keydown replace with input * the sidebar search selected added * unusal things * the enter evenlister added with search refactring * comments added * the scroll added if element is not visble * metakey added * event listner using shortcut added * the integration for input box completed * nodemon config updated * replace the shortcuts with event listener * bugfix: up height of header added * feat:integrate sidebar toggle with search shortcut * syntax improved * event listener updated * border adjusted * search adjusted * sidebar search navigation adjusted * new search module added * new module integrated * boxshadow added as border * sidebar search class added * sidebar search=>filter * comments added * filter for section added * the expand feature added during navigation * remove the space * header height variable added * shortcut logic updated * enum for direction added * common search function added * expand every match * updated styles * updated styles * margin remove in mobile view with bold removed * clean css added Co-authored-by: Peter Savchenko --- nodemon.json | 2 +- src/backend/controllers/pages.ts | 1 + src/backend/views/components/sidebar.twig | 3 + src/frontend/js/classes/sidebar-filter.js | 364 ++++++++++++++++++++ src/frontend/js/modules/sidebar.js | 30 +- src/frontend/styles/components/sidebar.pcss | 72 +++- src/frontend/svg/search.svg | 4 + 7 files changed, 463 insertions(+), 13 deletions(-) create mode 100644 src/frontend/js/classes/sidebar-filter.js create mode 100644 src/frontend/svg/search.svg diff --git a/nodemon.json b/nodemon.json index 70b8ccc..8c93bb1 100644 --- a/nodemon.json +++ b/nodemon.json @@ -8,5 +8,5 @@ "watch": [ "**/*" ], - "ext": "js,twig" + "ext": "ts,js,twig" } diff --git a/src/backend/controllers/pages.ts b/src/backend/controllers/pages.ts index f5d70df..454f47a 100644 --- a/src/backend/controllers/pages.ts +++ b/src/backend/controllers/pages.ts @@ -291,6 +291,7 @@ class Pages { await alias.destroy(); } const removedPage = page.destroy(); + await PagesFlatArray.regenerate(); return removedPage; diff --git a/src/backend/views/components/sidebar.twig b/src/backend/views/components/sidebar.twig index 28d6131..6a2c0f7 100644 --- a/src/backend/views/components/sidebar.twig +++ b/src/backend/views/components/sidebar.twig @@ -6,6 +6,9 @@