@@ -437,6 +437,7 @@ module.exports = baseVw.extend({
437437 "use strict" ;
438438 this . accNext ( ) ;
439439 this . hideMaps ( ) ;
440+ this . setTotalPrice ( ) ; //in case it isn't set yet
440441 } ,
441442
442443 sendPurchase : function ( ) {
@@ -445,16 +446,16 @@ module.exports = baseVw.extend({
445446 formData = new FormData ( ) ,
446447 moderatorID = this . model . get ( 'selectedModerator' ) . guid || "" ,
447448 selectedAddress = this . model . get ( 'selectedAddress' ) ,
448- bitCoinReturnAddr = this . $el . find ( '#buyWizardBitcoinAddressInput' ) . val ( ) ;
449+ bitCoinReturnAddr = this . $ ( '#buyWizardBitcoinAddressInput' ) . val ( ) ;
449450
450- if ( ! this . $el . find ( '#buyWizardQuantity' ) [ 0 ] . checkValidity ( ) ) {
451+ if ( ! this . $ ( '#buyWizardQuantity' ) [ 0 ] . checkValidity ( ) ) {
451452 messageModal . show ( window . polyglot . t ( 'errorMessages.saveError' ) , window . polyglot . t ( 'errorMessages.missingError' ) ) ;
452453 return ;
453454 }
454455
455- this . $el . find ( '.js-buyWizardSendPurchase' ) . addClass ( 'hide' ) ;
456- this . $el . find ( '.js-buyWizardPendingMsg' ) . removeClass ( 'hide' ) ;
457- this . $el . find ( '.js-buyWizardPurchaseBack' ) . addClass ( 'disabled' ) ;
456+ this . $ ( '.js-buyWizardSendPurchase' ) . addClass ( 'hide' ) ;
457+ this . $ ( '.js-buyWizardPendingMsg' ) . removeClass ( 'hide' ) ;
458+ this . $ ( '.js-buyWizardPurchaseBack' ) . addClass ( 'disabled' ) ;
458459
459460 formData . append ( "id" , this . model . get ( 'id' ) ) ;
460461
@@ -472,7 +473,7 @@ module.exports = baseVw.extend({
472473 formData . append ( "moderator" , moderatorID ) ;
473474 }
474475
475- this . $el . find ( '.js-buyWizardSpinner' ) . removeClass ( 'hide' ) ;
476+ this . $ ( '.js-buyWizardSpinner' ) . removeClass ( 'hide' ) ;
476477
477478 formData . append ( "refund_address" , bitCoinReturnAddr ) ;
478479
@@ -494,7 +495,11 @@ module.exports = baseVw.extend({
494495 } else {
495496 messageModal . show ( window . polyglot . t ( 'errorMessages.contractError' ) , window . polyglot . t ( 'errorMessages.sellerError' ) + " " +
496497 window . polyglot . t ( 'errorMessages.checkPurchaseData' ) + "\n\n Reason: " + data . reason ) ;
497- self . $el . find ( '.js-buyWizardSpinner' ) . addClass ( 'hide' ) ;
498+ self . $ ( '.js-buyWizardSpinner' ) . addClass ( 'hide' ) ;
499+ //re-enable form so they can try again
500+ self . $ ( '.js-buyWizardSendPurchase' ) . removeClass ( 'hide' ) ;
501+ self . $ ( '.js-buyWizardPendingMsg' ) . addClass ( 'hide' ) ;
502+ self . $ ( '.js-buyWizardPurchaseBack' ) . removeClass ( 'disabled' ) ;
498503 }
499504 } ,
500505 error : function ( jqXHR , status , errorThrown ) {
@@ -562,8 +567,8 @@ module.exports = baseVw.extend({
562567 maximumFractionDigits : 2 ,
563568 currency : userCurrency
564569 } ) . format ( totalPrice ) ;
565- this . $el . find ( '.js-buyWizardDetailsTotal' ) . text ( totalDisplayPrice ) ;
566- this . $el . find ( '.js-buyWizardDetailsBTCTotal' ) . text ( Number ( totalBTCPrice . toFixed ( 8 ) ) ) ;
570+ this . $ ( '.js-buyWizardDetailsTotal' ) . text ( totalDisplayPrice ) ;
571+ this . $ ( '.js-buyWizardDetailsBTCTotal' ) . text ( Number ( totalBTCPrice . toFixed ( 8 ) ) ) ;
567572 } ,
568573
569574 copyPayAddress : function ( ) {
0 commit comments