cb4c22a814d2a23d93d63cd621333be7529a36b2 chmalee Fri Jul 22 15:24:08 2022 -0700 Make gene selections on hgGateway automatically go to hgTracks diff --git src/hg/js/model/lib/cart.js src/hg/js/model/lib/cart.js index 963dd23..c02668e 100644 --- src/hg/js/model/lib/cart.js +++ src/hg/js/model/lib/cart.js @@ -190,45 +190,50 @@ _.assign(ajaxParams, { data: reqObj, // Using 'iframe json' here activates jquery.bifrost: dataType: 'iframe json', fileInputs: jqFileInput }); debugLog('cart.flush: using jquery.bifrost plugin for input ' + fileInputName + ', data =', reqObj, ', params = ' + paramString); } return ajaxParams; } // Return cart object with public methods. return { + defaultErrorCallback: function (jqXHR, textStatus) { + defaultErrorCallback(jqXHR, textStatus); + }, + + setCgi: function(newCgi) { // Sets the name of the CGI (e.g. hgIntegrator, hgChooseDb etc). // This must be called before cart.send. cgiUrl = cgiBinUrl + newCgi; }, send: function(commandObj, successCallback, errorCallback) { // Queue up commandObj and callbacks, merging cgiVars with those of othere queued reqs. // successCallback and the optional errorCallback are functions(jqXHR, textStatus) // Throws [message, badValue] if something is not as expected. var cmdObjNoCgiVar = processCommandObj(commandObj); // If this request contained only cgiVars (empty cmdObjNoCgiVar) then let those // go out with other requests. Below, flush will make sure that at least one request // is sent out if there are cgiVars. - if (! _.isEmpty(cmdObjNoCgiVar)) { + if (! _.isEmpty(cmdObjNoCgiVar) || successCallback || errorCallback) { requestQueue.push({ commandObj: cmdObjNoCgiVar, successCallback: successCallback, errorCallback: errorCallback }); } }, uploadFile: function(commandObj, jqFileInput, successCallback, errorCallback) { // Queue up commandObj, jqFileInput and callbacks, merging cgiVars with those // of othere queued reqs. // successCallback and the optional errorCallback are functions(jqXHR, textStatus) // Throws [message, badValue] if something is not as expected. var cmdObjNoCgiVar = processCommandObj(commandObj); requestQueue.push({ commandObj: cmdObjNoCgiVar, jqFileInput: jqFileInput, successCallback: successCallback,