mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
feat: add admonitions
This commit is contained in:
17
assets/js/print-support.js
Normal file
17
assets/js/print-support.js
Normal file
@@ -0,0 +1,17 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
var closedDetails = [];
|
||||
window.addEventListener('beforeprint', function() {
|
||||
var allDetails = document.querySelectorAll('details:not([open])');
|
||||
for (var i = 0; i < allDetails.length; i++) {
|
||||
allDetails[i].open = true;
|
||||
closedDetails.push(allDetails[i]);
|
||||
}
|
||||
});
|
||||
window.addEventListener('afterprint', function() {
|
||||
for (var i = 0; i < closedDetails.length; i++) {
|
||||
closedDetails[i].open = false;
|
||||
}
|
||||
closedDetails = [];
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user