FIX: Bookmark by keyboard was broken

This commit is contained in:
Robin Ward 2016-02-08 16:01:09 -05:00
parent 363cf5c5da
commit cd412976d7
2 changed files with 8 additions and 3 deletions

View File

@ -222,10 +222,14 @@ export default {
// TODO: We should keep track of the post without a CSS class
const selectedPostId = parseInt($('.topic-post.selected article.boxed').data('post-id'), 10);
if (selectedPostId) {
const topicController = container.lookup('controller:topic'),
post = topicController.get('model.postStream.posts').findBy('id', selectedPostId);
const topicController = container.lookup('controller:topic');
const post = topicController.get('model.postStream.posts').findBy('id', selectedPostId);
if (post) {
topicController.send(action, post);
// TODO: Use ember closure actions
const result = topicController._actions[action].call(topicController, post);
if (result && result.then) {
this.appEvents.trigger('post-stream:refresh', selectedPostId)
}
}
}
},

View File

@ -170,6 +170,7 @@ export default class Widget {
}
if (target) {
// TODO: Use ember closure actions
const actions = target._actions || target.actionHooks;
const method = actions[actionName];
if (method) {