From 320eb86dc2f3297b06ab5f017b7d5156a604e6ef Mon Sep 17 00:00:00 2001 From: Ridhwana Date: Fri, 30 Apr 2021 13:01:55 +0200 Subject: [PATCH] RFC 50: Interaction tweaks (take two) (#13576) * feat: add the collapse style css + a script for the intercepting the bootstrap event * chore: remove old code * Add some guards for missing elements and simplify show/hide collapse interaction * Update app/assets/stylesheets/admin.scss Co-authored-by: rhymes Co-authored-by: rhymes --- app/assets/stylesheets/admin.scss | 6 ++++ .../controllers/sidebar_controller.test.js | 11 ++------ .../admin/controllers/sidebar_controller.js | 28 ++++++++----------- .../admin/shared/_nested_sidebar.html.erb | 16 +++++++++-- 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index cdc1684d3..5978296e2 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -235,4 +235,10 @@ label { list-style: none; padding: 0; } + // override the Bootstrap collapse animation + .collapsing { + -webkit-transition: none; + transition: none; + display: none; + } } diff --git a/app/javascript/admin/__tests__/controllers/sidebar_controller.test.js b/app/javascript/admin/__tests__/controllers/sidebar_controller.test.js index 1c3aaeedc..785a837c3 100644 --- a/app/javascript/admin/__tests__/controllers/sidebar_controller.test.js +++ b/app/javascript/admin/__tests__/controllers/sidebar_controller.test.js @@ -23,7 +23,7 @@ describe('SidebarController', () => { Advanced -