b06501353cfa1c73c4d8a2b5ff13cc021104088f kate Wed Apr 25 21:04:11 2018 -0700 FF now seems to work w/o extra test (which broke Safari). diff --git src/hg/js/hgGtexTrackSettings.js src/hg/js/hgGtexTrackSettings.js index aa2c087..6df6dfb 100644 --- src/hg/js/hgGtexTrackSettings.js +++ src/hg/js/hgGtexTrackSettings.js @@ -381,52 +381,44 @@ var picEl = _svgDoc.getElementById(tis + PIC_LO); if (picEl !== null) { picEl.addEventListener('mouseenter', onMapEnterTissue); picEl.addEventListener('mouseleave', onMapLeaveTissue); picEl.addEventListener('mouseup', onMapClickToggleTissue); } } function animateTissues() { // Add event handlers to tissue table and body map SVG $('#setAll').click(onClickSetAll); $('#clearAll').click(onClickClearAll); tissues.forEach(animateTissue); } - function initSvg(svgEl) { + function initSvg() { + var svgEl = document.getElementById('bodyMapSvg'); _svgDoc = svgEl.contentDocument; _svgRoot = _svgDoc.documentElement; initBodyMap(); animateTissues(); } function init() { // cart.setCgi('gtexTrackSettings'); $(function() { - // After page load, tweak layout and initialize event handlers - // Check if SVG is loaded, if wait for the event - var svgEl = document.getElementById('bodyMapSvg'); - if (svgEl.getSVGDocument()) { - initSvg(svgEl); - } else { - // Wait for SVG to load - svgEl.addEventListener('load', function() { - initSvg(svgEl); - }, false); - } + // After SVG load, tweak layout and initialize event handlers + document.getElementById('bodyMapSvg').addEventListener('load', initSvg, false); $('.gbButtonGoContainer').click(submitForm); // hide/show of sample counts ($('.gbmTissueSampleCount').hide()); $('#showSampleCount').click(toggleShowSampleCount); }); } return { init: init }; }()); // gtexTrackSettings gtexTrackSettings.init();