@@ -45,7 +45,7 @@ module.exports = baseVw.extend({
4545 'click .js-buyWizardWalletNext' : 'walletNowClick' ,
4646 'click .js-buyWizardHasWallet' : 'hasWalletClick' ,
4747 'click .js-buyWizardDoesntHaveWallet' : 'doesntHaveWallet' ,
48- 'click .js-buyWizardNewAddressCancel' : 'hideNewAddress ' ,
48+ 'click .js-buyWizardNewAddressCancel' : 'onAddressCancel ' ,
4949 'click .js-buyWizardNewAddressSave' : 'saveNewAddress' ,
5050 'click .js-buyWizardSendPurchase' : 'sendPurchase' ,
5151 'click .js-buyWizardPurchaseBack' : 'backPurchase' ,
@@ -235,20 +235,22 @@ module.exports = baseVw.extend({
235235 this . $el . find ( '.js-buyWizardAddress' ) . addClass ( 'hide' ) ;
236236 this . $el . find ( '.js-buyWizardNewAddress' ) . removeClass ( 'hide' ) ;
237237 this . $el . find ( '#buyWizardNameInput' ) . focus ( ) ;
238+ this . $el . addClass ( 'addressFormOpened' ) ;
238239 this . $buyWizardMap . find ( 'iframe' ) . addClass ( 'blurMore' ) ;
239240
240241 //set chosen inputs
241242 $ ( '.chosen' ) . chosen ( ) ;
242243 } ,
243244
245+ onAddressCancel : function ( e ) {
246+ this . $buyWizardMap . find ( 'iframe' ) . removeClass ( 'blurMore' ) ;
247+ this . hideNewAddress ( ) ;
248+ } ,
249+
244250 hideNewAddress : function ( e ) {
245- "use strict" ;
246251 this . $el . find ( '.js-buyWizardAddress' ) . removeClass ( 'hide' ) ;
247252 this . $el . find ( '.js-buyWizardNewAddress' ) . addClass ( 'hide' ) ;
248-
249- if ( e && $ ( e . target ) . hasClass ( 'js-buyWizardNewAddressCancel' ) ) {
250- this . $buyWizardMap . find ( 'iframe' ) . removeClass ( 'blurMore' ) ;
251- }
253+ this . $el . removeClass ( 'addressFormOpened' ) ;
252254 } ,
253255
254256 addressSelected : function ( selectedAddress ) {
@@ -372,7 +374,7 @@ module.exports = baseVw.extend({
372374 var addressString = "" ,
373375 $currentIframe ;
374376
375- this . $buyWizardMap . find ( 'iframe .js-iframe-pending, iframe .js-iframe-leaving' )
377+ this . $buyWizardMap . find ( '.js-iframe-pending, .js-iframe-leaving' )
376378 . remove ( ) ;
377379 $currentIframe = this . $buyWizardMap . find ( 'iframe' ) ;
378380 $currentIframe . addClass ( 'blurMore' ) ;
@@ -385,18 +387,18 @@ module.exports = baseVw.extend({
385387 }
386388
387389 addressString = encodeURIComponent ( addressString ) ;
388- $iFrame = $ ( '<iframe class="js-buyWizardMap js- iframe-pending positionTop" width="525" height="350" frameborder="0" style="border:0; margin-top: 0; height: 262px" />' ) ;
390+ $iFrame = $ ( '<iframe class="js-iframe-pending positionTop" width="525" height="350" frameborder="0" style="border:0; margin-top: 0; height: 262px" />' ) ;
389391
390392 if ( $currentIframe . length ) {
391- this . $buyWizardMap . find ( '.spinner ' ) . removeClass ( 'hide' ) ;
393+ this . $buyWizardMap . find ( '.js-mapSpinner ' ) . removeClass ( 'hide' ) ;
392394 $iFrame . insertBefore ( $currentIframe ) ;
393395 } else {
394396 this . $buyWizardMap . find ( '.flexContainer' )
395397 . prepend ( $iFrame ) ;
396398 }
397399
398400 $iFrame . on ( 'load' , ( ) => {
399- this . $buyWizardMap . find ( '.spinner ' ) . addClass ( 'hide' ) ;
401+ this . $buyWizardMap . find ( '.js-mapSpinner ' ) . addClass ( 'hide' ) ;
400402
401403 $currentIframe . addClass ( 'js-iframe-leaving' )
402404 . fadeOut ( {
0 commit comments