Skip to content

Add minimize/maximize buttons and functionality to PRs - #51

Closed
tdlm wants to merge 8 commits into
refined-github:masterfrom
tdlm:add-minimize-maximize-buttons
Closed

tdlm wants to merge 8 commits into
refined-github:masterfrom
tdlm:add-minimize-maximize-buttons

Conversation

@tdlm

@tdlm tdlm commented Mar 2, 2016

Copy link
Copy Markdown
Contributor

This is for #50.

  • Add addMinimizeMaximize function which adds buttons and click listeners for file headers
  • Modify isPr() regex to include all pull request URIs

- Add addMinimizeMaximize function which adds buttons and click listeners for file headers
- Modify isPr() regex to include all pull request URIs
@hkdobrev

hkdobrev commented Mar 2, 2016

Copy link
Copy Markdown
Contributor

@tdlm

tdlm commented Mar 2, 2016

Copy link
Copy Markdown
Contributor Author

@hkdobrev Fixed!

@hkdobrev

hkdobrev commented Mar 2, 2016

Copy link
Copy Markdown
Contributor

Could you add .file-header {cursor: pointer} so it's more visible you can click that?

@hkdobrev

hkdobrev commented Mar 2, 2016

Copy link
Copy Markdown
Contributor

@tdlm

tdlm commented Mar 2, 2016

Copy link
Copy Markdown
Contributor Author

@hkdobrev I took your advice and ran with it using the zoom in/out cursors

tdlm added 2 commits March 2, 2016 15:42
- Add class to parent block rather than individual blocks
- Add custom CSS for hiding block
- Increase area where minimize/maximize action can happen
- Stop propagation on file-actions so it doesn't trigger minimize/maximize
@SpaceK33z

Copy link
Copy Markdown
Contributor

Looking good!

Comment thread extension/content.js Outdated
}

function addMinimizeMaximize() {
if (!$('#toc .refined-github-btn-group').length && $('#toc .btn-group').length) {

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.

Instead of wrapping everything in a if statement it would be better to invert the condition and do a early return instead.

@sindresorhus

Copy link
Copy Markdown
Member

Can you fix the merge conflict?

And add it to the feature list in the readme, linking to this #50.

tdlm added 2 commits March 3, 2016 23:17
- Invert 'if' statement at top of addMinimizeMaximize so that it returns early
- Shortened '<div/>' to '<div>'
- Improve ES6 function syntax
- Improve cursor coverage
…add-minimize-maximize-buttons

# Conflicts:
#	extension/content.js
@sindresorhus

Copy link
Copy Markdown
Member

Super. Thanks for this nice addition @tdlm :)

sindresorhus added a commit that referenced this pull request Mar 6, 2016
@tdlm

tdlm commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

Thanks, guys!

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.

4 participants