049a26b55b0a4001da527c7ddf6f37f7093285b8 jnavarr5 Mon Dec 2 09:35:33 2024 -0800 Moving the creation of the popup outside of the if statement. refs #34208 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 7dcd54c..92ab9ca 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -5830,48 +5830,48 @@ if (tmp !== null) {tutMsgCount = parseInt(tmp);} // if the user is not logged in and they have not already gone through the // tutorial if (!isUserLoggedIn && !hideTutorial && tutMsgCount < 5) { let msg = "New to the Genome Browser? See our short (2-3 minute) guided tutorial. " + "All tutorials can be found in the top blue bar menu under <b>Help</b> > <b>Interactive Tutorial</b>.<br>" + "<button id='showTutorialLink' href=\"#showTutorial\">Start tutorial</button>"; notifBoxSetup("hgTracks", "hideTutorial", msg, true); notifBoxShow("hgTracks", "hideTutorial"); localStorage.setItem("hgTracks_tutMsgCount", ++tutMsgCount); $("#showTutorialLink").on("click", function() { $("#hgTracks_hideTutorialnotifyHideForever").trigger("click"); basicTour.start(); }); } + } // allow the user to bring the tutorials popup via a new help menu button let tutorialLinks = document.createElement("li"); tutorialLinks.id = "hgTracksHelpTutorialLinks"; tutorialLinks.innerHTML = "<a id='hgTracksHelpTutorialLinks' href='#showTutuorialPopup'>" + "Interactive Tutorials</a>"; $("#help > ul")[0].appendChild(tutorialLinks); $("#hgTracksHelpTutorialLinks").on("click", function () { // Check to see if the tutorial popup has been generated already let tutorialPopupExists = document.getElementById ("tutorialContainer"); if (!tutorialPopupExists) { // Create the tutorial popup if it doesn't exist createTutorialPopup(); } else { //otherwise use jquery-ui to open the popup $("#tutorialContainer").dialog("open"); } }); - } // Any highlighted region must be shown and warnBox must play nice with it. imageV2.drawHighlights(); // When warnBox is dismissed, any image highlight needs to be redrawn. $('#warnOK').on("click", function (e) { imageV2.drawHighlights();}); // Also extend the function that shows the warn box so that it too redraws the highlight. showWarnBox = (function (oldShowWarnBox) { function newShowWarnBox() { oldShowWarnBox.apply(); imageV2.drawHighlights(); } return newShowWarnBox; })(showWarnBox); // redraw highlights if the notification box is closed $("[id$=notifyHide],[id$=notifyHideForever]").on("click", function(e) {