Have keyboard_shortcuts use Discourse.TopicView.jumpToPost

Instead of _scrollList, which is more appropriate on the topic list.
This commit is contained in:
riking 2014-02-17 16:33:55 -08:00
parent ebb001c24a
commit 19922ff174

View file

@ -127,7 +127,13 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
if ($article.size() > 0) { if ($article.size() > 0) {
$articles.removeClass('selected'); $articles.removeClass('selected');
$article.addClass('selected'); $article.addClass('selected');
var rgx = new RegExp("post-cloak-(\\d+)").exec($article.parent()[0].id);
if (rgx === null || typeof rgx[1] === 'undefined') {
this._scrollList($article); this._scrollList($article);
} else {
Discourse.TopicView.jumpToPost(rgx[1]);
}
} }
}, },