mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 18:48:00 +00:00
Only rebuild walkthrough markdown media on unload (#176831)
Only rebuild walkthrough on unload
This commit is contained in:
parent
a0ab3587b5
commit
917b32cf9b
|
@ -658,8 +658,8 @@ export class GettingStartedPage extends EditorPane {
|
|||
const layoutDelayer = new Delayer(50);
|
||||
|
||||
this.layoutMarkdown = () => {
|
||||
layoutDelayer.trigger(async () => {
|
||||
this.buildMediaComponent(stepId);
|
||||
layoutDelayer.trigger(() => {
|
||||
webview.postMessage({ layoutMeNow: true });
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -674,7 +674,10 @@ export class GettingStartedPage extends EditorPane {
|
|||
this.openerService.open(message, { allowCommands: true });
|
||||
} else if (message.startsWith('setTheme:')) {
|
||||
this.configurationService.updateValue(ThemeSettings.COLOR_THEME, message.slice('setTheme:'.length), ConfigurationTarget.USER);
|
||||
} else {
|
||||
} else if (message === 'unloaded') {
|
||||
this.buildMediaComponent(stepId);
|
||||
}
|
||||
else {
|
||||
console.error('Unexpected message', message);
|
||||
}
|
||||
}));
|
||||
|
|
|
@ -125,6 +125,11 @@ export class GettingStartedDetailsRenderer {
|
|||
</body>
|
||||
<script nonce="${nonce}">
|
||||
const vscode = acquireVsCodeApi();
|
||||
|
||||
window.addEventListener('unload', event => {
|
||||
vscode.postMessage('unloaded');
|
||||
});
|
||||
|
||||
document.querySelectorAll('[when-checked]').forEach(el => {
|
||||
el.addEventListener('click', () => {
|
||||
vscode.postMessage(el.getAttribute('when-checked'));
|
||||
|
|
Loading…
Reference in a new issue