|
@@ -91,18 +91,18 @@ const JS_SCRIPT_VIEWSPECS: &str = r##"
|
|
innerElements.forEach(element => {
|
|
innerElements.forEach(element => {
|
|
element.style.display = 'none';
|
|
element.style.display = 'none';
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
zoom_ins.forEach(element => {
|
|
zoom_ins.forEach(element => {
|
|
element.style.display = 'none';
|
|
element.style.display = 'none';
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
zoom_outs.forEach(element => {
|
|
zoom_outs.forEach(element => {
|
|
element.style.display = 'block';
|
|
element.style.display = 'block';
|
|
});
|
|
});
|
|
|
|
|
|
document.getElementById(body_id).style.display = 'block';
|
|
document.getElementById(body_id).style.display = 'block';
|
|
document.getElementById(summary_id).style.display = 'block';
|
|
document.getElementById(summary_id).style.display = 'block';
|
|
-
|
|
|
|
|
|
+
|
|
window.scrollTo(0, 0);
|
|
window.scrollTo(0, 0);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -119,15 +119,15 @@ const JS_SCRIPT_VIEWSPECS: &str = r##"
|
|
innerElements.forEach(element => {
|
|
innerElements.forEach(element => {
|
|
element.style.display = 'none';
|
|
element.style.display = 'none';
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
zoom_ins.forEach(element => {
|
|
zoom_ins.forEach(element => {
|
|
element.style.display = 'block';
|
|
element.style.display = 'block';
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
zoom_outs.forEach(element => {
|
|
zoom_outs.forEach(element => {
|
|
element.style.display = 'none';
|
|
element.style.display = 'none';
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
window.scrollTo(0, 0);
|
|
window.scrollTo(0, 0);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -172,19 +172,26 @@ const JS_SCRIPT_VIEWSPECS: &str = r##"
|
|
const content = window.opener.document.getElementById('content');
|
|
const content = window.opener.document.getElementById('content');
|
|
|
|
|
|
if (blankLinesCheckbox.checked) {
|
|
if (blankLinesCheckbox.checked) {
|
|
- // Restore original <br> elements
|
|
|
|
- window.opener.originalBrElements.forEach(br => {
|
|
|
|
- const parent = br.parentNode;
|
|
|
|
- parent.insertBefore(br.element, parent.children[br.index]);
|
|
|
|
- });
|
|
|
|
- window.opener.originalBrElements = [];
|
|
|
|
|
|
|
|
- // Restore original margins
|
|
|
|
- window.opener.originalStyles.forEach(item => {
|
|
|
|
- item.element.style.marginTop = item.styles.marginTop;
|
|
|
|
- item.element.style.marginBottom = item.styles.marginBottom;
|
|
|
|
- });
|
|
|
|
- window.opener.originalStyles = [];
|
|
|
|
|
|
+ if (window.opener.originalBrElements) {
|
|
|
|
+ window.opener.originalBrElements.forEach(br => {
|
|
|
|
+ const parent = br.parent; // Use the correct parent reference
|
|
|
|
+
|
|
|
|
+ if (parent) { // Ensure parent is defined
|
|
|
|
+ parent.insertBefore(br.element, parent.children[br.index]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ window.opener.originalBrElements = []; // Clear the array after restoration
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (window.opener.originalStyles) {
|
|
|
|
+ window.opener.originalStyles.forEach(item => {
|
|
|
|
+
|
|
|
|
+ item.element.style.marginTop = item.styles.marginTop;
|
|
|
|
+ item.element.style.marginBottom = item.styles.marginBottom;
|
|
|
|
+ });
|
|
|
|
+ window.opener.originalStyles = []; // Clear the array after restoration
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
// Remove all <br> elements
|
|
// Remove all <br> elements
|
|
const brElements = content.querySelectorAll('br');
|
|
const brElements = content.querySelectorAll('br');
|