Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have an Omega 4.1 subtheme set up, using the off-canvas layout, and all breakpoints are working. One minor issue I have here, though, is needing to double click main menu items when in the desktop or tablet viewport modes. If I'm in the mobile viewport mode, and the menu is off-canvas by default, this doesn't happen. To make sure it wasn't any of my coding, I tried it with the stock layouts supplied with Omega. Still the same issue...
Comments
Comment #1
msmithcti CreditAttribution: msmithcti commentedThanks for reporting this. I will take a look at this as soon as possible!
Comment #2
msmithcti CreditAttribution: msmithcti commentedLooks like the issue is to do with all the events still being fired when at a desktop resoloution which is causing some issues. Working on implementing a fix for this now.
Comment #3
karolus CreditAttribution: karolus commentedThanks--I've been researching it as well, but will admit JS isn't a strong point of mine, but am looking to expand my knowledge in this area...
Comment #4
karolus CreditAttribution: karolus commentedOK--
Looks like I've found a solution--in the JavaScript file for the Off-Canvas layout (omega/layouts/off-canvas.js), I disabled line 10:
e.preventDefault();
After doing this, no more double clicking was required to use the menu bar in desktop and tablet views, and the off-canvas menu for mobile was fully functional. I tested this in Chrome, Firefox, and Safari on Mac. Will give it a spin in BrowserStack tomorrow (specifically for IE), but this appears to have fixed it.
Comment #5
msmithcti CreditAttribution: msmithcti commentedI implemented something similar to what you suggested - but it wasn't on line 10! Take a look at b426a6d to see the fix.
This fix does have the side effect that when the off canvas region is exposed, on clicking a link outside of the off canvas region it will close the off canvas region and then take you to the link. Maybe not ideal, but this is such a simple fix and I don't really want to make that JS file any bigger than it has to be!