SideBar no close - Mobile / Tablet

2
Hey guys, Alright? hope so! Guys, I would like to know how it is done for the sidebar to go back as soon as a menu item is clicked.. Currently when you open the sidebar and click on a menu item... the page is loaded but it stays open... having to click again on the burger menu to close... Can anybody help me? https://cadastrobasicouf-sandbox.mxapps.io/preview/phone.html?profile=Phone - Mobile https://cadastrobasicouf-sandbox.mxapps.io/preview/tablet.html?profile=Tablet - Tablet Thank you!
asked
4 answers
3

Solution:
 

answered
0

What we have done in the past is added an HTML snippet with JavaScript code to cause the menu to collapse when clicked outside of that element. Note that if you use this method, the menu will close by clicking on anything outside of the menu, such as a popup that has been pulled in from the menu.  Here is some code from Stack Overflow that can help you out. 

 

$('body').click(function(event){
  // check if the clicked element is a descendent of navigation 
  if ($(event.target).closest('.navigation').length) { // replace .navigation with the class of the menu bar
    return; //do nothing if event target is within the navigation
  } else {
  // do something if the event target is outside the navigation
     $('.navigation').collapse() // replace .navigation with the class of the menu bar
  }
});

 

answered
0

Continuation.. 

 

answered
0

With help from Mendix support I learned that if you go to the layout, find the container that has the navigation menu it in, then go the container properties > if you see the toggle mode to "push content aside" then the menu will close after a user clicks on a menu link.

answered