# imagify/1.10/assets/js/admin-bar.js

Imagify Image Optimization: Optimize Images | Compress &amp; Convert to WebP/AVIF, version 1.10. 38 lines.

- Page: https://pluginprobe.com/plugins/imagify/1.10/code/assets/js/admin-bar.js
- Raw: https://pluginprobe.com/plugins/imagify/1.10/raw/assets/js/admin-bar.js
- Modified: 2017-10-04T15:18:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/imagify/1.10/code/assets/js/admin-bar.js#L10-L20`.

```javascript
// Admin bar =======================================================================================
(function($, d, w, undefined) { // eslint-disable-line no-unused-vars, no-shadow, no-shadow-restricted-names

	var busy = false;

	$( d ).on( 'mouseenter', '#wp-admin-bar-imagify', function() {
		var $adminBarProfile, url;

		if ( true === busy ) {
			return;
		}

		busy = true;

		$adminBarProfile = $( '#wp-admin-bar-imagify-profile-content' );

		if ( ! $adminBarProfile.is( ':empty' ) ) {
			return;
		}

		if ( w.ajaxurl ) {
			url = w.ajaxurl;
		} else {
			url = w.imagifyAdminBar.ajaxurl;
		}

		url += url.indexOf( '?' ) > 0 ? '&' : '?';

		$.get( url + 'action=imagify_get_admin_bar_profile&imagifygetadminbarprofilenonce=' + $( '#imagifygetadminbarprofilenonce' ).val() )
			.done( function( response ) {
				$adminBarProfile.html( response.data );
				$( '#wp-admin-bar-imagify-profile-loading' ).remove();
				busy = false;
			} );
	} );

} )(jQuery, document, window);

```
