diff --git a/core/client/routes/posts.js b/core/client/routes/posts.js index 1d3539d5b4..0e1782dd43 100644 --- a/core/client/routes/posts.js +++ b/core/client/routes/posts.js @@ -31,7 +31,7 @@ var PostsRoute = AuthenticatedRoute.extend(ShortcutsRoute, styleBody, loadingInd }, actions: { openEditor: function (post) { - this.transitionTo('editor', post); + this.transitionTo('editor.edit', post); }, moveUp: function () { window.alert('@todo keyboard post navigation: up'); diff --git a/core/client/routes/posts/post.js b/core/client/routes/posts/post.js index a85d0d89c8..9a66227213 100644 --- a/core/client/routes/posts/post.js +++ b/core/client/routes/posts/post.js @@ -1,7 +1,8 @@ import AuthenticatedRoute from 'ghost/routes/authenticated'; import loadingIndicator from 'ghost/mixins/loading-indicator'; +import ShortcutsRoute from 'ghost/mixins/shortcuts-route'; -var PostsPostRoute = AuthenticatedRoute.extend(loadingIndicator, { +var PostsPostRoute = AuthenticatedRoute.extend(loadingIndicator, ShortcutsRoute, { model: function (params) { var self = this, post, @@ -33,6 +34,14 @@ var PostsPostRoute = AuthenticatedRoute.extend(loadingIndicator, { return self.transitionTo('posts.index'); }); }, + shortcuts: { + 'ctrl+e, command+e': 'openEditor' + }, + actions: { + openEditor: function () { + this.transitionTo('editor.edit', this.get('controller.model')); + } + } }); export default PostsPostRoute; diff --git a/core/client/views/post-item-view.js b/core/client/views/post-item-view.js index 7b1add7cf4..933c16f2ee 100644 --- a/core/client/views/post-item-view.js +++ b/core/client/views/post-item-view.js @@ -6,13 +6,12 @@ var PostItemView = itemView.extend({ isFeatured: Ember.computed.alias('controller.model.featured'), isPage: Ember.computed.alias('controller.model.page'), - - // WIP for #2308 - /* - openEditor: function () { - this.get('controller').send('openEditor', this.get('controller.model')); // send action to handle transition to editor route - }.on('doubleClick') - */ + + //Edit post on double click + doubleClick: function () { + this.get('controller').send('openEditor', this.get('controller.model')); + } + }); export default PostItemView;