f9aa08a91555a420506b7e81ed279f130533b374 kate Thu Apr 19 10:29:10 2012 -0700 Repairing overly zealous cleanup of spinner handling diff --git src/hg/js/encodeMatrix.js src/hg/js/encodeMatrix.js index 4ac5424..2031623 100644 --- src/hg/js/encodeMatrix.js +++ src/hg/js/encodeMatrix.js @@ -1,26 +1,27 @@ /* 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 spinnerId = 'spinner'; + var spinnerLoc = 'spinner'; // id of location on HTML page + var spinner; // id generated by spinner function 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: </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,40 +103,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(); }); - showLoadingImage(spinnerId, true); + spinner = showLoadingImage(spinnerLoc, 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(spinnerId); + hideLoadingImage(spinner); $('.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) {