Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4de13ca8
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,发现更多精彩内容 >>
提交
4de13ca8
编写于
11月 24, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CountBadge is not disposable
上级
e6361268
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
20 deletion
+12
-20
src/vs/base/browser/ui/countBadge/countBadge.ts
src/vs/base/browser/ui/countBadge/countBadge.ts
+9
-18
src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts
...ditor/contrib/referenceSearch/browser/referencesWidget.ts
+1
-1
src/vs/workbench/parts/search/browser/searchResultsView.ts
src/vs/workbench/parts/search/browser/searchResultsView.ts
+2
-1
未找到文件。
src/vs/base/browser/ui/countBadge/countBadge.ts
浏览文件 @
4de13ca8
...
...
@@ -6,42 +6,33 @@
'
use strict
'
;
import
'
vs/css!./countBadge
'
;
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
strings
=
require
(
'
vs/base/common/strings
'
)
;
import
{
$
,
append
}
from
'
vs/base/browser/dom
'
;
import
{
format
}
from
'
vs/base/common/strings
'
;
export
class
CountBadge
{
private
$el
:
Builder
;
private
element
:
HTMLElement
;
private
count
:
number
;
private
titleFormat
:
string
;
constructor
(
container
:
Builder
,
count
?:
number
,
titleFormat
?:
string
);
constructor
(
container
:
HTMLElement
,
count
?:
number
,
titleFormat
?:
string
);
constructor
(
container
:
any
,
count
?:
number
,
titleFormat
?:
string
)
{
this
.
$el
=
$
(
'
.monaco-count-badge
'
).
appendTo
(
container
);
constructor
(
container
:
HTMLElement
,
count
?:
number
,
titleFormat
?:
string
)
{
this
.
element
=
append
(
container
,
$
(
'
.monaco-count-badge
'
));
this
.
titleFormat
=
titleFormat
||
''
;
this
.
setCount
(
count
||
0
);
}
public
setCount
(
count
:
number
)
{
setCount
(
count
:
number
)
{
this
.
count
=
count
;
this
.
render
();
}
public
setTitleFormat
(
titleFormat
:
string
)
{
setTitleFormat
(
titleFormat
:
string
)
{
this
.
titleFormat
=
titleFormat
;
this
.
render
();
}
private
render
()
{
this
.
$el
.
text
(
''
+
this
.
count
);
this
.
$el
.
title
(
strings
.
format
(
this
.
titleFormat
,
this
.
count
));
}
public
dispose
()
{
if
(
this
.
$el
)
{
this
.
$el
.
destroy
();
this
.
$el
=
null
;
}
this
.
element
.
textContent
=
''
+
this
.
count
;
this
.
element
.
title
=
format
(
this
.
titleFormat
,
this
.
count
);
}
}
src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts
浏览文件 @
4de13ca8
...
...
@@ -379,7 +379,7 @@ class Renderer extends LegacyRenderer {
badge
.
setTitleFormat
(
nls
.
localize
(
'
referenceCount
'
,
"
{0} reference
"
,
len
));
}
return
badge
;
return
null
;
});
/* tslint:enable:no-unused-expression */
...
...
src/vs/workbench/parts/search/browser/searchResultsView.ts
浏览文件 @
4de13ca8
...
...
@@ -149,7 +149,8 @@ export class SearchRenderer extends ActionsRenderer {
rightRenderer
=
(
right
:
HTMLElement
)
=>
{
let
len
=
fileMatch
.
count
();
return
new
CountBadge
(
right
,
len
,
len
>
1
?
nls
.
localize
(
'
searchMatches
'
,
"
{0} matches found
"
,
len
)
:
nls
.
localize
(
'
searchMatch
'
,
"
{0} match found
"
,
len
));
new
CountBadge
(
right
,
len
,
len
>
1
?
nls
.
localize
(
'
searchMatches
'
,
"
{0} matches found
"
,
len
)
:
nls
.
localize
(
'
searchMatch
'
,
"
{0} match found
"
,
len
));
return
null
;
};
widget
=
new
LeftRightWidget
(
container
,
leftRenderer
,
rightRenderer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录