| @@ -54,24 +54,34 @@ | ||
| 54 | 54 | }, |
| 55 | 55 | beforeSend: function() { |
| 56 | 56 | $body.css( { cursor: 'wait' } ); |
| 57 | 57 | |
| 58 | - $cloneResolutionNotice.find( '.button' ).addClass( 'disabled' ); | |
| 58 | + $this.addClass( 'disabled' ); | |
| 59 | 59 | |
| 60 | + if ( $this.attr( 'id' ) === 'fs_temporary_duplicate_license_activation_link' ) { | |
| 61 | + $this.append( '<i class="fs-ajax-spinner"></i>' ); | |
| 62 | + } | |
| 63 | + | |
| 60 | 64 | $( window ).on( 'beforeunload', beforeUnload ); |
| 61 | 65 | }, |
| 62 | 66 | success : function( resultObj ) { |
| 63 | 67 | $( window ).off( 'beforeunload', beforeUnload ); |
| 64 | 68 | |
| 65 | - if ( resultObj.data.redirect_url && '' !== resultObj.data.redirect_url ) { | |
| 69 | + if ( | |
| 70 | + resultObj.data && | |
| 71 | + resultObj.data.redirect_url && | |
| 72 | + '' !== resultObj.data.redirect_url | |
| 73 | + ) { | |
| 66 | 74 | window.location = resultObj.data.redirect_url; |
| 67 | 75 | } else { |
| 68 | 76 | window.location.reload(); |
| 69 | 77 | } |
| 70 | 78 | }, |
| 71 | - error : function() { | |
| 79 | + complete : function() { | |
| 72 | 80 | $body.css( { cursor: cursor } ); |
| 73 | - $cloneResolutionNotice.find( '.button' ).removeClass( 'disabled' ); | |
| 81 | + $this.removeClass( 'disabled' ); | |
| 82 | + | |
| 83 | + $this.parent().find( '.fs-ajax-spinner' ).remove(); | |
| 74 | 84 | } |
| 75 | 85 | } ); |
| 76 | 86 | } ); |
| 77 | 87 | } ); |