mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-25 04:36:23 +00:00
Merge pull request #177537 from microsoft/aamunger/updateScrolling
show message to refresh if scrolling is enabled and not scrollable
This commit is contained in:
@@ -152,6 +152,10 @@ function renderError(
|
||||
content.classList.toggle('word-wrap', e.outputWordWrap);
|
||||
}));
|
||||
content.classList.toggle('scrollable', outputScrolling);
|
||||
outputElement.classList.toggle('hide-refresh', !outputScrolling);
|
||||
disposableStore.push(ctx.onDidChangeSettings(e => {
|
||||
outputElement.classList.toggle('hide-refresh', !e.outputScrolling);
|
||||
}));
|
||||
outputElement.classList.toggle('remove-padding', outputScrolling);
|
||||
outputElement.appendChild(content);
|
||||
initializeScroll(content, disposableStore);
|
||||
@@ -245,6 +249,10 @@ function renderStream(outputInfo: OutputItem, outputElement: HTMLElement, error:
|
||||
const contentParent = document.createElement('div');
|
||||
contentParent.appendChild(content);
|
||||
contentParent.classList.toggle('scrollable', outputScrolling);
|
||||
outputElement.classList.toggle('hide-refresh', !outputScrolling);
|
||||
disposableStore.push(ctx.onDidChangeSettings(e => {
|
||||
outputElement.classList.toggle('hide-refresh', !e.outputScrolling);
|
||||
}));
|
||||
|
||||
contentParent.classList.toggle('word-wrap', ctx.settings.outputWordWrap);
|
||||
disposableStore.push(ctx.onDidChangeSettings(e => {
|
||||
@@ -275,6 +283,10 @@ function renderText(outputInfo: OutputItem, outputElement: HTMLElement, ctx: IRi
|
||||
|
||||
const outputScrolling = ctx.settings.outputScrolling;
|
||||
content.classList.toggle('scrollable', outputScrolling);
|
||||
outputElement.classList.toggle('hide-refresh', !outputScrolling);
|
||||
disposableStore.push(ctx.onDidChangeSettings(e => {
|
||||
outputElement.classList.toggle('hide-refresh', !e.outputScrolling);
|
||||
}));
|
||||
outputElement.classList.toggle('remove-padding', outputScrolling);
|
||||
outputElement.appendChild(content);
|
||||
initializeScroll(content, disposableStore);
|
||||
@@ -335,6 +347,9 @@ export const activate: ActivationFunction<void> = (ctx) => {
|
||||
#container div.output .scrollable.scrollbar-visible {
|
||||
border-color: var(--vscode-editorWidget-border);
|
||||
}
|
||||
#container div.output.hide-refresh .scroll-refresh {
|
||||
display: none;
|
||||
}
|
||||
.output-plaintext .code-bold,
|
||||
.output-stream .code-bold,
|
||||
.traceback .code-bold {
|
||||
|
||||
@@ -27,6 +27,18 @@ function generateViewMoreElement(outputId: string) {
|
||||
container.appendChild(third);
|
||||
container.appendChild(forth);
|
||||
|
||||
const refreshSpan = document.createElement('span');
|
||||
refreshSpan.classList.add('scroll-refresh');
|
||||
const fifth = document.createElement('span');
|
||||
fifth.textContent = '. Refresh to view ';
|
||||
|
||||
const sixth = document.createElement('a');
|
||||
sixth.textContent = 'scrollable element';
|
||||
sixth.href = `command:cellOutput.enableScrolling?${outputId}`;
|
||||
refreshSpan.appendChild(fifth);
|
||||
refreshSpan.appendChild(sixth);
|
||||
container.appendChild(refreshSpan);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user