0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/mixins/editor-route-base.js

26 lines
739 B
JavaScript
Raw Normal View History

import ShortcutsRoute from 'ghost/mixins/shortcuts-route';
import styleBody from 'ghost/mixins/style-body';
var EditorRouteBase = Ember.Mixin.create(styleBody, ShortcutsRoute, {
shortcuts: {
'ctrl+s, command+s': 'save',
'ctrl+alt+p': 'publish',
'ctrl+alt+z': 'toggleZenMode'
},
actions: {
save: function () {
this.get('controller').send('save');
},
publish: function () {
var controller = this.get('controller');
controller.send('setSaveType', 'publish');
controller.send('save');
},
toggleZenMode: function () {
Ember.$('body').toggleClass('zen');
}
}
});
export default EditorRouteBase;