From 77941275ed889bc98417aa6f57efb52907be6b93 Mon Sep 17 00:00:00 2001 From: Matt Enlow Date: Mon, 7 Jul 2014 08:55:22 -0600 Subject: [PATCH] Fix mobile sidebar menu Closes #3110 - Created `ApplicationView` - Added `js-close-sidebar` classes to navbar navigation links - Clicking on a navigation link in the sidebar will close it --- core/client/routes/application.js | 13 ------------- core/client/templates/-navbar.hbs | 6 +++--- core/client/utils/mobile-utils.js | 2 +- core/client/views/application.js | 20 ++++++++++++++++++++ 4 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 core/client/views/application.js diff --git a/core/client/routes/application.js b/core/client/routes/application.js index be5d8703f5..6e24038f29 100644 --- a/core/client/routes/application.js +++ b/core/client/routes/application.js @@ -1,23 +1,10 @@ import ShortcutsRoute from 'ghost/mixins/shortcuts-route'; -import mobileUtils from 'ghost/utils/mobile-utils'; var ApplicationRoute = Ember.Route.extend(Ember.SimpleAuth.ApplicationRouteMixin, ShortcutsRoute, { shortcuts: { 'esc': 'closePopups' }, - mobileInteractions: function () { - var responsiveAction = mobileUtils.responsiveAction; - - Ember.run.scheduleOnce('afterRender', document, function () { - // ### Toggle the sidebar menu - $('[data-off-canvas]').on('click', function (event) { - responsiveAction(event, '(max-width: 650px)', function () { - $('body').toggleClass('off-canvas'); - }); - }); - }); - }.on('init'), setupController: function () { Ember.run.next(this, function () { diff --git a/core/client/templates/-navbar.hbs b/core/client/templates/-navbar.hbs index 73451979ec..3a2d3dc9fd 100644 --- a/core/client/templates/-navbar.hbs +++ b/core/client/templates/-navbar.hbs @@ -4,9 +4,9 @@