009aed1c7b80108e75e1922430316e7c1cac39aa max Fri Oct 22 05:59:18 2021 -0700 making hlColor save syncronous, hopefully this will avoid the problem found by QA in note 34 of the ticket, refs #28098 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index ae3cc70..bf40d31 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1050,31 +1050,31 @@ if (pos.chrom === hgTracks.chromName && pos.db === currDb && pos.start <= findPos.chromStart && pos.end >= findPos.chromEnd) { return i; } } } return null; }, saveHlColor : function (hlColor) // save the current hlColor to the object and also the cart variable hlColor and return it. // hlColor is a 6-character hex string prefixed by # { dragSelect.hlColor = hlColor; - cart.setVars(["prevHlColor"], [dragSelect.hlColor]); + cart.setVars(["prevHlColor"], [dragSelect.hlColor], null, false); hgTracks.prevHlColor = hlColor; // cart.setVars does not update the hgTracks-variables. The cart-variable system is a problem. return hlColor; }, loadHlColor : function () // load hlColor from prevHlColor in the cart, or use default color, set and return it // color is a 6-char hex string prefixed by # { if (hgTracks.prevHlColor) dragSelect.hlColor = hgTracks.prevHlColor; else dragSelect.hlColor = dragSelect.hlColorDefault; return dragSelect.hlColor; }, @@ -1152,31 +1152,30 @@ if (dragSelect.startTime===null) return; var dragSelectDialog = $("#dragSelectDialog")[0]; if (!dragSelectDialog) { $("body").append("<div id='dragSelectDialog'>" + "<p><ul>"+ "<li>Hold <b>Shift+drag</b> to show this dialog" + "<li>Hold <b>Alt+drag</b> (Windows) or <b>Option+drag</b> (Mac) to add a highlight" + "<li>Hold <b>Ctrl+drag</b> (Windows) or <b>Cmd+drag</b> (Mac) to zoom" + "<li>To cancel, press <tt>Esc</tt> anytime during the drag" + "<li>Using the keyboard, highlight the current position with <tt>h then m</tt>" + "<li>Clear all highlights with View - Clear Highlights or <tt>h then c</tt>" + "<li>To merely save the color for the next keyboard or right-click > Highlight operations, click 'Save Color' below" + "</ul></p>" + "<p>Highlight color: <input type='text' style='width:70px' id='hlColorInput' value='"+dragSelect.loadHlColor()+"'>" + - //"<span id='hlColorBox' style='width:20px'></span>" + " <input id='hlColorPicker'>" + " <a href='#' id='hlReset'>Reset</a></p>" + "<input style='float:left' type='checkbox' id='disableDragHighlight'>" + "<span style='border:solid 1px #DDDDDD; padding:3px;display:inline-block' id='hlNotShowAgainMsg'>Don't show this again and always zoom with shift.<br>" + "Re-enable via 'View - Configure Browser' (<tt>c then f</tt>)</span></p>"+ "Selected chromosome position: <span id='dragSelectPosition'></span>"); dragSelectDialog = $("#dragSelectDialog")[0]; // reset value $('#hlReset').click(function() { var hlDefault = dragSelect.hlColorDefault; $('#hlColorInput').val(hlDefault); $("#hlColorPicker").spectrum("set", hlDefault); dragSelect.saveHlColor(hlDefault); }); // allow to click checkbox by clicking on the label