Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

landing-page: Fix flickering sidebar transition upon resizing.

Eeshan Gargf2d58f1d5da1
diff --git a/static/js/portico/landing-page.js b/static/js/portico/landing-page.js
index f8f736aa167..2918748499f 100644
--- a/static/js/portico/landing-page.js
+++ b/static/js/portico/landing-page.js
@@ -168,7 +168,13 @@ const events = function () {
const $e = $(e.target);
if ($e.is("nav ul .exit")) {
- $("nav ul").removeClass("show");
+ $("nav ul").css("transform", "translate(-350px, 0)");
+ // See https://ishadeed.com/article/layout-flickering/ for
+ // more context as to why the following timeout is important.
+ setTimeout(() => {
+ $("nav ul").removeClass("show");
+ $("nav ul").css("transform", "");
+ }, 500);
}
if ($("nav ul.show") && !$e.closest("nav ul.show").length && !$e.is("nav ul.show")) {
diff --git a/static/styles/portico/landing_page.css b/static/styles/portico/landing_page.css
index 830f30acd68..737cafaf77d 100644
--- a/static/styles/portico/landing_page.css
+++ b/static/styles/portico/landing_page.css
@@ -3618,12 +3618,11 @@ nav {
box-shadow: 0 0 80px hsla(0, 0%, 0%, 0.12);
- transition: all 0.5s ease;
-
overflow-y: auto;
&.show {
transform: translate(0, 0);
+ transition: all 0.5s ease;
}
.exit {