Skip to content

Commit

Permalink
[overview] Ask which slides to include, not which slides to NOT inclu…
Browse files Browse the repository at this point in the history
…de (and don't require `.slide`)
  • Loading branch information
LeaVerou committed Aug 13, 2024
1 parent a23a233 commit 9f38fac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/overview/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ Inspire.hooks.add({
exitOverview();
}
else if (env.letter === "H" && (evt.ctrlKey || evt.altKey)) {
let defaultSelector = enteredSelector || (headersOnly? ".slide:not(header):not(:target)" : "");
let selector = prompt("Which slides to filter out? Enter a compound selector, or leave empty to show all slides.", defaultSelector);
let defaultSelector = enteredSelector || (headersOnly? "header, :target" : "");
let selector = prompt("Which slides to include? Enter a CSS selector, or leave empty to show all slides.", defaultSelector);

document.querySelector("style#inspire-overview-filter")?.remove();

if (selector) {
let style = document.createElement("style");
style.id = "inspire-overview-filter";
style.textContent = `.show-thumbnails ${selector} {
style.textContent = `.show-thumbnails .slide:not(${selector}) {
display: none !important;
}`;
document.head.append(style);
Expand Down

0 comments on commit 9f38fac

Please sign in to comment.