mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 01:22:36 +08:00
Merge pull request #2815 from cpradio/tab-to-first-link-on-post-when-using-keyboard
FIX: j/k place tab focus accordingly so tab will go to the first linked ...
This commit is contained in:
commit
e8bbc147ad
|
@ -233,6 +233,15 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
|||
if ($article.size() > 0) {
|
||||
$articles.removeClass('selected');
|
||||
$article.addClass('selected');
|
||||
|
||||
if ($article.is('.topic-post')) {
|
||||
var tabLoc = $article.find('a.tabLoc');
|
||||
if (tabLoc.length === 0) {
|
||||
tabLoc = $('<a href="#" class="tabLoc"></a>');
|
||||
$article.prepend(tabLoc);
|
||||
}
|
||||
tabLoc.focus();
|
||||
}
|
||||
|
||||
var rgx = new RegExp("post-cloak-(\\d+)").exec($article.parent()[0].id);
|
||||
if (rgx === null || typeof rgx[1] === 'undefined') {
|
||||
|
|
Loading…
Reference in New Issue
Block a user