mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 3d67364fbfcf676d93be64f949e9b33e7f1b969e (#5028)
This commit is contained in:
@@ -184,6 +184,9 @@ module.exports = function createWebviewManager(host) {
|
||||
|
||||
let isHandlingScroll = false;
|
||||
const handleInnerScroll = (event) => {
|
||||
if (!event.target || !event.target.body) {
|
||||
return;
|
||||
}
|
||||
if (isHandlingScroll) {
|
||||
return;
|
||||
}
|
||||
@@ -205,6 +208,10 @@ module.exports = function createWebviewManager(host) {
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if (!document.body) {
|
||||
return;
|
||||
}
|
||||
|
||||
host.onMessage('styles', (_event, variables, activeTheme) => {
|
||||
initData.styles = variables;
|
||||
initData.activeTheme = activeTheme;
|
||||
@@ -214,7 +221,9 @@ module.exports = function createWebviewManager(host) {
|
||||
return;
|
||||
}
|
||||
|
||||
applyStyles(target.contentDocument, target.contentDocument.body);
|
||||
if (target.contentDocument) {
|
||||
applyStyles(target.contentDocument, target.contentDocument.body);
|
||||
}
|
||||
});
|
||||
|
||||
// propagate focus
|
||||
@@ -346,15 +355,15 @@ module.exports = function createWebviewManager(host) {
|
||||
return false;
|
||||
};
|
||||
|
||||
let onLoad = (contentDocument, contentWindow) => {
|
||||
if (contentDocument.body) {
|
||||
const onLoad = (contentDocument, contentWindow) => {
|
||||
if (contentDocument && contentDocument.body) {
|
||||
// Workaround for https://github.com/Microsoft/vscode/issues/12865
|
||||
// check new scrollY and reset if neccessary
|
||||
setInitialScrollPosition(contentDocument.body, contentWindow);
|
||||
}
|
||||
|
||||
const newFrame = getPendingFrame();
|
||||
if (newFrame && newFrame.contentDocument === contentDocument) {
|
||||
if (newFrame && newFrame.contentDocument && newFrame.contentDocument === contentDocument) {
|
||||
const oldActiveFrame = getActiveFrame();
|
||||
if (oldActiveFrame) {
|
||||
document.body.removeChild(oldActiveFrame);
|
||||
|
||||
@@ -46,7 +46,7 @@ export class WebviewEditorInputFactory implements IEditorInputFactory {
|
||||
title: input.getName(),
|
||||
options: input.options,
|
||||
extensionLocation: input.extension ? input.extension.location : undefined,
|
||||
extensionId: input.extension ? input.extension.id.value : undefined,
|
||||
extensionId: input.extension && input.extension.id ? input.extension.id.value : undefined,
|
||||
state: input.state,
|
||||
iconPath: input.iconPath ? { light: input.iconPath.light, dark: input.iconPath.dark, } : undefined,
|
||||
group: input.group
|
||||
|
||||
Reference in New Issue
Block a user