You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by ey...@apache.org on 2021/02/09 20:55:51 UTC
[incubator-age] 07/18: Tweak menu handling
This is an automated email from the ASF dual-hosted git repository.
eya pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-age.git
commit 3791be5511bb06caafa587e61ec77571a2f1bee0
Author: Nick Sorrell <ni...@cint.io>
AuthorDate: Tue Dec 1 15:53:00 2020 -0500
Tweak menu handling
---
assets/scripts/index.js | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/assets/scripts/index.js b/assets/scripts/index.js
index b0b630d..31f7d9e 100644
--- a/assets/scripts/index.js
+++ b/assets/scripts/index.js
@@ -1,7 +1,7 @@
var handleClick = function (el) {
decorateSidebar(el);
showMainContent(el);
- handleMenuClick();
+ if (menuIsVisible()) handleMenuClick();
}
var decorateSidebar = function (el) {
@@ -21,6 +21,15 @@ var showMainContent = function (el) {
document.getElementById(divId).classList.add("main--selected");
}
+var menuIsVisible = function () {
+ let menu = document.getElementById("menu");
+ let display = window.getComputedStyle(menu).display;
+ if (display === "none") {
+ return false;
+ }
+ return true;
+}
+
var handleMenuClick = function (el) {
let sidebar = document.getElementById("sidebar");
let display = window.getComputedStyle(sidebar).display;