Skip to content

Instantly share code, notes, and snippets.

@jacekkopecky
Created May 20, 2021 16:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacekkopecky/f4110f8ac22d98a1e08e39f53a55be23 to your computer and use it in GitHub Desktop.
Save jacekkopecky/f4110f8ac22d98a1e08e39f53a55be23 to your computer and use it in GitHub Desktop.
Custom javascript for github.com projects: In GitHub project boards, double click on a card, or select a card and press 'e' to edit it.
// double click on a card, or select a card and press e, to edit it
document.addEventListener('keyup', (e) => {
if (e.key === 'e' && document.activeElement?.classList.contains('project-card')) {
const buttons = document.activeElement.querySelectorAll('details button[role=menuitem]');
for (const btn of buttons) {
if (btn.textContent === 'Edit note') btn.click();
}
}
});
document.addEventListener('dblclick', (e) => {
if (document.activeElement?.classList.contains('project-card')) {
const buttons = document.activeElement.querySelectorAll('details button[role=menuitem]');
for (const btn of buttons) {
if (btn.textContent === 'Edit note') btn.click();
}
}
});
@jacekkopecky
Copy link
Author

Btw, I use this Chrome extension for inserting custom JS.

@Lipen
Copy link

Lipen commented Aug 25, 2021

Thanks!
Works nicely, I've used Tampermonkey extension.

@pga61
Copy link

pga61 commented Jan 25, 2022

+1 Thanks! nice add-on shortcut 👍

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