Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
4ab6bfce
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4ab6bfce
编写于
4月 26, 2016
作者:
A
Alfredo Sumaran
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Set indeterminated items
上级
243e5132
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
58 addition
and
6 deletion
+58
-6
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+13
-1
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+30
-2
app/assets/stylesheets/framework/dropdowns.scss
app/assets/stylesheets/framework/dropdowns.scss
+9
-2
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+5
-0
app/views/projects/issues/_issue.html.haml
app/views/projects/issues/_issue.html.haml
+1
-1
未找到文件。
app/assets/javascripts/gl_dropdown.js.coffee
浏览文件 @
4ab6bfce
...
...
@@ -11,6 +11,8 @@ class GitLabDropdownFilter
$inputContainer
=
@
input
.
parent
()
$clearButton
=
$inputContainer
.
find
(
'.js-dropdown-input-clear'
)
@
indeterminatedIds
=
[]
# Clear click
$clearButton
.
on
'click'
,
(
e
)
=>
e
.
preventDefault
()
...
...
@@ -298,6 +300,13 @@ class GitLabDropdown
opened
:
=>
@
addArrowKeyEvent
()
if
@
options
.
setIndeterminatedIds
@
options
.
setIndeterminatedIds
.
call
(
@
)
# Makes indeterminated items effective
if
@
fullData
and
@
dropdown
.
find
(
'.dropdown-menu-toggle'
).
hasClass
(
'js-filter-bulk-update'
)
@
parseData
@
fullData
contentHtml
=
$
(
'.dropdown-content'
,
@
dropdown
).
html
()
if
@
remote
&&
contentHtml
is
""
@
remote
.
execute
()
...
...
@@ -309,6 +318,9 @@ class GitLabDropdown
hidden
:
(
e
)
=>
@
removeArrayKeyEvent
()
return
if
@
dropdown
.
find
(
'.dropdown-menu-toggle'
).
hasClass
(
'js-filter-bulk-update'
)
if
@
options
.
filterable
@
dropdown
.
find
(
".dropdown-input-field"
)
...
...
@@ -358,7 +370,7 @@ class GitLabDropdown
if
@
options
.
renderRow
# Call the render function
html
=
@
options
.
renderRow
(
data
)
html
=
@
options
.
renderRow
.
call
(
@
options
,
data
,
@
)
else
if
not
selected
value
=
if
@
options
.
id
then
@
options
.
id
(
data
)
else
data
.
id
...
...
app/assets/javascripts/labels_select.js.coffee
浏览文件 @
4ab6bfce
class
@
LabelsSelect
constructor
:
->
_this
=
@
$
(
'.js-label-select'
).
each
(
i
,
dropdown
)
->
$dropdown
=
$
(
dropdown
)
projectId
=
$dropdown
.
data
(
'project-id'
)
...
...
@@ -196,15 +198,25 @@ class @LabelsSelect
callback
data
renderRow
:
(
label
)
->
renderRow
:
(
label
,
instance
)
->
selectedClass
=
[]
removesAll
=
label
.
id
is
0
or
not
label
.
id
?
selectedClass
=
[]
if
$dropdown
.
hasClass
(
'js-filter-bulk-update'
)
indeterminated
=
instance
.
indeterminatedIds
if
indeterminated
.
indexOf
(
label
.
id
)
isnt
-
1
selectedClass
.
push
'indeterminated'
if
$form
.
find
(
"input[type='hidden']
\
[name='
#{
$dropdown
.
data
(
'fieldName'
)
}
']
\
[value='
#{
this
.
id
(
label
)
}
']"
).
length
selectedClass
.
push
'is-active'
index
=
selectedClass
.
indexOf
(
'indeterminated'
)
if
index
isnt
-
1
selectedClass
.
splice
(
index
,
1
)
if
$dropdown
.
hasClass
(
'js-multiselect'
)
and
removesAll
selectedClass
.
push
'dropdown-clear-active'
...
...
@@ -264,6 +276,8 @@ class @LabelsSelect
label
.
id
hidden
:
->
return
if
$dropdown
.
hasClass
(
'js-filter-bulk-update'
)
page
=
$
(
'body'
).
data
'page'
isIssueIndex
=
page
is
'projects:issues:index'
isMRIndex
=
page
is
'projects:merge_requests:index'
...
...
@@ -301,4 +315,18 @@ class @LabelsSelect
return
else
saveLabelData
()
setIndeterminatedIds
:
->
if
@
dropdown
.
find
(
'.dropdown-menu-toggle'
).
hasClass
(
'js-filter-bulk-update'
)
console
.
log
'options.setIndeterminatedIds'
@
indeterminatedIds
=
_this
.
getIndeterminatedIds
()
)
getIndeterminatedIds
:
->
label_ids
=
[]
$
(
'.selected_issue:checked'
).
each
(
i
,
el
)
->
issue_id
=
$
(
el
).
data
(
'id'
)
label_ids
.
push
$
(
"#issue_
#{
issue_id
}
"
).
data
(
'labels'
)
_
.
flatten
(
label_ids
)
app/assets/stylesheets/framework/dropdowns.scss
浏览文件 @
4ab6bfce
...
...
@@ -232,9 +232,8 @@
a
{
padding-left
:
25px
;
&
.i
s-active
{
&
.i
ndeterminated
,
&
.is-active
{
&
::before
{
content
:
"\f00c"
;
position
:
absolute
;
left
:
5px
;
top
:
50%
;
...
...
@@ -246,6 +245,14 @@
-moz-osx-font-smoothing
:
grayscale
;
}
}
&
.indeterminated
::before
{
content
:
"\f068"
;
}
&
.is-active
::before
{
content
:
"\f00c"
;
}
}
}
...
...
app/helpers/issuables_helper.rb
浏览文件 @
4ab6bfce
...
...
@@ -97,4 +97,9 @@ module IssuablesHelper
end
end
def
label_ids
(
issuable
)
return
nil
if
!
issuable
.
labels
.
any?
issuable
.
labels
.
pluck
:id
end
end
app/views/projects/issues/_issue.html.haml
浏览文件 @
4ab6bfce
%li
{
id:
dom_id
(
issue
),
class:
issue_css_classes
(
issue
),
url:
issue_path
(
issue
)
}
%li
{
id:
dom_id
(
issue
),
class:
issue_css_classes
(
issue
),
url:
issue_path
(
issue
)
,
:'data-labels'
=>
label_ids
(
issue
)
}
-
if
controller
.
controller_name
==
'issues'
&&
can?
(
current_user
,
:admin_issue
,
@project
)
.issue-check
=
check_box_tag
dom_id
(
issue
,
"selected"
),
nil
,
false
,
'data-id'
=>
issue
.
id
,
class:
"selected_issue"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录