Index: include.preload.js |
diff --git a/include.preload.js b/include.preload.js |
index 02661d39c86ace26fcddea8395726dddf7018df8..b7b87bbd8cfd54fe9d4763874bbf7e29dbb97e56 100644 |
--- a/include.preload.js |
+++ b/include.preload.js |
@@ -150,16 +150,22 @@ function checkCollapse(element) |
{ |
function collapseElement() |
{ |
+ var propertyName = "display"; |
+ var propertyValue = "none"; |
if (element.localName == "frame") |
- element.style.setProperty("visibility", "hidden", "important"); |
- else |
- element.style.setProperty("display", "none", "important"); |
+ { |
+ propertyName = "visibility"; |
+ propertyValue = "hidden"; |
+ } |
+ |
+ if (element.style.getPropertyValue(propertyName) != propertyValue || |
+ element.style.getPropertyPriority(propertyName) != "important") |
+ element.style.setProperty(propertyName, propertyValue, "important"); |
} |
- if (collapse && !element._collapsed) |
+ if (collapse) |
{ |
collapseElement(); |
- element._collapsed = true; |
if (MutationObserver) |
new MutationObserver(collapseElement).observe( |