9aa2b81f760d82416cfeb63f219ff489d75dc87c
kate
  Thu Feb 4 14:47:33 2016 -0800
Improvements to GTEx trackUI.  Especially right-click menus and popup. refs #15645

diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index cb31e28..753d565 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -33,33 +33,30 @@
 
         imageV2.imgTbl = $('#imgTbl');
         // imageV2.enabled === true unless: advancedJavascript===false, or trackSearch, or config pg
         imageV2.enabled = (imageV2.imgTbl && imageV2.imgTbl.length > 0);
 
         // jQuery load function with stuff to support drag selection in track img
         if (theClient.isSafari()) {
             // Safari has the following bug: if we update the hgTracks map dynamically,
             // the browser ignores the changes (even though if you look in the DOM the changes
             // are there). So we have to do a full form submission when the user changes
             // visibility settings or track configuration.
             // As of 5.0.4 (7533.20.27) this is problem still exists in safari.
             // As of 5.1 (7534.50) this problem appears to have been fixed - unfortunately,
             // logs for 7/2011 show vast majority of safari users are pre-5.1 (5.0.5 is by far
             // the most common).
-            // KRR/JAT:
-            // As of 9.0.9, possibly earlier, the 3rd part of the version is included in the
-            // user agent string, so must be parsed out (and discarded)
             //
             // Early versions of Chrome had this problem too, but this problem went away
             // as of Chrome 5.0.335.1 (or possibly earlier).
             //
             // KRR/JAT 2/2016:
             // This Safari issue is likely resolved in all current versions.  However the test
             // for version had been failing, likely for some time now.
             // (As of 9.0.9, possibly earlier, the 3rd part of the version is included in the
             // user agent string, so must be accounted for in string match)
             // Consequences were that page refresh was used instead of img update (e.g. 
             // for drag-zoom).  And UI dialog was unable to update (e.g. via Apply button).
             imageV2.mapIsUpdateable = false;
             var reg = new RegExp("Version\/([0-9]+.[0-9]+)(.[0-9]+)? Safari");
             var a = reg.exec(navigator.userAgent);
             if (a && a[1]) {
@@ -3131,31 +3128,31 @@
                 htmlLines.push('<li><span style="color:grey">'+shortLabel+": <small>"+longLabel+note);
                 }
         }
         htmlLines.push("</ul>");
         content = htmlLines.join("");
             
         var title = hgTracks.chromName + ":" + (hgTracks.winStart+1) + "-" + hgTracks.winEnd;
 	if (hgTracks.nonVirtPosition)
 	    title = hgTracks.nonVirtPosition;
         title += " on another website";
         $("body").append("<div id='extToolDialog' title='"+title+"'><p>" + content + "</p>");
 
         // copied from the hgTrackUi function below
         var popMaxHeight = ($(window).height() - 40);
         var popMaxWidth  = ($(window).width() - 40);
-        var popWidth     = 600;
+        var popWidth     = 740;
         if (popWidth > popMaxWidth)
             popWidth = popMaxWidth;
 
         // also copied from the hgTrackUi code below
         $('#extToolDialog').dialog({
             resizable: true,               // Let description scroll vertically
             height: popMaxHeight,
             width: popWidth,
             minHeight: 200,
             minWidth: 600,
             maxHeight: popMaxHeight,
             maxWidth: popMaxWidth,
             modal: true,
             closeOnEscape: true,
             autoOpen: false,
@@ -3478,35 +3475,36 @@
                 // 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: { 
-                    'Apply': function () {
-                         popUp.uiDialogOk($('#pop'), popUp.trackName);
+                    // TODO: Enable when ready to deploy this feature
+                    //'Apply': function () {
+                         //popUp.uiDialogOk($('#pop'), popUp.trackName);
                          // thanks to JAT for this cleverness to keep button functioning
-                         popUp.saveAllVars = getAllVars( $('#hgTrackUiDialog'), popUp.trackName);
-                    },
+                         //popUp.saveAllVars = getAllVars( $('#hgTrackUiDialog'), popUp.trackName);
+                    //},
                     'OK': function() {
                         if ( ! popUp.trackDescriptionOnly )
                             popUp.uiDialogOk($('#pop'), popUp.trackName);
                         $(this).dialog("close");
                     }
             },
             // popup.ready() doesn't seem to work in open.
             
             open: function () {
                 if ( ! popUp.trackDescriptionOnly ) {
                     $('#hgTrackUiDialog').find('.filterBy,.filterComp').each(
                         function(i) {
                             if ($(this).hasClass('filterComp'))
                                 ddcl.setup(this);
                             else