1
0
mirror of https://github.com/minio/docs.git synced 2025-07-27 08:41:57 +03:00

Hide navigation links when loaded inside iframe

This commit is contained in:
Rushan
2022-03-25 17:10:14 +04:00
committed by Ravind Kumar
parent b824e36e65
commit c84dcc74d4
2 changed files with 24 additions and 0 deletions

View File

@ -1,4 +1,11 @@
window.addEventListener("DOMContentLoaded", (event) => { window.addEventListener("DOMContentLoaded", (event) => {
// Detect parent iframe.
// This is required to hide the navigation links when viewed via PathFactory for analytics purposes
if (window.location !== window.parent.location) {
document.body.classList.add('inside-iframe');
}
// Table of contents
var topic = document.getElementById("table-of-contents"); var topic = document.getElementById("table-of-contents");
if (topic != null) { if (topic != null) {
document document

View File

@ -43,3 +43,20 @@
top: 0; top: 0;
overflow: scroll; overflow: scroll;
} }
// Keep only the main content when the page is loaded inside an iframe.
// Currently we load certain pages inside iframes for PathFactory analytics.
.inside-iframe {
.header,
.sidebar {
display: none;
}
.content {
height: 100vh;
}
.content__main {
padding-left: $content-padding;
}
}