Skip to content

Instantly share code, notes, and snippets.

@jacekkopecky
Created May 20, 2021 16:47
Show Gist options
  • 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();
}
}
});
@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