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
Jérome Perrin
gitlab-ce
Commits
d8aaf018
Commit
d8aaf018
authored
Apr 26, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle unchecking of indeterminate items
parent
eccc1f59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+24
-8
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+6
-3
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
d8aaf018
...
@@ -144,6 +144,7 @@ class GitLabDropdown
...
@@ -144,6 +144,7 @@ class GitLabDropdown
LOADING_CLASS
=
"is-loading"
LOADING_CLASS
=
"is-loading"
PAGE_TWO_CLASS
=
"is-page-two"
PAGE_TWO_CLASS
=
"is-page-two"
ACTIVE_CLASS
=
"is-active"
ACTIVE_CLASS
=
"is-active"
INDETERMINATE_CLASS
=
"is-indeterminate"
currentIndex
=
-
1
currentIndex
=
-
1
FILTER_INPUT
=
'.dropdown-input .dropdown-input-field'
FILTER_INPUT
=
'.dropdown-input .dropdown-input-field'
...
@@ -319,8 +320,6 @@ class GitLabDropdown
...
@@ -319,8 +320,6 @@ class GitLabDropdown
hidden
:
(
e
)
=>
hidden
:
(
e
)
=>
@
removeArrayKeyEvent
()
@
removeArrayKeyEvent
()
return
if
@
dropdown
.
find
(
'.dropdown-menu-toggle'
).
hasClass
(
'js-filter-bulk-update'
)
if
@
options
.
filterable
if
@
options
.
filterable
@
dropdown
@
dropdown
.
find
(
".dropdown-input-field"
)
.
find
(
".dropdown-input-field"
)
...
@@ -455,6 +454,17 @@ class GitLabDropdown
...
@@ -455,6 +454,17 @@ class GitLabDropdown
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggleLabel
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggleLabel
else
else
selectedObject
selectedObject
else
if
el
.
hasClass
(
INDETERMINATE_CLASS
)
el
.
addClass
ACTIVE_CLASS
el
.
removeClass
INDETERMINATE_CLASS
if
!
value
?
field
.
remove
()
if
!
field
.
length
and
fieldName
@
addInput
(
fieldName
,
value
)
return
selectedObject
else
else
if
not
@
options
.
multiSelect
or
el
.
hasClass
(
'dropdown-clear-active'
)
if
not
@
options
.
multiSelect
or
el
.
hasClass
(
'dropdown-clear-active'
)
@
dropdown
.
find
(
".
#{
ACTIVE_CLASS
}
"
).
removeClass
ACTIVE_CLASS
@
dropdown
.
find
(
".
#{
ACTIVE_CLASS
}
"
).
removeClass
ACTIVE_CLASS
...
@@ -471,17 +481,23 @@ class GitLabDropdown
...
@@ -471,17 +481,23 @@ class GitLabDropdown
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggleLabel
(
selectedObject
,
el
)
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggleLabel
(
selectedObject
,
el
)
if
value
?
if
value
?
if
!
field
.
length
and
fieldName
if
!
field
.
length
and
fieldName
# Create hidden input for form
@
addInput
(
fieldName
,
value
)
input
=
"<input type='hidden' name='
#{
fieldName
}
' value='
#{
value
}
' />"
if
@
options
.
inputId
?
input
=
$
(
input
)
.
attr
(
'id'
,
@
options
.
inputId
)
@
dropdown
.
before
input
else
else
field
.
val
value
field
.
val
value
return
selectedObject
return
selectedObject
addInput
:
(
fieldName
,
value
)
->
# Create hidden input for form
input
=
"<input type='hidden' name='
#{
fieldName
}
' value='
#{
value
}
' />"
if
@
options
.
inputId
?
input
=
$
(
input
)
.
attr
(
'id'
,
@
options
.
inputId
)
@
dropdown
.
before
input
removeInputs
:
->
@
dropdown
.
parent
().
find
(
'input[type="hidden"]'
).
remove
()
selectRowAtIndex
:
(
e
,
index
)
->
selectRowAtIndex
:
(
e
,
index
)
->
selector
=
".dropdown-content li:not(.divider,.dropdown-header,.separator):eq(
#{
index
}
) a"
selector
=
".dropdown-content li:not(.divider,.dropdown-header,.separator):eq(
#{
index
}
) a"
...
...
app/assets/javascripts/labels_select.js.coffee
View file @
d8aaf018
...
@@ -271,8 +271,6 @@ class @LabelsSelect
...
@@ -271,8 +271,6 @@ class @LabelsSelect
label
.
id
label
.
id
hidden
:
->
hidden
:
->
return
if
$dropdown
.
hasClass
(
'js-filter-bulk-update'
)
page
=
$
(
'body'
).
data
'page'
page
=
$
(
'body'
).
data
'page'
isIssueIndex
=
page
is
'projects:issues:index'
isIssueIndex
=
page
is
'projects:issues:index'
isMRIndex
=
page
is
'projects:merge_requests:index'
isMRIndex
=
page
is
'projects:merge_requests:index'
...
@@ -289,7 +287,12 @@ class @LabelsSelect
...
@@ -289,7 +287,12 @@ class @LabelsSelect
else
if
$dropdown
.
hasClass
(
'js-filter-submit'
)
else
if
$dropdown
.
hasClass
(
'js-filter-submit'
)
$dropdown
.
closest
(
'form'
).
submit
()
$dropdown
.
closest
(
'form'
).
submit
()
else
else
saveLabelData
()
if
not
$dropdown
.
hasClass
'js-filter-bulk-update'
saveLabelData
()
if
$dropdown
.
hasClass
(
'js-filter-bulk-update'
)
@
removeInputs
()
$dropdown
.
parent
().
find
(
'.is-active, .is-indeterminate'
).
removeClass
()
multiSelect
:
$dropdown
.
hasClass
'js-multiselect'
multiSelect
:
$dropdown
.
hasClass
'js-multiselect'
clicked
:
(
label
)
->
clicked
:
(
label
)
->
...
...
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