mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 04:05:42 +01:00
Remove jQuery .attr
from the user search box (#29919)
- Switched from jQuery `.attr` to plain javascript `.getAttribute` - Tested the user search box and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com> (cherry picked from commit adc61c5d71651acc316bbc3a7fee6f2c0c60b06e)
This commit is contained in:
parent
872287c380
commit
e358500519
1 changed files with 6 additions and 3 deletions
|
@ -5,9 +5,12 @@ const {appSubUrl} = window.config;
|
||||||
const looksLikeEmailAddressCheck = /^\S+@\S+$/;
|
const looksLikeEmailAddressCheck = /^\S+@\S+$/;
|
||||||
|
|
||||||
export function initCompSearchUserBox() {
|
export function initCompSearchUserBox() {
|
||||||
const $searchUserBox = $('#search-user-box');
|
const searchUserBox = document.getElementById('search-user-box');
|
||||||
const allowEmailInput = $searchUserBox.attr('data-allow-email') === 'true';
|
if (!searchUserBox) return;
|
||||||
const allowEmailDescription = $searchUserBox.attr('data-allow-email-description');
|
|
||||||
|
const $searchUserBox = $(searchUserBox);
|
||||||
|
const allowEmailInput = searchUserBox.getAttribute('data-allow-email') === 'true';
|
||||||
|
const allowEmailDescription = searchUserBox.getAttribute('data-allow-email-description') ?? undefined;
|
||||||
$searchUserBox.search({
|
$searchUserBox.search({
|
||||||
minCharacters: 2,
|
minCharacters: 2,
|
||||||
apiSettings: {
|
apiSettings: {
|
||||||
|
|
Loading…
Reference in a new issue