mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: don't init autocomplete if user doesn't have privs
This commit is contained in:
@@ -188,15 +188,18 @@ define('forum/search', ['search', 'autocomplete', 'storage'], function (searchMo
|
|||||||
confirmKeys: [13, 44],
|
confirmKeys: [13, 44],
|
||||||
trimValue: true,
|
trimValue: true,
|
||||||
});
|
});
|
||||||
autocomplete.user(userEl.siblings('.bootstrap-tagsinput').find('input'));
|
if (app.user.privileges['search:users']) {
|
||||||
|
autocomplete.user(userEl.siblings('.bootstrap-tagsinput').find('input'));
|
||||||
|
}
|
||||||
|
|
||||||
var tagEl = $('#has-tags');
|
var tagEl = $('#has-tags');
|
||||||
tagEl.tagsinput({
|
tagEl.tagsinput({
|
||||||
confirmKeys: [13, 44],
|
confirmKeys: [13, 44],
|
||||||
trimValue: true,
|
trimValue: true,
|
||||||
});
|
});
|
||||||
|
if (app.user.privileges['search:tags']) {
|
||||||
autocomplete.tag(tagEl.siblings('.bootstrap-tagsinput').find('input'));
|
autocomplete.tag(tagEl.siblings('.bootstrap-tagsinput').find('input'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Search;
|
return Search;
|
||||||
|
|||||||
Reference in New Issue
Block a user