mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-17 05:21:36 +03:00
e2348e6802
closes #3522 - Previously, the logo had a href attribute which was manually kept from executing on mobile. Slow mobile devices that didn’t fully load the JS would therefore navigate “desktop style” - The href attribute is now set after the event handler has been loaded, ensuring correct navigation behaviour.
22 lines
746 B
JavaScript
22 lines
746 B
JavaScript
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;
|