f787e42da4a9d826e51c67bbe8529a244e3878ca larrym Mon Aug 15 14:08:51 2011 -0700 modify ajax error to encourage user to retry diff --git src/hg/js/ajax.js src/hg/js/ajax.js index a3f11f6..2b8b61b 100644 --- src/hg/js/ajax.js +++ src/hg/js/ajax.js @@ -229,32 +229,40 @@ $('form[name="mainForm"]').submit(); } function setCartVarAndRefresh(name,val) { setCartVar(name,val); var main=$('form[name="mainForm"]') $(main).attr('action',window.location.href); setTimeout("submitMain()",50); // Delay in submit helps ensure that cart var has gotten there first. return false; } function errorHandler(request, textStatus) { - showWarning("ajax error: " + textStatus); + var str = "encountered ajax error"; + if(textStatus && textStatus.length) { + str += ": '" + textStatus + "'"; + } + str += "; please retry the action you just performed"; + showWarning(str); jQuery('body').css('cursor', ''); + if(this.disabledEle) { + this.disabledEle.attr('disabled', ''); + } if(this.loadingId) { hideLoadingImage(this.loadingId); } } function catchErrorOrDispatch(obj, textStatus) { // generic ajax success handler (handles fact that success is not always success). if(textStatus == 'success') this.trueSuccess(obj, textStatus); else errorHandler.call(this, obj, textStatus); } function showWarning(str)