Skip to content

Commit

Permalink
Let users disable hiding some newsfeed events (refined-github#988)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored and sindresorhus committed Jan 17, 2018
1 parent 961a924 commit 9d37a8a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ added someone as a collaborator
forked a repo
followed someone
*/
.news .push,
.news .fork,
.news .follow {
.rgh-no-useless-events .push,
.rgh-no-useless-events .fork,
.rgh-no-useless-events .follow {
display: none !important;
}

Expand Down
2 changes: 2 additions & 0 deletions source/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import extendDiffExpander from './features/extend-diff-expander';
import sortIssuesByUpdateTime from './features/sort-issues-by-update-time';
import makeDiscussionSidebarSticky from './features/make-discussion-sidebar-sticky';
import shortenLinks from './features/shorten-links';
import hideUselessNewsfeedEvents from './features/hide-useless-newsfeed-events';

import * as pageDetect from './libs/page-detect';
import {observeEl, safeElementReady, enableFeature} from './libs/utils';
Expand Down Expand Up @@ -88,6 +89,7 @@ async function init() {

if (pageDetect.isDashboard()) {
enableFeature(moveAccountSwitcherToSidebar);
enableFeature(hideUselessNewsfeedEvents);
}

if (pageDetect.isRepo()) {
Expand Down
5 changes: 5 additions & 0 deletions source/features/hide-useless-newsfeed-events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import select from 'select-dom';

export default function () {
select('.news').classList.add('rgh-no-useless-events');
}

0 comments on commit 9d37a8a

Please sign in to comment.