summaryrefslogtreecommitdiff
path: root/source/features/open-issue-to-latest-comment.tsx
blob: 8eba0d7f4bdb5ab1637f99abd14deeed2ef1b224 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import select from 'select-dom';
import features from '../libs/features';

function init(): void {
	for (const link of select.all<HTMLAnchorElement>('.js-issue-row a[aria-label*="comment"], .js-pinned-issue-list-item a[aria-label*="comment"]')) {
		link.hash = '#partial-timeline';
	}
}

features.add({
	id: __featureName__,
	description: 'Links the comments icon to the latest comment.',
	screenshot: 'https://user-images.githubusercontent.com/14323370/57962709-7019de00-78e8-11e9-8398-7e617ba7a96f.png',
	include: [
		features.isDiscussionList
	],
	load: features.onAjaxedPages,
	init
});