Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
25d0cdcb
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,发现更多精彩内容 >>
提交
25d0cdcb
编写于
5月 04, 2020
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix dragging views across notebook
Fix #96678
上级
5de0ef65
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
15 deletion
+22
-15
src/vs/workbench/contrib/notebook/browser/media/notebook.css
src/vs/workbench/contrib/notebook/browser/media/notebook.css
+4
-7
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
+1
-1
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
...h/contrib/notebook/browser/view/renderers/cellRenderer.ts
+17
-7
未找到文件。
src/vs/workbench/contrib/notebook/browser/media/notebook.css
浏览文件 @
25d0cdcb
...
@@ -35,6 +35,10 @@
...
@@ -35,6 +35,10 @@
position
:
relative
;
position
:
relative
;
}
}
.monaco-workbench
.part.editor
>
.content
.notebook-editor.global-drag-active
.webview
{
pointer-events
:
none
;
}
.monaco-workbench
.part.editor
>
.content
.notebook-editor
.cell-list-container
.webview-cover
{
.monaco-workbench
.part.editor
>
.content
.notebook-editor
.cell-list-container
.webview-cover
{
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
...
@@ -459,13 +463,6 @@
...
@@ -459,13 +463,6 @@
color
:
inherit
;
color
:
inherit
;
}
}
.notebook-webview
{
position
:
absolute
;
z-index
:
1000000
;
left
:
373px
;
top
:
0px
;
}
/* markdown */
/* markdown */
...
...
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
浏览文件 @
25d0cdcb
...
@@ -254,7 +254,7 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor {
...
@@ -254,7 +254,7 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor {
private
createCellList
():
void
{
private
createCellList
():
void
{
DOM
.
addClass
(
this
.
body
,
'
cell-list-container
'
);
DOM
.
addClass
(
this
.
body
,
'
cell-list-container
'
);
const
dndController
=
new
CellDragAndDropController
(
this
);
const
dndController
=
this
.
_register
(
new
CellDragAndDropController
(
this
)
);
const
renders
=
[
const
renders
=
[
this
.
instantiationService
.
createInstance
(
CodeCellRenderer
,
this
,
this
.
renderedEditors
,
dndController
),
this
.
instantiationService
.
createInstance
(
CodeCellRenderer
,
this
,
this
.
renderedEditors
,
dndController
),
this
.
instantiationService
.
createInstance
(
MarkdownCellRenderer
,
this
.
contextKeyService
,
this
,
dndController
,
this
.
renderedEditors
),
this
.
instantiationService
.
createInstance
(
MarkdownCellRenderer
,
this
.
contextKeyService
,
this
,
dndController
,
this
.
renderedEditors
),
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
浏览文件 @
25d0cdcb
...
@@ -488,16 +488,31 @@ const DRAGGING_CLASS = 'cell-dragging';
...
@@ -488,16 +488,31 @@ const DRAGGING_CLASS = 'cell-dragging';
const
DRAGOVER_TOP_CLASS
=
'
cell-dragover-top
'
;
const
DRAGOVER_TOP_CLASS
=
'
cell-dragover-top
'
;
const
DRAGOVER_BOTTOM_CLASS
=
'
cell-dragover-bottom
'
;
const
DRAGOVER_BOTTOM_CLASS
=
'
cell-dragover-bottom
'
;
const
GLOBAL_DRAG_CLASS
=
'
global-drag-active
'
;
type
DragImageProvider
=
()
=>
HTMLElement
;
type
DragImageProvider
=
()
=>
HTMLElement
;
export
class
CellDragAndDropController
{
export
class
CellDragAndDropController
extends
Disposable
{
// TODO@roblourens - should probably use dataTransfer here, but any dataTransfer set makes the editor think I am dropping a file, need
// TODO@roblourens - should probably use dataTransfer here, but any dataTransfer set makes the editor think I am dropping a file, need
// to figure out how to prevent that
// to figure out how to prevent that
private
currentDraggedCell
:
ICellViewModel
|
undefined
;
private
currentDraggedCell
:
ICellViewModel
|
undefined
;
constructor
(
constructor
(
private
readonly
notebookEditor
:
INotebookEditor
private
readonly
notebookEditor
:
INotebookEditor
)
{
}
)
{
super
();
this
.
_register
(
domEvent
(
document
.
body
,
DOM
.
EventType
.
DRAG_START
,
true
)(
this
.
onGlobalDragStart
.
bind
(
this
)));
this
.
_register
(
domEvent
(
document
.
body
,
DOM
.
EventType
.
DRAG_END
,
true
)(
this
.
onGlobalDragEnd
.
bind
(
this
)));
}
private
onGlobalDragStart
()
{
this
.
notebookEditor
.
getDomNode
().
classList
.
add
(
GLOBAL_DRAG_CLASS
);
}
private
onGlobalDragEnd
()
{
this
.
notebookEditor
.
getDomNode
().
classList
.
remove
(
GLOBAL_DRAG_CLASS
);
}
addListeners
(
templateData
:
BaseCellRenderTemplate
,
dragImageProvider
:
DragImageProvider
):
void
{
addListeners
(
templateData
:
BaseCellRenderTemplate
,
dragImageProvider
:
DragImageProvider
):
void
{
const
container
=
templateData
.
container
;
const
container
=
templateData
.
container
;
...
@@ -511,17 +526,12 @@ export class CellDragAndDropController {
...
@@ -511,17 +526,12 @@ export class CellDragAndDropController {
};
};
templateData
.
disposables
.
add
(
domEvent
(
dragHandle
,
DOM
.
EventType
.
DRAG_END
)(()
=>
{
templateData
.
disposables
.
add
(
domEvent
(
dragHandle
,
DOM
.
EventType
.
DRAG_END
)(()
=>
{
// TODO@roblourens
(
this
.
notebookEditor
.
getInnerWebview
()
as
any
)
!
.
element
.
style
[
'
pointer-events
'
]
=
''
;
// Note, templateData may have a different element rendered into it by now
// Note, templateData may have a different element rendered into it by now
container
.
classList
.
remove
(
DRAGGING_CLASS
);
container
.
classList
.
remove
(
DRAGGING_CLASS
);
dragCleanup
();
dragCleanup
();
}));
}));
templateData
.
disposables
.
add
(
domEvent
(
dragHandle
,
DOM
.
EventType
.
DRAG_START
)(
event
=>
{
templateData
.
disposables
.
add
(
domEvent
(
dragHandle
,
DOM
.
EventType
.
DRAG_START
)(
event
=>
{
(
this
.
notebookEditor
.
getInnerWebview
()
as
any
)
!
.
element
.
style
[
'
pointer-events
'
]
=
'
none
'
;
if
(
!
event
.
dataTransfer
)
{
if
(
!
event
.
dataTransfer
)
{
return
;
return
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录