2014-07-13 21:03:48 +04:00
|
|
|
import {responsiveAction} from 'ghost/utils/mobile';
|
2014-07-07 18:55:22 +04:00
|
|
|
|
|
|
|
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;
|