Skip to content

Commit 0f30e99

Browse files
committed
fix: open cuts in pdf
1 parent d5a40c0 commit 0f30e99

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/js/print/cut.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const Selector = {
2+
CUT_ROOT: '.yfm details.yfm-cut',
3+
};
4+
5+
function openCuts() {
6+
document.querySelectorAll(Selector.CUT_ROOT).forEach((element) => {
7+
element.setAttribute('open', 'true');
8+
element.classList.add('open');
9+
});
10+
}
11+
12+
if (typeof document !== 'undefined') {
13+
window.addEventListener('load', () => {
14+
openCuts();
15+
});
16+
}
17+
18+
export {};

src/js/print/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
import './table';
2+
import './cut';

0 commit comments

Comments
 (0)