fix: don't init autocomplete if user doesn't have privs

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 00d8ce2663
commit 8482a54a68

@ -188,16 +188,19 @@ define('forum/search', ['search', 'autocomplete', 'storage'], function (searchMo
confirmKeys: [13, 44], confirmKeys: [13, 44],
trimValue: true, trimValue: true,
}); });
if (app.user.privileges['search:users']) {
autocomplete.user(userEl.siblings('.bootstrap-tagsinput').find('input')); 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;
}); });

Loading…
Cancel
Save