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

Make PR filenames headings and label the file contents #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SaschaCowley
Copy link

  • Makes the filenames in diff viewers level 2 headings.
  • Moves the filename first, rather than after a bunch of controls for that file.
  • Makes the file contents a region labelled by the filename. Useful when navigating by table rather than by heading.

let headerRow = el.parentElement
let children = Array.from(headerRow.children)
// Filename is the last child of .file-info, make it the first
children.unshift(children.pop())
Copy link
Author

Choose a reason for hiding this comment

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

I tried using Array.prototype.indexOf to find the index of the filename in the parent, then removing it by splicing and unshifting it to the start, but it seriously slowed things down for me. This assumes the filename is the last child of .file-info, which it always seems to be for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant