1 /* global ajaxurl, current_site_id, isRtl */
4 var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
5 $(document).ready( function() {
6 var position = { offset: '0, -1' };
7 if ( typeof isRtl !== 'undefined' && isRtl ) {
8 position.my = 'right top';
9 position.at = 'right bottom';
11 $( '.wp-suggest-user' ).each( function(){
12 var $this = $( this ),
13 autocompleteType = ( typeof $this.data( 'autocompleteType' ) !== 'undefined' ) ? $this.data( 'autocompleteType' ) : 'add',
14 autocompleteField = ( typeof $this.data( 'autocompleteField' ) !== 'undefined' ) ? $this.data( 'autocompleteField' ) : 'user_login';
17 source: ajaxurl + '?action=autocomplete-user&autocomplete_type=' + autocompleteType + '&autocomplete_field=' + autocompleteField + id,
22 $( this ).addClass( 'open' );
25 $( this ).removeClass( 'open' );