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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
3422cca4
Commit
3422cca4
authored
Aug 14, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the project_select_tag to specify an initial value and for the selection to be clear-able
parent
f6f62950
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
app/assets/javascripts/project_select.js
app/assets/javascripts/project_select.js
+8
-0
No files found.
app/assets/javascripts/project_select.js
View file @
3422cca4
...
...
@@ -14,6 +14,7 @@ export default function projectSelect() {
this
.
orderBy
=
$
(
select
).
data
(
'
orderBy
'
)
||
'
id
'
;
this
.
withIssuesEnabled
=
$
(
select
).
data
(
'
withIssuesEnabled
'
);
this
.
withMergeRequestsEnabled
=
$
(
select
).
data
(
'
withMergeRequestsEnabled
'
);
this
.
allowClear
=
$
(
select
).
data
(
'
allowClear
'
)
||
false
;
placeholder
=
"
Search for project
"
;
if
(
this
.
includeGroups
)
{
...
...
@@ -71,6 +72,13 @@ export default function projectSelect() {
text
:
function
(
project
)
{
return
project
.
name_with_namespace
||
project
.
name
;
},
initSelection
:
function
(
el
,
callback
)
{
return
Api
.
project
(
el
.
val
()).
then
(({
data
})
=>
callback
(
data
));
},
allowClear
:
this
.
allowClear
,
dropdownCssClass
:
"
ajax-project-dropdown
"
});
if
(
simpleFilter
)
return
select
;
...
...
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