Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
7bce874d
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
7bce874d
编写于
7月 15, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Mark fields private
上级
c975752a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
src/vs/workbench/contrib/webview/browser/webviewEditor.ts
src/vs/workbench/contrib/webview/browser/webviewEditor.ts
+13
-13
未找到文件。
src/vs/workbench/contrib/webview/browser/webviewEditor.ts
浏览文件 @
7bce874d
...
...
@@ -24,8 +24,8 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
export
class
WebviewEditor
extends
BaseEditor
{
pr
otected
_webview
:
Webview
|
undefined
;
pr
otected
findWidgetVisible
:
IContextKey
<
boolean
>
;
pr
ivate
_webview
:
Webview
|
undefined
;
pr
ivate
_
findWidgetVisible
:
IContextKey
<
boolean
>
;
public
static
readonly
ID
=
'
WebviewEditor
'
;
...
...
@@ -39,7 +39,7 @@ export class WebviewEditor extends BaseEditor {
private
readonly
_onDidFocusWebview
=
this
.
_register
(
new
Emitter
<
void
>
());
public
readonly
onDidFocus
:
Event
<
any
>
=
this
.
_onDidFocusWebview
.
event
;
private
pendingMessages
:
any
[]
=
[];
private
_
pendingMessages
:
any
[]
=
[];
constructor
(
@
ITelemetryService
telemetryService
:
ITelemetryService
,
...
...
@@ -53,7 +53,7 @@ export class WebviewEditor extends BaseEditor {
)
{
super
(
WebviewEditor
.
ID
,
telemetryService
,
themeService
,
storageService
);
if
(
_contextKeyService
)
{
this
.
findWidgetVisible
=
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
.
bindTo
(
_contextKeyService
);
this
.
_
findWidgetVisible
=
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
.
bindTo
(
_contextKeyService
);
}
}
...
...
@@ -78,7 +78,7 @@ export class WebviewEditor extends BaseEditor {
}
public
dispose
():
void
{
this
.
pendingMessages
=
[];
this
.
_
pendingMessages
=
[];
// Let the editor input dispose of the webview.
this
.
_webview
=
undefined
;
...
...
@@ -96,18 +96,18 @@ export class WebviewEditor extends BaseEditor {
if
(
this
.
_webview
)
{
this
.
_webview
.
sendMessage
(
data
);
}
else
{
this
.
pendingMessages
.
push
(
data
);
this
.
_
pendingMessages
.
push
(
data
);
}
}
public
showFind
()
{
if
(
this
.
_webview
)
{
this
.
_webview
.
showFind
();
this
.
findWidgetVisible
.
set
(
true
);
this
.
_
findWidgetVisible
.
set
(
true
);
}
}
public
hideFind
()
{
this
.
findWidgetVisible
.
reset
();
this
.
_
findWidgetVisible
.
reset
();
if
(
this
.
_webview
)
{
this
.
_webview
.
hideFind
();
}
...
...
@@ -178,7 +178,7 @@ export class WebviewEditor extends BaseEditor {
this
.
_webview
=
undefined
;
this
.
_webviewContent
=
undefined
;
this
.
pendingMessages
=
[];
this
.
_
pendingMessages
=
[];
super
.
clearInput
();
}
...
...
@@ -189,7 +189,7 @@ export class WebviewEditor extends BaseEditor {
this
.
_webview
=
undefined
;
this
.
_webviewContent
=
undefined
;
}
this
.
pendingMessages
=
[];
this
.
_
pendingMessages
=
[];
return
super
.
setInput
(
input
,
options
,
token
)
.
then
(()
=>
input
.
resolve
())
.
then
(()
=>
{
...
...
@@ -240,7 +240,7 @@ export class WebviewEditor extends BaseEditor {
}
else
{
if
(
input
.
options
.
enableFindWidget
)
{
this
.
_contextKeyService
=
this
.
_register
(
this
.
_contextKeyService
.
createScoped
(
this
.
_webviewContent
));
this
.
findWidgetVisible
=
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
.
bindTo
(
this
.
_contextKeyService
);
this
.
_
findWidgetVisible
=
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
.
bindTo
(
this
.
_contextKeyService
);
}
this
.
_webview
=
this
.
_webviewService
.
createWebview
(
input
.
id
,
...
...
@@ -263,10 +263,10 @@ export class WebviewEditor extends BaseEditor {
this
.
doUpdateContainer
();
}
for
(
const
message
of
this
.
pendingMessages
)
{
for
(
const
message
of
this
.
_
pendingMessages
)
{
this
.
_webview
.
sendMessage
(
message
);
}
this
.
pendingMessages
=
[];
this
.
_
pendingMessages
=
[];
this
.
trackFocus
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录