Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hide-disabled-milestone-sorter feature #1980

Merged
merged 9 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ GitHub Enterprise is also supported. More info in the options.
- [Tall code blocks and quotes are limited in height.](https://github.com/sindresorhus/refined-github/issues/1123)
- [Forks and watchers counters are hidden.](https://user-images.githubusercontent.com/1402241/53681077-f3328b80-3d1e-11e9-9e29-2cb017141769.png)
- [Diff signs are hidden.](https://user-images.githubusercontent.com/1402241/54807718-149cec80-4cb9-11e9-869c-e265863211e3.png)
- [Hide disabled milestone sorter.](https://user-images.githubusercontent.com/7753001/56913933-738a2880-6ae5-11e9-9d13-1973cbbf5df0.png)
kevin940726 marked this conversation as resolved.
Show resolved Hide resolved


### UI improvements

Expand Down
1 change: 1 addition & 0 deletions source/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import './features/raw-file-link';
import './features/tags-dropdown';
import './features/filter-pr-by-build-status';
import './features/edit-files-faster';
import './features/hide-disabled-milestone-sorter';

import './features/scrollable-code-and-blockquote.css';
import './features/center-reactions-popup.css';
Expand Down
22 changes: 22 additions & 0 deletions source/features/hide-disabled-milestone-sorter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import select from 'select-dom';
import features from '../libs/features';
import observeEl from '../libs/simplified-element-observer';

function hide(): void {
for (const icon of select.all('[aria-label="You do not have permission to edit this milestone."]')) {
icon.parentElement!.remove();
}
}

function init(): void {
observeEl('.js-milestone-issues-container', hide);
}

features.add({
id: 'hide-disabled-milestone-sorter',
include: [
features.isMilestone
],
load: features.onAjaxedPages,
init
});