cde069ff775afde4092c01650eea5f9989d97997 max Tue Mar 18 18:46:15 2025 -0700 changes after code review, refs #35362 diff --git src/hg/js/utils.js src/hg/js/utils.js index 93bdd24bc7b..6127580c972 100644 --- src/hg/js/utils.js +++ src/hg/js/utils.js @@ -4616,30 +4616,27 @@ function saveHistory(obj, urlParts, replace) { /* Save an object to the web browser's history stack. When we visit the page for the * first time, we replace the basic state after we are done making the initial UI */ if (replace) { history.replaceState(obj, "", urlParts.baseUrl + (urlParts.args.length !== 0 ? "?" + urlParts.args : "")); } else { history.pushState(obj, "", urlParts.baseUrl + (urlParts.args.length !== 0 ? "?" + urlParts.args : "")); } } function forceDisplayBedFile(url) { var w = window.open(''); w.document.write(' '); w.document.write(''); - w.onload = () => { + w.onload = function(ev) { // Attach event listeners after the new window is loaded - w.document.getElementById('closeWindowLink').addEventListener('click', () => { - // Handle click event - w.close(); - }); + w.document.getElementById('closeWindowLink').addEventListener('click', function() { w.close(); } ); }; fetch(url).then(response => response.text()) // Read the response as text - .then(text => { + .then(function(text) { w.document.write('
' + text + '
'); // Display the content w.document.close(); // Close the document to finish rendering }) .catch(error => console.error('Error fetching BED file:', error)); }