2012-02-10 09:45:17 +01:00
|
|
|
jQuery( function($) {
|
2012-06-04 16:50:50 +02:00
|
|
|
var id = typeof( current_site_id ) != 'undefined' ? '&site_id=' + current_site_id : '',
|
|
|
|
isRTL = !! ( 'undefined' != typeof isRtl && isRtl ),
|
|
|
|
position = isRTL ? { my: 'right top', at: 'right bottom', offset: '0, -1' } : { offset: '0, -1' },
|
|
|
|
open = function(e, ui) {
|
|
|
|
$(this).addClass('open');
|
|
|
|
},
|
|
|
|
close = function(e, ui) {
|
|
|
|
$(this).removeClass('open');
|
|
|
|
};
|
2012-02-10 09:45:17 +01:00
|
|
|
|
|
|
|
$( '#adduser-email, #newuser' ).autocomplete({
|
2012-06-04 16:50:50 +02:00
|
|
|
source: ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id,
|
|
|
|
delay: 500,
|
2012-05-02 23:33:43 +02:00
|
|
|
minLength: 2,
|
2012-06-04 16:50:50 +02:00
|
|
|
position: position,
|
|
|
|
open: open,
|
|
|
|
close: close
|
2012-02-10 09:45:17 +01:00
|
|
|
});
|
2012-03-24 05:54:58 +01:00
|
|
|
|
|
|
|
$( '#user-search-input' ).autocomplete({
|
2012-06-04 16:50:50 +02:00
|
|
|
source: ajaxurl + '?action=autocomplete-user&autocomplete_type=search' + id,
|
|
|
|
delay: 500,
|
2012-05-02 23:33:43 +02:00
|
|
|
minLength: 2,
|
2012-06-04 16:50:50 +02:00
|
|
|
position: position,
|
|
|
|
open: open,
|
|
|
|
close: close
|
2012-03-24 05:54:58 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$( '#all-user-search-input' ).autocomplete({
|
2012-06-04 16:50:50 +02:00
|
|
|
source: ajaxurl + '?action=autocomplete-user&autocomplete_type=search-all' + id,
|
|
|
|
delay: 500,
|
2012-05-02 23:33:43 +02:00
|
|
|
minLength: 2,
|
2012-06-04 16:50:50 +02:00
|
|
|
position: position,
|
|
|
|
open: open,
|
|
|
|
close: close
|
2012-03-24 05:54:58 +01:00
|
|
|
});
|
|
|
|
});
|