|
|
|
@@ -61,14 +61,19 @@ function checkForShouldKillSticky(result) { |
|
|
|
function killSticky(root) { |
|
|
|
// console.log("killSticky"); |
|
|
|
root = root || document.querySelector("body"); |
|
|
|
if (killStickyIfNeeded(root) == false) { |
|
|
|
root.querySelectorAll('*').forEach(element => { |
|
|
|
killStickyIfNeeded(element) |
|
|
|
}); |
|
|
|
} |
|
|
|
if (killStickyIfNeeded(root) == false) |
|
|
|
killAllStickiesWithin(root); |
|
|
|
|
|
|
|
// Compensate for full-screen paywalls. |
|
|
|
restoreScrollability(); |
|
|
|
if (root == document.body) |
|
|
|
restoreScrollability(); |
|
|
|
} |
|
|
|
|
|
|
|
function killAllStickiesWithin(root) { |
|
|
|
root.querySelectorAll('*').forEach(element => { |
|
|
|
if (killStickyIfNeeded(element) == false && element.shadowRoot != null) |
|
|
|
killAllStickiesWithin(element.shadowRoot); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function killStickyIfNeeded(element) { |