Skip to content

Add button to PR diff file view for expanding/collapsing all files - #308

Closed
antiguab wants to merge 2 commits into
refined-github:masterfrom
antiguab:add-file-diff-collapse-expand-button
Closed

antiguab wants to merge 2 commits into
refined-github:masterfrom
antiguab:add-file-diff-collapse-expand-button

Conversation

@antiguab

Copy link
Copy Markdown

Helps with really big PRs where I only need to see one or two files out of 20.

@hkdobrev

hkdobrev commented Sep 27, 2016 •

Copy link
Copy Markdown
Contributor

Background:

Said that, they could of course be considered again if people want them. I personally don't find much gain in them as I often use the file switcher at the top.

@antiguab

Copy link
Copy Markdown
Author

I found it useful, but I can see it the other way too!

@sindresorhus

Copy link
Copy Markdown
Member

@antiguab I'm willing to add it again if you can commit to maintaining it?

@sindresorhus sindresorhus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add it to the Highlights section in the readme.

const collapseExpandButton = $(`<a class="btn btn-sm BtnGroup-item tooltipped tooltipped-s collapse-expand-btn" aria-label="Collapse All Files"></a>`).html('Collapse All');
collapseExpandButton.data('state', 'collapseAll');

$('.pr-review-tools').prepend($(`<div class="diffbar-item"></div>`).append(collapseExpandButton));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to use template literals here.


$(file).toggleClass('refined-github-minimized');
} else {
// expand all

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indent

@sindresorhus sindresorhus changed the title added button/functionality to PR diff file view for expanding and collapsing all files Add button to PR diff file view for expanding/collapsing all files Oct 3, 2016
@sindresorhus

Copy link
Copy Markdown
Member

I'm willing to add it again if you can commit to maintaining it?

Silence is answer enough. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants