Ghost/core/client/views/application.js

22 lines
746 B
JavaScript
Raw Normal View History

import {responsiveAction} from 'ghost/utils/mobile';
var ApplicationView = Ember.View.extend({
mobileInteractions: function () {
var body = $('body');
// ### Toggle the mobile sidebar menu
$('[data-off-canvas]').on('click', function (event) {
responsiveAction(event, '(max-width: 650px)', function () {
body.toggleClass('off-canvas');
});
});
$('[data-off-canvas]').attr('href', this.get('controller.ghostPaths.blogRoot'));
// #### Navigating within the sidebar closes it.
$('.js-close-sidebar').on('click', function () {
body.removeClass('off-canvas');
});
}.on('didInsertElement')
});
export default ApplicationView;