0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Close mobile menu on tap.

fixes #4168
- Listen to tap event
This commit is contained in:
Fabian Becker 2014-09-25 16:33:47 +00:00
parent a0015d65a7
commit 49eea7f6e2

View file

@ -8,14 +8,14 @@ var ApplicationView = Ember.View.extend({
setupGlobalMobileNav: function () {
// #### Navigating within the sidebar closes it.
var self = this;
$('body').on('click', '.js-nav-item', function () {
$('body').on('click tap', '.js-nav-item', function () {
if (mobileQuery.matches) {
self.set('controller.showGlobalMobileNav', false);
}
});
// #### Close the nav if mobile and clicking outside of the nav or not the burger toggle
$('.js-nav-cover').on('click', function () {
$('.js-nav-cover').on('click tap', function () {
var isOpen = self.get('controller.showGlobalMobileNav');
if (isOpen) {
self.set('controller.showGlobalMobileNav', false);