Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
a857ee8f
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
a857ee8f
编写于
5月 31, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Click on menus on explorer title bar collapses the explorer (fixes #27648)
上级
498beff5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
7 deletion
+21
-7
src/vs/base/browser/ui/dropdown/dropdown.ts
src/vs/base/browser/ui/dropdown/dropdown.ts
+11
-6
src/vs/workbench/parts/files/browser/explorerViewlet.ts
src/vs/workbench/parts/files/browser/explorerViewlet.ts
+9
-0
src/vs/workbench/parts/files/browser/views/explorerView.ts
src/vs/workbench/parts/files/browser/views/explorerView.ts
+1
-1
未找到文件。
src/vs/base/browser/ui/dropdown/dropdown.ts
浏览文件 @
a857ee8f
...
...
@@ -8,7 +8,7 @@
import
'
vs/css!./dropdown
'
;
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Gesture
,
EventType
}
from
'
vs/base/browser/touch
'
;
import
{
Gesture
,
EventType
as
GestureEventType
}
from
'
vs/base/browser/touch
'
;
import
{
ActionRunner
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
EventEmitter
}
from
'
vs/base/common/eventEmitter
'
;
...
...
@@ -16,6 +16,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import
{
IContextViewProvider
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
IMenuOptions
}
from
'
vs/base/browser/ui/menu/menu
'
;
import
{
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
EventHelper
,
EventType
}
from
"
vs/base/browser/dom
"
;
export
interface
ILabelRenderer
{
(
container
:
HTMLElement
):
IDisposable
;
...
...
@@ -50,11 +51,15 @@ export class BaseDropdown extends ActionRunner {
};
}
this
.
$label
.
on
([
'
mousedown
'
,
EventType
.
Tap
],
(
e
:
Event
)
=>
{
e
.
preventDefault
();
e
.
stopPropagation
();
this
.
show
();
this
.
$label
.
on
([
EventType
.
CLICK
,
EventType
.
MOUSE_DOWN
,
GestureEventType
.
Tap
],
(
e
:
Event
)
=>
{
EventHelper
.
stop
(
e
,
true
);
// prevent default click behaviour to trigger
}).
on
([
EventType
.
MOUSE_DOWN
,
GestureEventType
.
Tap
],
(
e
:
Event
)
=>
{
// We want to show the context menu on dropdown so that as a user you can press and hold the
// mouse button, make a choice of action in the menu and release the mouse to trigger that
// action.
// Due to some weird bugs though, we delay showing the menu to unwind event stack
// (see https://github.com/Microsoft/vscode/issues/27648)
setTimeout
(()
=>
this
.
show
(),
100
);
}).
appendTo
(
this
.
$el
);
let
cleanupFn
=
labelRenderer
(
this
.
$label
.
getHTMLElement
());
...
...
src/vs/workbench/parts/files/browser/explorerViewlet.ts
浏览文件 @
a857ee8f
...
...
@@ -99,6 +99,15 @@ export class ExplorerViewlet extends Viewlet {
if
(
this
.
views
.
length
===
1
)
{
return
this
.
views
[
0
].
getActions
();
}
return
[];
}
public
getSecondaryActions
():
IAction
[]
{
if
(
this
.
views
.
length
===
1
)
{
return
this
.
views
[
0
].
getSecondaryActions
();
}
return
[];
}
...
...
src/vs/workbench/parts/files/browser/views/explorerView.ts
浏览文件 @
a857ee8f
...
...
@@ -131,7 +131,7 @@ export class ExplorerView extends CollapsibleViewletView {
this
.
tree
=
this
.
createViewer
(
$
(
this
.
treeContainer
));
if
(
this
.
toolBar
)
{
this
.
toolBar
.
setActions
(
prepareActions
(
this
.
getActions
()),
[]
)();
this
.
toolBar
.
setActions
(
prepareActions
(
this
.
getActions
()),
this
.
getSecondaryActions
()
)();
}
const
onFileIconThemeChange
=
(
fileIconTheme
:
IFileIconTheme
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录