Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
yugioh-ccb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
yugioh-ccb
Commits
58d17d33
Commit
58d17d33
authored
May 05, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fetchSuggestions add debounce
parent
69e8ab72
Pipeline
#35937
passed with stages
in 2 minutes and 25 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
templates/index.html
templates/index.html
+9
-1
No files found.
templates/index.html
View file @
58d17d33
...
...
@@ -196,7 +196,14 @@
{% endif %}
<script>
async
function
fetchSuggestions
()
{
function
debounce
(
fn
,
delay
)
{
let
timeout
=
null
;
return
function
(...
args
)
{
clearTimeout
(
timeout
);
timeout
=
setTimeout
(()
=>
fn
.
apply
(
this
,
args
),
delay
);
};
}
async
function
_fetchSuggestions
()
{
const
input
=
document
.
getElementById
(
"
guess
"
);
const
hid
=
document
.
getElementById
(
"
guess_id
"
);
const
sug
=
document
.
getElementById
(
"
suggestions
"
);
...
...
@@ -219,6 +226,7 @@
}
sug
.
hidden
=
false
;
}
const
fetchSuggestions
=
debounce
(
_fetchSuggestions
,
300
);
document
.
addEventListener
(
'
click
'
,
e
=>
{
if
(
!
e
.
target
.
closest
(
'
#guess
'
))
{
document
.
getElementById
(
"
suggestions
"
).
hidden
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment