b0b2f92c21f27f0bd4a365f92e5ffeac448b4639 chmalee Fri Sep 27 10:07:09 2024 -0700 Make all dialogs not resizable, refs #13253 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 93c2f2e..bf90e75 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -3147,31 +3147,31 @@ title += " on another website"; $("body").append("<div id='extToolDialog' title='"+title+"'><p>" + content + "</p>"); // GALT $('a.extToolLink2').on("click", function(){$('#extToolDialog').dialog('close');}); // copied from the hgTrackUi function below var popMaxHeight = ($(window).height() - 40); var popMaxWidth = ($(window).width() - 40); var popWidth = 600; if (popWidth > popMaxWidth) popWidth = popMaxWidth; // also copied from the hgTrackUi code below $('#extToolDialog').dialog({ - resizable: true, // Let description scroll vertically + resizable: false, height: popMaxHeight, width: popWidth, minHeight: 200, minWidth: 600, maxHeight: popMaxHeight, maxWidth: popMaxWidth, modal: true, closeOnEscape: true, autoOpen: false, buttons: { "Close": function() { $(this).dialog("close"); }}, }); $('#extToolDialog').dialog('open'); @@ -3260,31 +3260,31 @@ // -- popup.ready() -- Here is the place to do things that might otherwise go // into a $('#pop').ready() routine! // Searching for some semblance of size suitability var popMaxHeight = ($(window).height() - 40); var popMaxWidth = ($(window).width() - 40); var popWidth = 700; if (popWidth > popMaxWidth) popWidth = popMaxWidth; $('#hgTracksDialog').dialog({ ajaxOptions: { // This doesn't work cache: true }, - resizable: true, // Let scroll vertically + resizable: false, height: 'auto', width: popWidth, minHeight: 200, minWidth: 400, maxHeight: popMaxHeight, maxWidth: popMaxWidth, modal: true, closeOnEscape: true, autoOpen: false, buttons: { /* NOT NOW "OK": function() { popUpHgt.uiDialogOk($('#pop')); $(this).dialog("close"); } @@ -3520,31 +3520,31 @@ var popMaxWidth = (window.innerWidth - (window.innerWidth * 0.1)); // take up 90% of the window // Create dialog buttons for UI popup // this could be more buttons later var uiDialogButtons = {}; uiDialogButtons.Close = function() { // if there was a form to submit, submit it: popUpHgcOrHgGene.uiDialogOk(popUpHgcOrHgGene.table); $(this).dialog("close"); }; let openIcon = "<a class='dialogNewWindowIcon' target='_blank' href='" + popUpHgcOrHgGene.href + "'><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 512 512'><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d='M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z'/></svg></a>"; let titleText = hgTracks.trackDb[popUpHgcOrHgGene.table].shortLabel + " (Item Details)" + openIcon; $('#hgcDialog').dialog({ - resizable: true, // Let scroll vertically + resizable: false, height: popMaxHeight, width: popMaxWidth, minHeight: 200, minWidth: 400, modal: true, closeOnEscape: true, autoOpen: false, buttons: uiDialogButtons, open: function (event) { // fix popup to a location -- near the top and somewhat centered on the browser image $(event.target).parent().css('position', 'fixed'); $(event.target).parent().css('top', '10%'); $('#hgcDialog').find('.filterBy,.filterComp').each( function(i) { // ddcl.js is dropdown checklist lib support @@ -3579,52 +3579,52 @@ }); // Customize message based on current mode // Make 'Cancel' button close dialog $('input[name="Cancel"]').on("click", function() { $('#hgcDialog').dialog('close'); }); } }; // Show the exported data hubs popup function showExportedDataHubsPopup() { let popUp = document.getElementById("exportedDataHubsPopup"); title = popUp.title; if (title.length === 0 && popUp.getAttribute("mouseovertext") !== "") {title = popUp.getAttribute("mouseovertext");} - $('#exportedDataHubsPopup').dialog({width:'650', title: title}); + $('#exportedDataHubsPopup').dialog({resizable: false, width:'650', title: title}); } // Show the recommended track sets popup function showRecTrackSetsPopup() { // Update links with current position $('a.recTrackSetLink').each(function() { var $this = $(this); var link = $this.attr("href").replace(/position=.*/, 'position='); $this.attr("href", link + genomePos.original); }); $('#recTrackSetsPopup').dialog({resizable: false, width:'650'}); } function removeSessionPanel() { $('#recTrackSetsPanel').remove(); setCartVar("hgS_otherUserSessionLabel", "off", null, false); } // A function to show the keyboard help dialog box, bound to ? and called from the menu bar function showHotkeyHelp() { - $("#hotkeyHelp").dialog({width:'600'}); + $("#hotkeyHelp").dialog({width:'600', resizable: false}); } // A function to add an entry for the keyboard help dialog box to the menubar // and add text that indicates the shortcuts to many static menubar items as suggested by good old IBM CUA/SAA function addKeyboardHelpEntries() { var html = '<li><a id="keybShorts" title="List all possible keyboard shortcuts" href="#">Keyboard Shortcuts</a><span class="shortcut">?</span></li>'; $('#help .last').before(html); $("#keybShorts").on("click", function(){showHotkeyHelp();} ); html = '<span class="shortcut">s s</span>'; $('#sessionsMenuLink').after(html); html = '<span class="shortcut">p s</span>'; $('#publicSessionsMenuLink').after(html); @@ -3888,34 +3888,30 @@ popUp.uiDialogOk($('#pop'), popUp.trackName); // thanks to JAT for this cleverness to keep button functioning popUp.saveAllVars = getAllVars( $('#hgTrackUiDialog'), popUp.trackName); if (popUp.saveAllVars[popUp.trackName+"_sel"] === 0) { // hide // NOTE: once hidden, can't be unhidden by popup, so shut it down $(this).dialog("close"); } }; uiDialogButtons.OK = function() { popUp.uiDialogOk($('#pop'), popUp.trackName); $(this).dialog("close"); }; } $('#hgTrackUiDialog').dialog({ - ajaxOptions: { - // This doesn't work - cache: true - }, resizable: true, // Let description scroll vertically height: (popUp.trackDescriptionOnly ? popMaxHeight : 'auto'), width: popWidth, minHeight: 200, minWidth: 400, maxHeight: popMaxHeight, maxWidth: popMaxWidth, modal: true, closeOnEscape: true, autoOpen: false, buttons: uiDialogButtons, // popup.ready() doesn't seem to work in open. open: function(event) { // fix popup to a location -- near the top and somewhat centered on the browser image @@ -5509,31 +5505,31 @@ downloadDialog.id = "downloadDialog"; downloadDialog.style = "display: none"; document.body.append(downloadDialog); var popMaxHeight = ($(window).height() - 40); var popMaxWidth = ($(window).width() - 40); var popWidth = 700; if (popWidth > popMaxWidth) popWidth = popMaxWidth; downloadTrackDataButtons = {}; downloadTrackDataButtons.Download = downloadCurrentTrackData.startDownload; downloadTrackDataButtons.Cancel = function(){ $(this).dialog("close"); }; $(downloadDialog).dialog({ title: "Download track data in view", - resizable: true, // Let scroll vertically + resizable: false, height: 'auto', width: popWidth, minHeight: 200, minWidth: 400, maxHeight: popMaxHeight, maxWidth: popMaxWidth, modal: true, closeOnEscape: true, autoOpen: false, buttons: downloadTrackDataButtons }); } htmlStr = "<p>Use this selection window to download track data" + " for the current region (" + genomePos.get() + "). Please note that large regions" + " may be slow to download.</p>";