0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00

Merge pull request #4169 from halfdan/tap-close

Close mobile menu on tap.
This commit is contained in:
Hannah Wolfe 2014-09-25 18:18:26 +01:00
commit 32a06f0458

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);