mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #9357 from jibees/9180-close-mobile-menu-on-click-anywhere
Close menu on click outside the menu and outside the hamburger icon
This commit is contained in:
@@ -26,4 +26,8 @@ angular.module('mm.foundation.offcanvas').directive 'offCanvasWrap', ($window) -
|
||||
# Bind hiding of the off-canvas that only happens when screen width is over 1024px.
|
||||
win.bind 'resize.body', ->
|
||||
isolatedScope.hide() if $(window).width() > 1024
|
||||
|
||||
win.bind 'click.body', (e) ->
|
||||
if e.target.closest(".left-off-canvas-menu") == null && e.target.closest(".left-off-canvas-toggle") == null
|
||||
isolatedScope.hide()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user