Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
50751af4
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,发现更多精彩内容 >>
提交
50751af4
编写于
2月 07, 2020
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove initial dimension update
上级
c78a8696
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
4 addition
and
26 deletion
+4
-26
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+2
-7
src/vs/workbench/contrib/webview/browser/baseWebviewElement.ts
...s/workbench/contrib/webview/browser/baseWebviewElement.ts
+1
-13
src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts
...ch/contrib/webview/browser/dynamicWebviewEditorOverlay.ts
+1
-4
src/vs/workbench/contrib/webview/browser/pre/main.js
src/vs/workbench/contrib/webview/browser/pre/main.js
+0
-1
src/vs/workbench/contrib/webview/browser/webview.ts
src/vs/workbench/contrib/webview/browser/webview.ts
+0
-1
未找到文件。
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
50751af4
...
...
@@ -1579,13 +1579,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
this
.
_modelData
=
null
;
this
.
_domElement
.
removeAttribute
(
'
data-mode-id
'
);
if
(
removeDomNode
)
{
try
{
// @todo Peng
this
.
_domElement
.
removeChild
(
removeDomNode
);
}
catch
{
}
if
(
removeDomNode
&&
this
.
_domElement
.
contains
(
removeDomNode
))
{
this
.
_domElement
.
removeChild
(
removeDomNode
);
}
return
model
;
...
...
src/vs/workbench/contrib/webview/browser/baseWebviewElement.ts
浏览文件 @
50751af4
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
addClass
,
Dimension
}
from
'
vs/base/browser/dom
'
;
import
{
addClass
}
from
'
vs/base/browser/dom
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Disposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
...
...
@@ -28,7 +28,6 @@ export const enum WebviewMessageChannels {
loadResource
=
'
load-resource
'
,
loadLocalhost
=
'
load-localhost
'
,
webviewReady
=
'
webview-ready
'
,
didSetInitialDimension
=
'
did-set-initial-dimension
'
,
containsScripts
=
'
content-contains-scripts
'
,
wheel
=
'
did-scroll-wheel
'
,
ack
=
'
speed-test-ack
'
...
...
@@ -126,10 +125,6 @@ export abstract class BaseWebview<T extends HTMLElement> extends Disposable {
this
.
handleFocusChange
(
true
);
}));
this
.
_register
(
this
.
on
(
WebviewMessageChannels
.
didSetInitialDimension
,
(
dimension
:
Dimension
)
=>
{
this
.
handleInitialDimension
(
dimension
);
}));
this
.
_register
(
this
.
on
(
WebviewMessageChannels
.
containsScripts
,
(
containsScript
:
boolean
)
=>
{
this
.
containsScript
=
containsScript
;
}));
...
...
@@ -202,9 +197,6 @@ export abstract class BaseWebview<T extends HTMLElement> extends Disposable {
private
readonly
_onDidFocus
=
this
.
_register
(
new
Emitter
<
void
>
());
public
readonly
onDidFocus
=
this
.
_onDidFocus
.
event
;
private
readonly
_onDidSetInitialDimension
=
this
.
_register
(
new
Emitter
<
Dimension
>
());
public
readonly
onDidSetInitialDimension
=
this
.
_onDidSetInitialDimension
.
event
;
public
containsScript
:
boolean
=
false
;
public
sendMessage
(
data
:
any
):
void
{
...
...
@@ -321,10 +313,6 @@ export abstract class BaseWebview<T extends HTMLElement> extends Disposable {
}
}
protected
handleInitialDimension
(
dimension
:
Dimension
)
{
this
.
_onDidSetInitialDimension
.
fire
(
dimension
);
}
private
handleKeyDown
(
event
:
IKeydownEvent
)
{
// Create a fake KeyboardEvent from the data provided
const
emulatedKeyboardEvent
=
new
KeyboardEvent
(
'
keydown
'
,
event
);
...
...
src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts
浏览文件 @
50751af4
...
...
@@ -16,12 +16,9 @@ import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';
* Webview editor overlay that creates and destroys the underlying webview as needed.
*/
export
class
DynamicWebviewEditorOverlay
extends
Disposable
implements
WebviewEditorOverlay
{
private
readonly
_onDidWheel
=
this
.
_register
(
new
Emitter
<
IMouseWheelEvent
>
());
private
readonly
_onDidWheel
=
this
.
_register
(
new
Emitter
<
IMouseWheelEvent
>
());
public
readonly
onDidWheel
=
this
.
_onDidWheel
.
event
;
private
readonly
_onDidSetInitialDimension
=
this
.
_register
(
new
Emitter
<
Dimension
>
());
public
readonly
onDidSetInitialDimension
=
this
.
_onDidSetInitialDimension
.
event
;
private
readonly
_pendingMessages
=
new
Set
<
any
>
();
private
readonly
_webview
=
this
.
_register
(
new
MutableDisposable
<
WebviewElement
>
());
private
readonly
_webviewEvents
=
this
.
_register
(
new
DisposableStore
());
...
...
src/vs/workbench/contrib/webview/browser/pre/main.js
浏览文件 @
50751af4
...
...
@@ -506,7 +506,6 @@
newFrame
.
contentWindow
.
focus
();
}
host
.
postMessage
(
'
did-set-initial-dimension
'
,
{
width
:
newFrame
.
contentWindow
.
document
.
body
.
scrollWidth
,
height
:
newFrame
.
contentWindow
.
document
.
body
.
scrollHeight
});
host
.
postMessage
(
'
content-contains-scripts
'
,
checkScripts
(
newFrame
.
contentWindow
.
document
));
contentWindow
.
addEventListener
(
'
scroll
'
,
handleInnerScroll
);
...
...
src/vs/workbench/contrib/webview/browser/webview.ts
浏览文件 @
50751af4
...
...
@@ -80,7 +80,6 @@ export interface Webview extends IDisposable {
containsScript
:
boolean
;
readonly
onDidFocus
:
Event
<
void
>
;
readonly
onDidSetInitialDimension
:
Event
<
Dimension
>
;
readonly
onDidClickLink
:
Event
<
string
>
;
readonly
onDidScroll
:
Event
<
{
scrollYPercentage
:
number
}
>
;
readonly
onDidWheel
:
Event
<
IMouseWheelEvent
>
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录