2013-11-16 15:41:12 -05:00
|
|
|
/* global ajaxurl, current_site_id, isRtl */
|
|
|
|
|
|
|
|
(function( $ ) {
|
|
|
|
var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
|
2012-08-22 20:04:18 -04:00
|
|
|
$(document).ready( function() {
|
2013-11-16 15:41:12 -05:00
|
|
|
var position = { offset: '0, -1' };
|
|
|
|
if ( typeof isRtl !== 'undefined' && isRtl ) {
|
|
|
|
position.my = 'right top';
|
|
|
|
position.at = 'right bottom';
|
|
|
|
}
|
2012-08-22 20:04:18 -04:00
|
|
|
$( '.wp-suggest-user' ).autocomplete({
|
|
|
|
source: ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id,
|
|
|
|
delay: 500,
|
|
|
|
minLength: 2,
|
2013-11-16 15:41:12 -05:00
|
|
|
position: position,
|
|
|
|
open: function() {
|
|
|
|
$( this ).addClass( 'open' );
|
|
|
|
},
|
|
|
|
close: function() {
|
|
|
|
$( this ).removeClass( 'open' );
|
|
|
|
}
|
2012-08-22 20:04:18 -04:00
|
|
|
});
|
|
|
|
});
|
2013-11-16 15:41:12 -05:00
|
|
|
})( jQuery );
|