mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-16 20:43:01 +03: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
21 lines
663 B
JavaScript
21 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;
|