Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Secfit Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
T2
Secfit Frontend
Commits
74fda480
Commit
74fda480
authored
4 years ago
by
Håvard Borgen Myrekrok
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-search.js' into 'master'
fixed search.js See merge request
!8
parents
7466a397
dce4d8cb
No related branches found
No related tags found
1 merge request
!8
fixed search.js
Pipeline
#128074
passed
4 years ago
Stage: test
Stage: production
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
www/scripts/search.js
+6
-1
6 additions, 1 deletion
www/scripts/search.js
with
6 additions
and
1 deletion
www/scripts/search.js
+
6
−
1
View file @
74fda480
...
@@ -35,7 +35,12 @@ async function profileSearchSubmitted(event) {
...
@@ -35,7 +35,12 @@ async function profileSearchSubmitted(event) {
const
searchValue
=
document
.
getElementById
(
"
profileSearch
"
).
value
const
searchValue
=
document
.
getElementById
(
"
profileSearch
"
).
value
let
profileMatches
=
users
.
filter
((
user
)
=>
user
.
username
.
includes
(
searchValue
));
let
profileMatches
=
users
.
filter
((
user
)
=>
user
.
username
===
searchValue
);
//if there were no exact match, then check for partial match
if
(
profileMatches
.
length
===
0
){
profileMatches
=
users
.
filter
((
user
)
=>
user
.
username
.
includes
(
searchValue
));
}
try
{
try
{
window
.
location
.
assign
(
`profilepage.html?id=
${
profileMatches
[
0
].
id
}
`
);
window
.
location
.
assign
(
`profilepage.html?id=
${
profileMatches
[
0
].
id
}
`
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment