Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions javascript/scorm-fullscreen.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,23 +332,34 @@ function getUrlParameterFromHref(href, name) {
const MAX_POLL_TIME = 15000; // Max 15 seconds for button hiding inside iframe

// Function to find and hide the Adapt button
const hideAdaptExitButton = () => {
const hideAdaptExitButton = () => {
const scormIframe = document.getElementById('scorm_object');
if (!scormIframe || !scormIframe.contentDocument) {
if (!scormIframe || !scormIframe.contentDocument && !scormIframe.contentWindow) {
return false;
}

const iframeDoc = scormIframe.contentDocument || scormIframe.contentWindow.document;
const exitButton = iframeDoc.querySelector('.nav-course__exit-btn');

if (exitButton) {
if (getComputedStyle(exitButton).display !== 'none') {
exitButton.style.setProperty('display', 'none', 'important');
console.log(`[${Date.now()}] Adapt Exit Button hidden. Current display: ${getComputedStyle(exitButton).display}`);
// Try both selectors
const selectors = [
'.nav-course__exit-btn', // Newer Adapt exit button
'.navigation-course-exit-button' // Older Adapt exit button
];

let found = false;

selectors.forEach(selector => {
const button = iframeDoc.querySelector(selector);
if (button) {
if (getComputedStyle(button).display !== 'none') {
button.style.setProperty('display', 'none', 'important');
console.log(`[${Date.now()}] Hidden Adapt exit button via selector: ${selector}`);
}
found = true;
}
return true; // Button found and hidden (or already hidden)
}
return false; // Button not found yet
});

return found;
};

// Function to set up the hiding logic *inside* the iframe
Expand Down
5 changes: 1 addition & 4 deletions scss/nhse.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1145,10 +1145,7 @@ th, td {
}


.nav-course__exit-btn {

display:none !important;
}

.autosuggestion-menu {
padding: 16px 16px 0px 16px;
Expand Down Expand Up @@ -1202,4 +1199,4 @@ th, td {
color: #768692 !important;
padding-left: 24px;
margin: 0px;
}
}