Index: lams_central/web/includes/javascript/common.js =================================================================== diff -u -rf04cfe28c0e223b4feca038d911fcb6ce2f40032 -rbad4616b65a3efb06c6626a79772d4a6d7705daa --- lams_central/web/includes/javascript/common.js (.../common.js) (revision f04cfe28c0e223b4feca038d911fcb6ce2f40032) +++ lams_central/web/includes/javascript/common.js (.../common.js) (revision bad4616b65a3efb06c6626a79772d4a6d7705daa) @@ -74,7 +74,6 @@ } function isEmpty( strValue ) { - var strTemp = strValue; strTemp = trimAll(strTemp); if (strTemp.length > 0) { @@ -85,22 +84,25 @@ // refresh the parent window if the parent window is a tool monitoring window function refreshParentMonitoringWindow() { - if ( window.opener && ! window.opener.closed && window.opener.name.indexOf("MonitorActivity") >= 0 ) { - var monitoringURL = String(window.opener.location); - var currentTab = window.opener.selectedTabID; + let opener = window.opener; + if ( opener && ! opener.closed && String(opener.location).indexOf("tool") >= 0 && String(opener.location).indexOf("monitoring") >= 0 ) { + let monitoringURL = String(opener.location), + currentTab = opener.$("#tabs button.nav-link.active"); + if ( currentTab ) { - var indexStart = monitoringURL.indexOf("¤tTab="); + let indexStart = monitoringURL.indexOf("¤tTab="), + currentTabId = currentTab.attr("id").substring(4); if ( indexStart != -1 ) { - var indexEnd = monitoringURL.indexOf("&",indexStart+1); + let indexEnd = monitoringURL.indexOf("&",indexStart+1); if ( indexEnd == -1 ) { monitoringURL = monitoringURL.substring(0,indexStart); } else { monitoringURL = monitoringURL.substring(0,indexStart)+monitoringURL.substring(indexEnd); } } - monitoringURL = monitoringURL+"¤tTab="+currentTab; + monitoringURL = monitoringURL+"¤tTab="+currentTabId; } - window.opener.location.href = monitoringURL; + opener.location.href = monitoringURL; } }