WordPress/wp-admin/js/user-suggest.js
Andrew Nacin 7d1fda5b52 JSHint fixes for user-suggest.js.
props dougwollison.
fixes #26017.

Built from https://develop.svn.wordpress.org/trunk@26238


git-svn-id: http://core.svn.wordpress.org/trunk@26145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-16 20:41:12 +00:00

24 lines
673 B
JavaScript

/* global ajaxurl, current_site_id, isRtl */
(function( $ ) {
var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
$(document).ready( function() {
var position = { offset: '0, -1' };
if ( typeof isRtl !== 'undefined' && isRtl ) {
position.my = 'right top';
position.at = 'right bottom';
}
$( '.wp-suggest-user' ).autocomplete({
source: ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id,
delay: 500,
minLength: 2,
position: position,
open: function() {
$( this ).addClass( 'open' );
},
close: function() {
$( this ).removeClass( 'open' );
}
});
});
})( jQuery );