Skip to content

Commit 94f83c9

Browse files
committed
Github-toggle-expanders: use Ctrl+Shift+Click to toggle all blocks on the page
1 parent 4117daf commit 94f83c9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

github-toggle-expanders.user.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
(() => {
1515
"use strict";
1616

17-
function toggle(el) {
17+
function toggle(el, ctrlKeyPressed) {
1818
const stateNode = closest(".js-details-container", el),
1919
state = stateNode.classList.contains("open"),
20-
parentNode = closest(
20+
parentNode = closest(ctrlKeyPressed ?
21+
".container" :
2122
".commits-listing, .discussion-item-body, .release-timeline-tags",
2223
stateNode
2324
),
@@ -46,7 +47,7 @@
4647
) {
4748
// give GitHub time to add the class
4849
setTimeout(() => {
49-
toggle(target);
50+
toggle(target, event.ctrlKey);
5051
}, 100);
5152
}
5253
});

0 commit comments

Comments
 (0)