Skip to content

Commit

Permalink
fixes t3framework#555: off canvas menu doen't close on click outside …
Browse files Browse the repository at this point in the history
…menu on iOS

adds touchstart event listeners to the body
  • Loading branch information
level420 authored Aug 16, 2019
1 parent a623a0b commit 69627b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/plg_system_t3/base/js/off-canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand All @@ -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');
Expand Down Expand Up @@ -152,4 +152,4 @@
}
});

}(jQuery);
}(jQuery);

0 comments on commit 69627b4

Please sign in to comment.