v1.18.x
barisusakli 10 years ago
parent 8e74d8f4fa
commit 536c443c1e

@ -283,10 +283,9 @@ define('admin/manage/category', [
});
modal.on('shown.bs.modal', function() {
var inputEl = modal.find('input'),
searchObj = autocomplete.user(inputEl);
var inputEl = modal.find('input');
searchObj.on('autocompleteselect', function(ev, ui) {
autocomplete.user(inputEl, function(ev, ui) {
socket.emit('admin.categories.setPrivilege', {
cid: ajaxify.variables.get('cid'),
privilege: ['find', 'read'],
@ -312,10 +311,9 @@ define('admin/manage/category', [
});
modal.on('shown.bs.modal', function() {
var inputEl = modal.find('input'),
searchObj = autocomplete.group(inputEl);
var inputEl = modal.find('input');
searchObj.on('autocompleteselect', function(ev, ui) {
autocomplete.group(inputEl, function(ev, ui) {
socket.emit('admin.categories.setPrivilege', {
cid: ajaxify.variables.get('cid'),
privilege: ['groups:find', 'groups:read'],

@ -6,10 +6,11 @@
define('autocomplete', function() {
var module = {};
module.user = function (input) {
module.user = function (input, onselect) {
app.loadJQueryUI(function() {
return input.autocomplete({
input.autocomplete({
delay: 100,
select: onselect,
source: function(request, response) {
socket.emit('user.search', {query: request.term}, function(err, result) {
if (err) {
@ -37,10 +38,11 @@ define('autocomplete', function() {
});
};
module.group = function(input) {
module.group = function(input, onselect) {
app.loadJQueryUI(function() {
return input.autocomplete({
input.autocomplete({
delay: 100,
select: onselect,
source: function(request, response) {
socket.emit('groups.search', {
query: request.term,

Loading…
Cancel
Save