From 69627b46c9c966766bc5d4f81d7f1d864bc2dc7a Mon Sep 17 00:00:00 2001 From: Dietrich Streifert Date: Fri, 16 Aug 2019 13:50:53 +0200 Subject: [PATCH] fixes #555: off canvas menu doen't close on click outside menu on iOS adds touchstart event listeners to the body --- source/plg_system_t3/base/js/off-canvas.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/plg_system_t3/base/js/off-canvas.js b/source/plg_system_t3/base/js/off-canvas.js index 367d112899..6f969d8ff8 100644 --- a/source/plg_system_t3/base/js/off-canvas.js +++ b/source/plg_system_t3/base/js/off-canvas.js @@ -82,12 +82,12 @@ $(window).on('scroll touchmove', posNav); // hide when click on off-canvas-nav - $('#off-canvas-nav').on ('click', function (e) { + $('#off-canvas-nav').on ('click touchstart', function (e) { e.stopPropagation(); }); //$('#off-canvas-nav a').on ('click', hideNav); - $('body').on ('click', bdHideNav); + $('body').on ('click touchstart', bdHideNav); }, 50); setTimeout (function(){ @@ -105,9 +105,9 @@ } $(window).off('scroll touchmove', posNav); - $('#off-canvas-nav').off ('click'); + $('#off-canvas-nav').off ('click touchstart'); //$('#off-canvas-nav a').off ('click', hideNav); - $('body').off ('click', bdHideNav); + $('body').off ('click touchstart', bdHideNav); $('html').removeClass ('off-canvas-enabled'); $btn.data('off-canvas', 'hide'); @@ -152,4 +152,4 @@ } }); -}(jQuery); \ No newline at end of file +}(jQuery);