82e33a8cee5694a001f2ae572a3de67cfb2c7075
kate
  Thu Apr 19 10:13:46 2012 -0700
Cleanup handling of spinner
diff --git src/hg/js/encodeMatrix.js src/hg/js/encodeMatrix.js
index 2765819..4ac5424 100644
--- src/hg/js/encodeMatrix.js
+++ src/hg/js/encodeMatrix.js
@@ -1,26 +1,26 @@
 /* encodeMatrix.js - shared code for ENCODE data matrix apps
 
  Formatted: jsbeautify.py -j
  Syntax checked: jslint indent:4, plusplus: true, continue: true, unparam: true, sloppy: true, browser: true
 */
 /*global $, encodeProject */
 
 var encodeMatrix = (function () {
 
     // spinning image displayed during AJAX activity
-    var spinner;
+    var spinnerId = 'spinner';
 
     function addSearchPanel($div, isFile) {
         // Create panel of radio buttons for user to change search type
         // isFileSearch determines initial setting
         // Add to passed in div ID; e.g. #searchTypePanel
         $div.append('<span id="searchPanelInstructions">search for:&nbsp;</span><input type="radio" name="searchType" id="searchTracks" value="tracks" onclick="encodeMatrix.setFileSearch(false);">tracks<input type="radio" name="searchType" id="searchFiles" value="files" onclick="encodeMatrix.setFileSearch(true);" >files');
         if (isFile) {
             $('#searchFiles').attr('checked', true);
         } else {
             $('#searchTracks').attr('checked', true);
         }
         encodeMatrix.setFileSearch(isFile);
     }
 
     return {
@@ -102,41 +102,40 @@
 
             // show only spinner until data is retrieved
             $el.hide();
             $('.helpLauncher').hide();
             $('.xIcon').hide();
 
             // setup click handlers for help controls
             $('.xIcon').click(function() {
                 $('.helpText').toggle();
                 $('.helpLauncher').toggle();
             });
             $('.helpLauncher').click(function() {
                 $('.helpText').toggle();
                 $('.helpLauncher').toggle();
             });
-            spinner = showLoadingImage('spinner', true);
+            showLoadingImage(spinnerId, true);
 
             // add radio buttons for search type to specified div on page
             addSearchPanel($('#searchTypePanel'), encodeMatrix.isFileSearch());
 
         },
 
     show: function ($el) {
         // Call after data loads to show display
-        hideLoadingImage(spinner);
-        $('#spinner').remove();
+        hideLoadingImage(spinnerId);
         $('.xIcon').show();
         $el.show();
         },
 
     // Table rendering special effects
 
     addTableFloatingHeader: function ($table) {
         // add callback for floating table header feature
 
        // NOTE: it may be possible to revive floating header functionality in IE 
        // using this plug-in, but I've timed out 
        // (not able to make it work in simple HTML either).
 
           $table.floatHeader({
             cbFadeIn: function (header) {