mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
77941275ed
Closes #3110 - Created `ApplicationView` - Added `js-close-sidebar` classes to navbar navigation links - Clicking on a navigation link in the sidebar will close it
20 lines
663 B
JavaScript
20 lines
663 B
JavaScript
import {responsiveAction} from 'ghost/utils/mobile-utils';
|
|
|
|
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');
|
|
});
|
|
});
|
|
// #### Navigating within the sidebar closes it.
|
|
$('.js-close-sidebar').on('click', function () {
|
|
body.removeClass('off-canvas');
|
|
});
|
|
}.on('didInsertElement')
|
|
});
|
|
|
|
export default ApplicationView;
|