Skip to content

Commit

Permalink
fix: open cuts in pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
v8tenko committed Jan 30, 2025
1 parent d5a40c0 commit 0f30e99
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/js/print/cut.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const Selector = {
CUT_ROOT: '.yfm details.yfm-cut',
};

function openCuts() {
document.querySelectorAll(Selector.CUT_ROOT).forEach((element) => {
element.setAttribute('open', 'true');
element.classList.add('open');
});
}

if (typeof document !== 'undefined') {
window.addEventListener('load', () => {
openCuts();
});
}

export {};
1 change: 1 addition & 0 deletions src/js/print/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import './table';
import './cut';

0 comments on commit 0f30e99

Please sign in to comment.