0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Add Gmail-style shortcuts

Ref #3940
- add `j`/`k` for navigating posts down / up
- `c` for opening a new post
-  `o` to open the selected post
- update keymaster dep to allow for multiple key unbinds (`key.unbind('up, j')`)
This commit is contained in:
Matt Enlow 2014-09-21 10:31:40 -06:00
parent 2f986160fd
commit 40846bc490
3 changed files with 8 additions and 4 deletions

View file

@ -16,7 +16,7 @@
"jquery-file-upload": "9.5.6",
"jquery-hammerjs": "1.0.1",
"jquery-ui": "1.10.4",
"keymaster": "git://github.com/madrobby/keymaster#0f09fc1b7e66c2b7e07afe89a419366dcf2d1cd8",
"keymaster": "git://github.com/madrobby/keymaster#564ea42e07de40da8113a571f17ceae8802672ff",
"loader.js": "git://github.com/stefanpenner/loader.js#1.0.0",
"lodash": "2.4.1",
"moment": "2.4.0",

View file

@ -56,10 +56,14 @@ var PostsRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, Shortcut
},
shortcuts: {
'up': 'moveUp',
'down': 'moveDown'
'up, k': 'moveUp',
'down, j': 'moveDown',
'c': 'newPost'
},
actions: {
newPost: function () {
this.transitionTo('editor.new');
},
moveUp: function () {
this.stepThroughPosts(-1);
},

View file

@ -55,7 +55,7 @@ var PostsPostRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, load
},
shortcuts: {
'enter': 'openEditor',
'enter, o': 'openEditor',
'command+backspace, ctrl+backspace': 'deletePost'
},
actions: {