This is an automated email from the ASF dual-hosted git repository.

kamilbregula pushed a commit to branch aip-11
in repository https://gitbox.apache.org/repos/asf/airflow-site.git


The following commit(s) were added to refs/heads/aip-11 by this push:
     new 035a3e2  Simplify drawer code (#118)
035a3e2 is described below

commit 035a3e236bd6ced00e18b2acaee7b3692b80b151
Author: Kamil BreguĊ‚a <[email protected]>
AuthorDate: Tue Nov 5 22:17:03 2019 +0100

    Simplify drawer code (#118)
---
 landing-pages/src/js/drawer.js | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/landing-pages/src/js/drawer.js b/landing-pages/src/js/drawer.js
index 39e6043..13eaa2e 100644
--- a/landing-pages/src/js/drawer.js
+++ b/landing-pages/src/js/drawer.js
@@ -22,15 +22,9 @@ const toggleDrawer = () => {
   const hamburgerIcon = window.document.querySelector("#hamburger-icon");
   const closeIcon = window.document.querySelector("#close-icon");
 
-  if (drawer.classList.contains("navbar__drawer--open")) {
-    drawer.classList.remove("navbar__drawer--open");
-    hamburgerIcon.classList.add("visible");
-    closeIcon.classList.remove("visible");
-  } else {
-    drawer.classList.add("navbar__drawer--open");
-    hamburgerIcon.classList.remove("visible");
-    closeIcon.classList.add("visible");
-  }
+  drawer.classList.toggle("navbar__drawer--open");
+  hamburgerIcon.classList.toggle("visible");
+  closeIcon.classList.toggle("visible");
 };
 
 
window.document.querySelector("#navbar-toggle-button").addEventListener("click",
 toggleDrawer);

Reply via email to