Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e2918275
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e2918275
编写于
7月 13, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
get rid of another container array
上级
4cc1afab
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
13 deletion
+12
-13
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
...workbench/browser/parts/editor/sideBySideEditorControl.ts
+11
-13
src/vs/workbench/browser/parts/editor/titleControl.ts
src/vs/workbench/browser/parts/editor/titleControl.ts
+1
-0
未找到文件。
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
浏览文件 @
e2918275
...
...
@@ -102,7 +102,6 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
private
containers
:
Builder
[];
private
titleContainer
:
Builder
[];
private
titleAreaControl
:
ITitleAreaControl
[];
private
progressBar
:
ProgressBar
[];
...
...
@@ -148,7 +147,6 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
this
.
containers
=
[];
this
.
titleContainer
=
[];
this
.
titleAreaControl
=
[];
this
.
progressBar
=
[];
...
...
@@ -176,7 +174,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
POSITIONS
.
forEach
(
position
=>
{
// TItle Container
const
titleContainer
=
this
.
titleContainer
[
position
]
;
const
titleContainer
=
$
(
this
.
titleAreaControl
[
position
].
getContainer
())
;
if
(
useTabs
)
{
titleContainer
.
addClass
(
'
tabs
'
);
}
else
{
...
...
@@ -191,10 +189,10 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
// Dispose old
titleControl
.
dispose
();
t
his
.
titleContainer
[
position
]
.
empty
();
t
itleContainer
.
empty
();
// Create new
this
.
createTitleControl
(
position
);
this
.
createTitleControl
(
position
,
titleContainer
);
}
}
});
...
...
@@ -755,14 +753,14 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
// Title containers
const
useTabs
=
!!
this
.
configurationService
.
getConfiguration
<
IWorkbenchEditorConfiguration
>
().
workbench
.
editor
.
showTabs
;
POSITIONS
.
forEach
(
position
=>
{
this
.
titleContainer
[
position
]
=
$
(
this
.
containers
[
position
]).
div
({
'
class
'
:
'
title
'
});
const
titleContainer
=
$
(
this
.
containers
[
position
]).
div
({
'
class
'
:
'
title
'
});
if
(
useTabs
)
{
t
his
.
titleContainer
[
position
]
.
addClass
(
'
tabs
'
);
t
itleContainer
.
addClass
(
'
tabs
'
);
}
this
.
hookTitleDragListener
(
position
);
this
.
hookTitleDragListener
(
position
,
titleContainer
);
// Title Control
this
.
createTitleControl
(
position
);
this
.
createTitleControl
(
position
,
titleContainer
);
});
// Progress Bars per position
...
...
@@ -1018,20 +1016,20 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
});
}
private
createTitleControl
(
position
:
Position
):
void
{
private
createTitleControl
(
position
:
Position
,
container
:
Builder
):
void
{
const
useTabs
=
!!
this
.
configurationService
.
getConfiguration
<
IWorkbenchEditorConfiguration
>
().
workbench
.
editor
.
showTabs
;
this
.
titleAreaControl
[
position
]
=
this
.
instantiationServices
[
position
].
createInstance
<
ITitleAreaControl
>
(
useTabs
?
TabsTitleControl
:
NoTabsTitleControl
);
this
.
titleAreaControl
[
position
].
create
(
this
.
titleContainer
[
position
]
.
getHTMLElement
());
this
.
titleAreaControl
[
position
].
create
(
container
.
getHTMLElement
());
this
.
titleAreaControl
[
position
].
setContext
(
this
.
stacks
.
groupAt
(
position
));
this
.
titleAreaControl
[
position
].
refresh
();
}
private
hookTitleDragListener
(
position
:
Position
):
void
{
private
hookTitleDragListener
(
position
:
number
,
container
:
Builder
):
void
{
let
wasDragged
=
false
;
// Allow to reorder positions by dragging the title
this
.
titleContainer
[
position
]
.
on
(
DOM
.
EventType
.
MOUSE_DOWN
,
(
e
:
MouseEvent
)
=>
{
container
.
on
(
DOM
.
EventType
.
MOUSE_DOWN
,
(
e
:
MouseEvent
)
=>
{
if
(
!
this
.
titleAreaControl
[
position
].
allowDragging
(
<
any
>
e
.
target
||
e
.
srcElement
))
{
return
;
// return early if we are not in the drag zone of the title widget
}
...
...
src/vs/workbench/browser/parts/editor/titleControl.ts
浏览文件 @
e2918275
...
...
@@ -44,6 +44,7 @@ export interface ITitleAreaControl {
setContext
(
group
:
IEditorGroup
):
void
;
allowDragging
(
element
:
HTMLElement
):
boolean
;
create
(
parent
:
HTMLElement
):
void
;
getContainer
():
HTMLElement
;
refresh
(
instant
?:
boolean
):
void
;
update
(
instant
?:
boolean
):
void
;
layout
():
void
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录