mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 19:52:01 +03:00
14f29f5139
Closes #3254, closes #3138, closes #3245 ### Settings Routing and View refactoring - Refactored `SettingsView` to handle transitions between mobile and desktop layouts - `SettingsRoute` will only transition to `settings.general` if the screen is large enough to show both the menu and the content - Added `SettingsIndexView` to handle showing the settings menu on mobile screens - Added `SettingsContentBaseView` to be inherited by any settings view that is not index. - Updated Settings templates appropriately to work with new views - Removed extraneous `active` class from `settings-content` - Changed settings menu to use `gh-activating-list-item` - Retooled settings tests ### Mobile Utils - Renamed file to `mobile.js`, since it's inside of `utils/` - Added `mobileQuery` MediaQueryList to help detect layout changes - Removed unused `hasTouchScreen`, `device.js` should be used instead. - Removed unused `smallScreen` function - Moved FastClickInit to codemirror-mobile
21 lines
657 B
JavaScript
21 lines
657 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');
|
|
});
|
|
});
|
|
// #### Navigating within the sidebar closes it.
|
|
$('.js-close-sidebar').on('click', function () {
|
|
body.removeClass('off-canvas');
|
|
});
|
|
}.on('didInsertElement')
|
|
});
|
|
|
|
export default ApplicationView;
|