| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | |
| 4 | 4 | var busy = false; |
| 5 | 5 | |
| 6 | 6 | $( d ).on( 'mouseenter', '#wp-admin-bar-imagify', function() { |
| 7 | - var $adminBarProfile, url; | |
| 7 | + var $adminBarProfile, url, $adminBarPricing; | |
| 8 | 8 | |
| 9 | 9 | if ( true === busy ) { |
| 10 | 10 | return; |
| 11 | 11 | } |
| @@ -12,8 +12,9 @@ | ||
| 12 | 12 | |
| 13 | 13 | busy = true; |
| 14 | 14 | |
| 15 | 15 | $adminBarProfile = $( '#wp-admin-bar-imagify-profile-content' ); |
| 16 | + $adminBarPricing = $( '#wp-admin-bar-imagify-pricing-content' ); | |
| 16 | 17 | |
| 17 | 18 | if ( ! $adminBarProfile.is( ':empty' ) ) { |
| 18 | 19 | return; |
| 19 | 20 | } |
| @@ -27,10 +28,20 @@ | ||
| 27 | 28 | url += url.indexOf( '?' ) > 0 ? '&' : '?'; |
| 28 | 29 | |
| 29 | 30 | $.get( url + 'action=imagify_get_admin_bar_profile&imagifygetadminbarprofilenonce=' + $( '#imagifygetadminbarprofilenonce' ).val() ) |
| 30 | 31 | .done( function( response ) { |
| 31 | - $adminBarProfile.html( response.data ); | |
| 32 | + var $templates = response.data; | |
| 32 | 33 | $( '#wp-admin-bar-imagify-profile-loading' ).remove(); |
| 34 | + if ( $templates.admin_bar_pricing ) { | |
| 35 | + $adminBarPricing.html( $templates.admin_bar_pricing ); | |
| 36 | + } else { | |
| 37 | + $adminBarPricing.remove(); | |
| 38 | + } | |
| 39 | + | |
| 40 | + if ( $templates.admin_bar_status ) { | |
| 41 | + $adminBarProfile.html( $templates.admin_bar_status ); | |
| 42 | + } | |
| 43 | + | |
| 33 | 44 | busy = false; |
| 34 | 45 | } ); |
| 35 | 46 | } ); |
| 36 | 47 | |