Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
837aa950
Commit
837aa950
authored
Jun 01, 2021
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refined dropdown_filter id assignment
parent
85b64d5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
app/helpers/dropdowns_helper.rb
app/helpers/dropdowns_helper.rb
+1
-2
app/views/projects/merge_requests/tabs/_tab.html.haml
app/views/projects/merge_requests/tabs/_tab.html.haml
+2
-2
No files found.
app/helpers/dropdowns_helper.rb
View file @
837aa950
...
...
@@ -102,8 +102,7 @@ module DropdownsHelper
def
dropdown_filter
(
placeholder
,
search_id:
nil
)
content_tag
:div
,
class:
"dropdown-input"
do
dropdown_id
=
search_id
||
(
placeholder
&
.
parameterize
||
"filter"
)
+
"-dropdown-input-"
+
rand
(
1
..
100
).
to_s
filter_output
=
search_field_tag
dropdown_id
,
nil
,
data:
{
qa_selector:
"dropdown_input_field"
},
class:
"dropdown-input-field"
,
placeholder:
placeholder
,
autocomplete:
'off'
filter_output
=
search_field_tag
search_id
,
nil
,
data:
{
qa_selector:
"dropdown_input_field"
},
id:
nil
,
class:
"dropdown-input-field"
,
placeholder:
placeholder
,
autocomplete:
'off'
filter_output
<<
sprite_icon
(
'search'
,
css_class:
'dropdown-input-search'
)
filter_output
<<
sprite_icon
(
'close'
,
size:
16
,
css_class:
'dropdown-input-clear js-dropdown-input-clear'
)
...
...
app/views/projects/merge_requests/tabs/_tab.html.haml
View file @
837aa950
-
tab_name
=
local_assigns
.
fetch
(
:name
,
nil
)
-
tab_class
=
local_assigns
.
fetch
(
:class
,
nil
)
-
qa_selector
=
local_assigns
.
fetch
(
:qa_selector
,
nil
)
-
id
=
local_assigns
.
fetch
(
:id
,
nil
)
-
tab_
id
=
local_assigns
.
fetch
(
:id
,
nil
)
%li
{
class:
[
tab_class
,
(
"active"
if
params
[
:tab
]
==
tab_name
)],
id:
id
||
tab_class
,
data:
{
qa_selector:
qa_selector
}
}
%li
{
(
tab_id
?
{
id:
tab_id
}
:
{}),
class:
[
tab_class
,
(
"active"
if
params
[
:tab
]
==
tab_name
)]
,
data:
{
qa_selector:
qa_selector
}
}
=
yield
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