danielwelch / hassio-zigbee2mqtt

Hass.io add-on for zigbee2mqtt
Apache License 2.0
566 stars 189 forks source link

Menu button mobile #476

Closed djansen1987 closed 3 years ago

djansen1987 commented 3 years ago

zigbee2mqtt add-on version (if edge, please report commit hash): 1.16.1 Operating environment (HassOS, Virtual Machine, Device/platform running Home Assistant):

Version 0.118.0
Installation Type Home Assistant OS
Development false
Supervisor true
Docker true
Virtual Environment false
Python Version 3.8.6
Operating System Family Linux
Operating System Version 5.4.77
CPU Architecture x86_64
Timezone Europe/Amsterdam

Description of problem: When opening the zigbee2mqqt web portal on mobile and opening the menu using the hamburger icon. It will not go away after clicking on an menu item. Resulting in a page which is not readable

image

My advise would be to add some jquery or javascript to handle this. Quick draw:

Javascript:

var menu = document.getElementsByClassName("navbar-collapse");

var menuitems = document.getElementsByClassName("nav-item");

function hidemenu(){
  menu[0].classList.remove("show");
}
for (var i = 0; i < menuitems.length; i++) {
  menuitems[i].addEventListener('click', hidemenu, false);
}

Jquery:

$(".navbar-toggler.nav-item").click(function(){
  $(".navbar-collapse").removeClass("show") 
})

Your entire configuration from the frontend (with sensitive fields redacted): N/A

Your logs from Home Assistant

N/A

ciotlosm commented 3 years ago

You opened on the same repo which is the add-on. This is repo is handling mostly problems with home assistant integration on the supervisor and some configuration features. Problems with the code inside Z2m should be under issues the top part: https://github.com/Koenkk/zigbee2mqtt/issues/new/choose

Screenshot 2020-11-22 at 16 55 02

djansen1987 commented 3 years ago

Hi,

The problem is within the addon, so i am probably at the right place now ? I am willing to help but this is the second time i am being send away, and losing my willingness to help.

ciotlosm commented 3 years ago

@djansen1987 I'm just trying to redirect you to the right place to get the issue reviewed and maybe more help.

The idea is that https://github.com/danielwelch/hassio-zigbee2mqtt is the add-on repo that bundles code from: https://github.com/Koenkk/zigbee2mqtt.

The actual frontend code is loaded as a module from: https://github.com/nurikk/z2m-frontend

Your bug is related to the actual frontend code in https://github.com/nurikk/z2m-frontend but it is recommended to keep issues on the main repo https://github.com/Koenkk/zigbee2mqtt.

Recommending a bug fix for JS code in this repo won't help much as this is mostly bash and Dockerfile code being just a wrapper for the above repos.

As visible here: https://github.com/danielwelch/hassio-zigbee2mqtt/blob/master/zigbee2mqtt/Dockerfile#L13 we just package whatever comes from a release zip file in https://github.com/Koenkk/zigbee2mqtt.

Also the frontend is packaged here: https://github.com/Koenkk/zigbee2mqtt/blob/master/package.json#L57

NavBar code you will find here: https://github.com/nurikk/z2m-frontend/blob/8bcab79722f1070da561392a72aa812e26cec270/src/components/navbar/index.tsx#L79 so code fixes must be done using React I assume.

djansen1987 commented 3 years ago

@ciotlosm Thanks for taking the time to explain, what a hard way to maintain the project. But now i can understand your response. I will give it 1 last at the frontend guys