@@ -36,7 +36,7 @@ module.exports = baseVw.extend({
3636 'click .js-closeBuyWizardModal' : 'closeWizard' ,
3737 'click .js-buyWizardNewAddressBtn' : 'createNewAddress' ,
3838 'click .js-buyWizardModeratorRadio' : 'modSelected' ,
39- 'click .js-buyWizardModNext' : 'accNext ' ,
39+ 'click .js-buyWizardModNext' : 'modNext ' ,
4040 'click .js-buyWizardModBack' : 'modBack' ,
4141 'click .js-buyWizardReturnNext' : 'returnNext' ,
4242 'click .js-buyWizardAddressBack' : 'addressPrev' ,
@@ -265,6 +265,11 @@ module.exports = baseVw.extend({
265265 this . accGoToID ( "#BuyWizardPaymentType" ) ;
266266 } ,
267267
268+ modNext : function ( ) {
269+ this . accNext ( ) ;
270+ this . setTotalPrice ( ) ; //in case it isn't set yet
271+ } ,
272+
268273 modBack : function ( ) {
269274 this . accGoToID ( '#BuyWizardBitcoinWallet' ) ;
270275 } ,
@@ -445,16 +450,16 @@ module.exports = baseVw.extend({
445450 formData = new FormData ( ) ,
446451 moderatorID = this . model . get ( 'selectedModerator' ) . guid || "" ,
447452 selectedAddress = this . model . get ( 'selectedAddress' ) ,
448- bitCoinReturnAddr = this . $el . find ( '#buyWizardBitcoinAddressInput' ) . val ( ) ;
453+ bitCoinReturnAddr = this . $ ( '#buyWizardBitcoinAddressInput' ) . val ( ) ;
449454
450- if ( ! this . $el . find ( '#buyWizardQuantity' ) [ 0 ] . checkValidity ( ) ) {
455+ if ( ! this . $ ( '#buyWizardQuantity' ) [ 0 ] . checkValidity ( ) ) {
451456 messageModal . show ( window . polyglot . t ( 'errorMessages.saveError' ) , window . polyglot . t ( 'errorMessages.missingError' ) ) ;
452457 return ;
453458 }
454459
455- this . $el . find ( '.js-buyWizardSendPurchase' ) . addClass ( 'hide' ) ;
456- this . $el . find ( '.js-buyWizardPendingMsg' ) . removeClass ( 'hide' ) ;
457- this . $el . find ( '.js-buyWizardPurchaseBack' ) . addClass ( 'disabled' ) ;
460+ this . $ ( '.js-buyWizardSendPurchase' ) . addClass ( 'hide' ) ;
461+ this . $ ( '.js-buyWizardPendingMsg' ) . removeClass ( 'hide' ) ;
462+ this . $ ( '.js-buyWizardPurchaseBack' ) . addClass ( 'disabled' ) ;
458463
459464 formData . append ( "id" , this . model . get ( 'id' ) ) ;
460465
@@ -472,7 +477,7 @@ module.exports = baseVw.extend({
472477 formData . append ( "moderator" , moderatorID ) ;
473478 }
474479
475- this . $el . find ( '.js-buyWizardSpinner' ) . removeClass ( 'hide' ) ;
480+ this . $ ( '.js-buyWizardSpinner' ) . removeClass ( 'hide' ) ;
476481
477482 formData . append ( "refund_address" , bitCoinReturnAddr ) ;
478483
@@ -494,7 +499,11 @@ module.exports = baseVw.extend({
494499 } else {
495500 messageModal . show ( window . polyglot . t ( 'errorMessages.contractError' ) , window . polyglot . t ( 'errorMessages.sellerError' ) + " " +
496501 window . polyglot . t ( 'errorMessages.checkPurchaseData' ) + "\n\n Reason: " + data . reason ) ;
497- self . $el . find ( '.js-buyWizardSpinner' ) . addClass ( 'hide' ) ;
502+ self . $ ( '.js-buyWizardSpinner' ) . addClass ( 'hide' ) ;
503+ //re-enable form so they can try again
504+ self . $ ( '.js-buyWizardSendPurchase' ) . removeClass ( 'hide' ) ;
505+ self . $ ( '.js-buyWizardPendingMsg' ) . addClass ( 'hide' ) ;
506+ self . $ ( '.js-buyWizardPurchaseBack' ) . removeClass ( 'disabled' ) ;
498507 }
499508 } ,
500509 error : function ( jqXHR , status , errorThrown ) {
@@ -562,8 +571,8 @@ module.exports = baseVw.extend({
562571 maximumFractionDigits : 2 ,
563572 currency : userCurrency
564573 } ) . format ( totalPrice ) ;
565- this . $el . find ( '.js-buyWizardDetailsTotal' ) . text ( totalDisplayPrice ) ;
566- this . $el . find ( '.js-buyWizardDetailsBTCTotal' ) . text ( Number ( totalBTCPrice . toFixed ( 8 ) ) ) ;
574+ this . $ ( '.js-buyWizardDetailsTotal' ) . text ( totalDisplayPrice ) ;
575+ this . $ ( '.js-buyWizardDetailsBTCTotal' ) . text ( Number ( totalBTCPrice . toFixed ( 8 ) ) ) ;
567576 } ,
568577
569578 copyPayAddress : function ( ) {
0 commit comments