Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
79781e0f
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,发现更多精彩内容 >>
提交
79781e0f
编写于
6月 04, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extend disposable
上级
5d4e4242
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
16 deletion
+12
-16
src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts
src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts
+12
-16
未找到文件。
src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts
浏览文件 @
79781e0f
...
@@ -9,7 +9,7 @@ import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableEle
...
@@ -9,7 +9,7 @@ import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableEle
import
{
commonPrefixLength
}
from
'
vs/base/common/arrays
'
;
import
{
commonPrefixLength
}
from
'
vs/base/common/arrays
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
dispose
,
IDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
dispose
,
IDisposable
,
DisposableStore
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ScrollbarVisibility
}
from
'
vs/base/common/scrollable
'
;
import
{
ScrollbarVisibility
}
from
'
vs/base/common/scrollable
'
;
import
'
vs/css!./breadcrumbsWidget
'
;
import
'
vs/css!./breadcrumbsWidget
'
;
...
@@ -55,16 +55,15 @@ export interface IBreadcrumbsItemEvent {
...
@@ -55,16 +55,15 @@ export interface IBreadcrumbsItemEvent {
payload
:
any
;
payload
:
any
;
}
}
export
class
BreadcrumbsWidget
{
export
class
BreadcrumbsWidget
extends
Disposable
{
private
readonly
_disposables
=
new
Array
<
IDisposable
>
();
private
readonly
_domNode
:
HTMLDivElement
;
private
readonly
_domNode
:
HTMLDivElement
;
private
readonly
_styleElement
:
HTMLStyleElement
;
private
readonly
_styleElement
:
HTMLStyleElement
;
private
readonly
_scrollable
:
DomScrollableElement
;
private
readonly
_scrollable
:
DomScrollableElement
;
private
readonly
_onDidSelectItem
=
new
Emitter
<
IBreadcrumbsItemEvent
>
(
);
private
readonly
_onDidSelectItem
=
this
.
_register
(
new
Emitter
<
IBreadcrumbsItemEvent
>
()
);
private
readonly
_onDidFocusItem
=
new
Emitter
<
IBreadcrumbsItemEvent
>
(
);
private
readonly
_onDidFocusItem
=
this
.
_register
(
new
Emitter
<
IBreadcrumbsItemEvent
>
()
);
private
readonly
_onDidChangeFocus
=
new
Emitter
<
boolean
>
(
);
private
readonly
_onDidChangeFocus
=
this
.
_register
(
new
Emitter
<
boolean
>
()
);
readonly
onDidSelectItem
:
Event
<
IBreadcrumbsItemEvent
>
=
this
.
_onDidSelectItem
.
event
;
readonly
onDidSelectItem
:
Event
<
IBreadcrumbsItemEvent
>
=
this
.
_onDidSelectItem
.
event
;
readonly
onDidFocusItem
:
Event
<
IBreadcrumbsItemEvent
>
=
this
.
_onDidFocusItem
.
event
;
readonly
onDidFocusItem
:
Event
<
IBreadcrumbsItemEvent
>
=
this
.
_onDidFocusItem
.
event
;
...
@@ -83,6 +82,7 @@ export class BreadcrumbsWidget {
...
@@ -83,6 +82,7 @@ export class BreadcrumbsWidget {
constructor
(
constructor
(
container
:
HTMLElement
container
:
HTMLElement
)
{
)
{
super
();
this
.
_domNode
=
document
.
createElement
(
'
div
'
);
this
.
_domNode
=
document
.
createElement
(
'
div
'
);
this
.
_domNode
.
className
=
'
monaco-breadcrumbs
'
;
this
.
_domNode
.
className
=
'
monaco-breadcrumbs
'
;
this
.
_domNode
.
tabIndex
=
0
;
this
.
_domNode
.
tabIndex
=
0
;
...
@@ -94,26 +94,22 @@ export class BreadcrumbsWidget {
...
@@ -94,26 +94,22 @@ export class BreadcrumbsWidget {
useShadows
:
false
,
useShadows
:
false
,
scrollYToX
:
true
scrollYToX
:
true
});
});
this
.
_
disposables
.
push
(
this
.
_scrollable
);
this
.
_
register
(
this
.
_scrollable
);
this
.
_
disposables
.
push
(
dom
.
addStandardDisposableListener
(
this
.
_domNode
,
'
click
'
,
e
=>
this
.
_onClick
(
e
)));
this
.
_
register
(
dom
.
addStandardDisposableListener
(
this
.
_domNode
,
'
click
'
,
e
=>
this
.
_onClick
(
e
)));
container
.
appendChild
(
this
.
_scrollable
.
getDomNode
());
container
.
appendChild
(
this
.
_scrollable
.
getDomNode
());
this
.
_styleElement
=
dom
.
createStyleSheet
(
this
.
_domNode
);
this
.
_styleElement
=
dom
.
createStyleSheet
(
this
.
_domNode
);
let
focusTracker
=
dom
.
trackFocus
(
this
.
_domNode
);
let
focusTracker
=
dom
.
trackFocus
(
this
.
_domNode
);
this
.
_
disposables
.
push
(
focusTracker
);
this
.
_
register
(
focusTracker
);
this
.
_
disposables
.
push
(
focusTracker
.
onDidBlur
(
_
=>
this
.
_onDidChangeFocus
.
fire
(
false
)));
this
.
_
register
(
focusTracker
.
onDidBlur
(
_
=>
this
.
_onDidChangeFocus
.
fire
(
false
)));
this
.
_
disposables
.
push
(
focusTracker
.
onDidFocus
(
_
=>
this
.
_onDidChangeFocus
.
fire
(
true
)));
this
.
_
register
(
focusTracker
.
onDidFocus
(
_
=>
this
.
_onDidChangeFocus
.
fire
(
true
)));
}
}
dispose
():
void
{
dispose
():
void
{
dispose
(
this
.
_disposables
);
super
.
dispose
(
);
dispose
(
this
.
_pendingLayout
);
dispose
(
this
.
_pendingLayout
);
this
.
_onDidSelectItem
.
dispose
();
this
.
_onDidFocusItem
.
dispose
();
this
.
_onDidChangeFocus
.
dispose
();
this
.
_domNode
.
remove
();
this
.
_domNode
.
remove
();
this
.
_disposables
.
length
=
0
;
this
.
_nodes
.
length
=
0
;
this
.
_nodes
.
length
=
0
;
this
.
_freeNodes
.
length
=
0
;
this
.
_freeNodes
.
length
=
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录