Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c2997da2
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,发现更多精彩内容 >>
提交
c2997da2
编写于
9月 30, 2019
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Gesture.addTarget returns an IDisposable
fixes #81630
上级
5c3ac79b
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
22 addition
and
14 deletion
+22
-14
src/vs/base/browser/touch.ts
src/vs/base/browser/touch.ts
+8
-2
src/vs/base/browser/ui/actionbar/actionbar.ts
src/vs/base/browser/ui/actionbar/actionbar.ts
+1
-1
src/vs/base/browser/ui/button/button.ts
src/vs/base/browser/ui/button/button.ts
+1
-1
src/vs/base/browser/ui/dropdown/dropdown.ts
src/vs/base/browser/ui/dropdown/dropdown.ts
+1
-1
src/vs/base/browser/ui/list/listView.ts
src/vs/base/browser/ui/list/listView.ts
+1
-1
src/vs/base/browser/ui/list/listWidget.ts
src/vs/base/browser/ui/list/listWidget.ts
+1
-1
src/vs/base/browser/ui/menu/menubar.ts
src/vs/base/browser/ui/menu/menubar.ts
+2
-2
src/vs/base/browser/ui/sash/sash.ts
src/vs/base/browser/ui/sash/sash.ts
+1
-1
src/vs/base/parts/tree/browser/treeView.ts
src/vs/base/parts/tree/browser/treeView.ts
+3
-1
src/vs/editor/browser/controller/pointerHandler.ts
src/vs/editor/browser/controller/pointerHandler.ts
+1
-1
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
+1
-1
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+1
-1
未找到文件。
src/vs/base/browser/touch.ts
浏览文件 @
c2997da2
...
...
@@ -86,15 +86,21 @@ export class Gesture extends Disposable {
this
.
_register
(
DomUtils
.
addDisposableListener
(
document
,
'
touchmove
'
,
(
e
:
TouchEvent
)
=>
this
.
onTouchMove
(
e
)));
}
public
static
addTarget
(
element
:
HTMLElement
):
void
{
public
static
addTarget
(
element
:
HTMLElement
):
IDisposable
{
if
(
!
Gesture
.
isTouchDevice
())
{
return
;
return
Disposable
.
None
;
}
if
(
!
Gesture
.
INSTANCE
)
{
Gesture
.
INSTANCE
=
new
Gesture
();
}
Gesture
.
INSTANCE
.
targets
.
push
(
element
);
return
{
dispose
:
()
=>
{
Gesture
.
INSTANCE
.
targets
=
Gesture
.
INSTANCE
.
targets
.
filter
(
t
=>
t
!==
element
);
}
};
}
@
memoize
...
...
src/vs/base/browser/ui/actionbar/actionbar.ts
浏览文件 @
c2997da2
...
...
@@ -103,7 +103,7 @@ export class BaseActionViewItem extends Disposable implements IActionViewItem {
render
(
container
:
HTMLElement
):
void
{
this
.
element
=
container
;
Gesture
.
addTarget
(
container
);
this
.
_register
(
Gesture
.
addTarget
(
container
)
);
const
enableDragging
=
this
.
options
&&
this
.
options
.
draggable
;
if
(
enableDragging
)
{
...
...
src/vs/base/browser/ui/button/button.ts
浏览文件 @
c2997da2
...
...
@@ -63,7 +63,7 @@ export class Button extends Disposable {
container
.
appendChild
(
this
.
_element
);
Gesture
.
addTarget
(
this
.
_element
);
this
.
_register
(
Gesture
.
addTarget
(
this
.
_element
)
);
[
DOM
.
EventType
.
CLICK
,
EventType
.
Tap
].
forEach
(
eventType
=>
{
this
.
_register
(
DOM
.
addDisposableListener
(
this
.
_element
,
eventType
,
e
=>
{
...
...
src/vs/base/browser/ui/dropdown/dropdown.ts
浏览文件 @
c2997da2
...
...
@@ -83,7 +83,7 @@ export class BaseDropdown extends ActionRunner {
this
.
_register
(
cleanupFn
);
}
Gesture
.
addTarget
(
this
.
_label
);
this
.
_register
(
Gesture
.
addTarget
(
this
.
_label
)
);
}
get
element
():
HTMLElement
{
...
...
src/vs/base/browser/ui/list/listView.ts
浏览文件 @
c2997da2
...
...
@@ -236,7 +236,7 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
this
.
rowsContainer
=
document
.
createElement
(
'
div
'
);
this
.
rowsContainer
.
className
=
'
monaco-list-rows
'
;
Gesture
.
addTarget
(
this
.
rowsContainer
);
this
.
disposables
.
add
(
Gesture
.
addTarget
(
this
.
rowsContainer
)
);
this
.
scrollableElement
=
this
.
disposables
.
add
(
new
ScrollableElement
(
this
.
rowsContainer
,
{
alwaysConsumeMouseWheel
:
true
,
...
...
src/vs/base/browser/ui/list/listWidget.ts
浏览文件 @
c2997da2
...
...
@@ -542,7 +542,7 @@ export class MouseController<T> implements IDisposable {
list
.
onContextMenu
(
this
.
onContextMenu
,
this
,
this
.
disposables
);
list
.
onMouseDblClick
(
this
.
onDoubleClick
,
this
,
this
.
disposables
);
list
.
onTouchStart
(
this
.
onMouseDown
,
this
,
this
.
disposables
);
Gesture
.
addTarget
(
list
.
getHTMLElement
(
));
this
.
disposables
.
add
(
Gesture
.
addTarget
(
list
.
getHTMLElement
()
));
}
list
.
onMouseClick
(
this
.
onPointer
,
this
,
this
.
disposables
);
...
...
src/vs/base/browser/ui/menu/menubar.ts
浏览文件 @
c2997da2
...
...
@@ -238,7 +238,7 @@ export class MenuBar extends Disposable {
}
}));
Gesture
.
addTarget
(
buttonElement
);
this
.
_register
(
Gesture
.
addTarget
(
buttonElement
)
);
this
.
_register
(
DOM
.
addDisposableListener
(
buttonElement
,
EventType
.
Tap
,
(
e
:
GestureEvent
)
=>
{
// Ignore this touch if the menu is touched
if
(
this
.
isOpen
&&
this
.
focusedMenu
&&
this
.
focusedMenu
.
holder
&&
DOM
.
isAncestor
(
e
.
initialTarget
as
HTMLElement
,
this
.
focusedMenu
.
holder
))
{
...
...
@@ -322,7 +322,7 @@ export class MenuBar extends Disposable {
}
}));
Gesture
.
addTarget
(
buttonElement
);
this
.
_register
(
Gesture
.
addTarget
(
buttonElement
)
);
this
.
_register
(
DOM
.
addDisposableListener
(
buttonElement
,
EventType
.
Tap
,
(
e
:
GestureEvent
)
=>
{
// Ignore this touch if the menu is touched
if
(
this
.
isOpen
&&
this
.
focusedMenu
&&
this
.
focusedMenu
.
holder
&&
DOM
.
isAncestor
(
e
.
initialTarget
as
HTMLElement
,
this
.
focusedMenu
.
holder
))
{
...
...
src/vs/base/browser/ui/sash/sash.ts
浏览文件 @
c2997da2
...
...
@@ -139,7 +139,7 @@ export class Sash extends Disposable {
this
.
_register
(
domEvent
(
this
.
el
,
'
mousedown
'
)(
this
.
onMouseDown
,
this
));
this
.
_register
(
domEvent
(
this
.
el
,
'
dblclick
'
)(
this
.
onMouseDoubleClick
,
this
));
Gesture
.
addTarget
(
this
.
el
);
this
.
_register
(
Gesture
.
addTarget
(
this
.
el
)
);
this
.
_register
(
domEvent
(
this
.
el
,
EventType
.
Start
)(
this
.
onTouchStart
,
this
));
if
(
isIPad
)
{
...
...
src/vs/base/parts/tree/browser/treeView.ts
浏览文件 @
c2997da2
...
...
@@ -437,6 +437,7 @@ export class TreeView extends HeightMap {
private
shouldInvalidateDropReaction
:
boolean
;
private
currentDropTargets
:
ViewItem
[]
|
null
=
null
;
private
currentDropDisposable
:
Lifecycle
.
IDisposable
=
Lifecycle
.
Disposable
.
None
;
private
gestureDisposable
:
Lifecycle
.
IDisposable
=
Lifecycle
.
Disposable
.
None
;
private
dragAndDropScrollInterval
:
number
|
null
=
null
;
private
dragAndDropScrollTimeout
:
number
|
null
=
null
;
private
dragAndDropMouseY
:
number
|
null
=
null
;
...
...
@@ -523,7 +524,7 @@ export class TreeView extends HeightMap {
this
.
wrapper
.
style
.
msTouchAction
=
'
none
'
;
this
.
wrapper
.
style
.
msContentZooming
=
'
none
'
;
}
else
{
Touch
.
Gesture
.
addTarget
(
this
.
wrapper
);
this
.
gestureDisposable
=
Touch
.
Gesture
.
addTarget
(
this
.
wrapper
);
}
this
.
rowsContainer
=
document
.
createElement
(
'
div
'
);
...
...
@@ -1675,6 +1676,7 @@ export class TreeView extends HeightMap {
if
(
this
.
context
.
cache
)
{
this
.
context
.
cache
.
dispose
();
}
this
.
gestureDisposable
.
dispose
();
super
.
dispose
();
}
...
...
src/vs/editor/browser/controller/pointerHandler.ts
浏览文件 @
c2997da2
...
...
@@ -190,7 +190,7 @@ class TouchHandler extends MouseHandler {
constructor
(
context
:
ViewContext
,
viewController
:
ViewController
,
viewHelper
:
IPointerHandlerHelper
)
{
super
(
context
,
viewController
,
viewHelper
);
Gesture
.
addTarget
(
this
.
viewHelper
.
linesContentDomNode
);
this
.
_register
(
Gesture
.
addTarget
(
this
.
viewHelper
.
linesContentDomNode
)
);
this
.
_register
(
dom
.
addDisposableListener
(
this
.
viewHelper
.
linesContentDomNode
,
EventType
.
Tap
,
(
e
)
=>
this
.
onTap
(
e
)));
this
.
_register
(
dom
.
addDisposableListener
(
this
.
viewHelper
.
linesContentDomNode
,
EventType
.
Change
,
(
e
)
=>
this
.
onChange
(
e
)));
...
...
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
浏览文件 @
c2997da2
...
...
@@ -34,7 +34,7 @@ export class NoTabsTitleControl extends TitleControl {
this
.
registerContainerListeners
();
// Gesture Support
Gesture
.
addTarget
(
this
.
titleContainer
);
this
.
_register
(
Gesture
.
addTarget
(
this
.
titleContainer
)
);
const
labelContainer
=
document
.
createElement
(
'
div
'
);
addClass
(
labelContainer
,
'
label-container
'
);
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
c2997da2
...
...
@@ -425,7 +425,7 @@ export class TabsTitleControl extends TitleControl {
addClass
(
tabContainer
,
'
tab
'
);
// Gesture Support
Gesture
.
addTarget
(
tabContainer
);
this
.
_register
(
Gesture
.
addTarget
(
tabContainer
)
);
// Tab Border Top
const
tabBorderTopContainer
=
document
.
createElement
(
'
div
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录