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:
@ -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
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user