Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
504b058e
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
504b058e
编写于
3月 16, 2019
作者:
P
Peng Lyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Comment Action Toolbar
上级
06ac1a1d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
10 deletion
+21
-10
src/vs/workbench/contrib/comments/electron-browser/commentNode.ts
...orkbench/contrib/comments/electron-browser/commentNode.ts
+21
-10
未找到文件。
src/vs/workbench/contrib/comments/electron-browser/commentNode.ts
浏览文件 @
504b058e
...
...
@@ -48,8 +48,9 @@ export class CommentNode extends Disposable {
private
_editAction
:
Action
;
private
_commentEditContainer
:
HTMLElement
;
private
_commentDetailsContainer
:
HTMLElement
;
private
_actionsToolbarContainer
:
HTMLElement
;
private
_reactionsActionBar
?:
ActionBar
;
private
_
a
ctionsContainer
?:
HTMLElement
;
private
_
reactionA
ctionsContainer
?:
HTMLElement
;
private
_commentEditor
:
SimpleCommentEditor
|
null
;
private
_commentEditorDisposables
:
IDisposable
[]
=
[];
private
_commentEditorModel
:
ITextModel
;
...
...
@@ -133,6 +134,11 @@ export class CommentNode extends Disposable {
this
.
_isPendingLabel
.
innerText
=
''
;
}
this
.
_actionsToolbarContainer
=
dom
.
append
(
header
,
dom
.
$
(
'
.comment-actions.hidden
'
));
this
.
createActionsToolbar
();
}
private
createActionsToolbar
()
{
const
actions
:
Action
[]
=
[];
let
reactionGroup
=
this
.
commentService
.
getReactionGroup
(
this
.
owner
);
...
...
@@ -148,7 +154,7 @@ export class CommentNode extends Disposable {
}
if
(
this
.
comment
.
canEdit
||
this
.
comment
.
editCommand
)
{
this
.
_editAction
=
this
.
createEditAction
(
commentDetailsContainer
);
this
.
_editAction
=
this
.
createEditAction
(
this
.
_
commentDetailsContainer
);
actions
.
push
(
this
.
_editAction
);
}
...
...
@@ -158,9 +164,7 @@ export class CommentNode extends Disposable {
}
if
(
actions
.
length
)
{
const
actionsContainer
=
dom
.
append
(
header
,
dom
.
$
(
'
.comment-actions.hidden
'
));
this
.
toolbar
=
new
ToolBar
(
actionsContainer
,
this
.
contextMenuService
,
{
this
.
toolbar
=
new
ToolBar
(
this
.
_actionsToolbarContainer
,
this
.
contextMenuService
,
{
actionItemProvider
:
action
=>
{
if
(
action
.
id
===
ToggleReactionsAction
.
ID
)
{
return
new
DropdownMenuActionItem
(
...
...
@@ -181,7 +185,7 @@ export class CommentNode extends Disposable {
orientation
:
ActionsOrientation
.
HORIZONTAL
});
this
.
registerActionBarListeners
(
actions
Container
);
this
.
registerActionBarListeners
(
this
.
_actionsToolbar
Container
);
this
.
toolbar
.
setActions
(
actions
,
[])();
this
.
_toDispose
.
push
(
this
.
toolbar
);
}
...
...
@@ -297,8 +301,8 @@ export class CommentNode extends Disposable {
}
private
createReactionsContainer
(
commentDetailsContainer
:
HTMLElement
):
void
{
this
.
_
a
ctionsContainer
=
dom
.
append
(
commentDetailsContainer
,
dom
.
$
(
'
div.comment-reactions
'
));
this
.
_reactionsActionBar
=
new
ActionBar
(
this
.
_
a
ctionsContainer
,
{
this
.
_
reactionA
ctionsContainer
=
dom
.
append
(
commentDetailsContainer
,
dom
.
$
(
'
div.comment-reactions
'
));
this
.
_reactionsActionBar
=
new
ActionBar
(
this
.
_
reactionA
ctionsContainer
,
{
actionItemProvider
:
action
=>
{
if
(
action
.
id
===
ToggleReactionsAction
.
ID
)
{
return
new
DropdownMenuActionItem
(
...
...
@@ -577,8 +581,15 @@ export class CommentNode extends Disposable {
this
.
_body
.
appendChild
(
this
.
_md
);
}
const
shouldUpdateActions
=
newComment
.
editCommand
!==
this
.
comment
.
editCommand
||
newComment
.
deleteCommand
!==
this
.
comment
.
deleteCommand
;
this
.
comment
=
newComment
;
if
(
shouldUpdateActions
)
{
dom
.
clearNode
(
this
.
_actionsToolbarContainer
);
this
.
createActionsToolbar
();
}
if
(
newComment
.
label
)
{
this
.
_isPendingLabel
.
innerText
=
newComment
.
label
;
}
else
if
(
newComment
.
isDraft
)
{
...
...
@@ -588,8 +599,8 @@ export class CommentNode extends Disposable {
}
// update comment reactions
if
(
this
.
_
a
ctionsContainer
)
{
this
.
_
a
ctionsContainer
.
remove
();
if
(
this
.
_
reactionA
ctionsContainer
)
{
this
.
_
reactionA
ctionsContainer
.
remove
();
}
if
(
this
.
_reactionsActionBar
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录