Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 1x 1x 1x 1x 1x 1x 1x 1x 1x | import { WebviewApi } from 'vscode-webview';
import { CommandKey } from './command';
export enum HistoryAction {
Back = 'Back',
Forward = 'Forward',
}
export const navigatePanel = (vscode: WebviewApi<any>) => {
const historyNav = document.createElement('nav');
historyNav.classList.add('sub', 'historyNav');
const backBtn = document.createElement('button');
const forwardBtn = document.createElement('button');
backBtn.innerHTML = '←';
backBtn.ariaLabel = 'Back Button';
backBtn.classList.add('historyBtn');
backBtn.addEventListener('click', () => {
vscode.postMessage({
commandType: CommandKey.changeHistory,
payload: HistoryAction.Back,
});
});
forwardBtn.innerHTML = '→';
forwardBtn.ariaLabel = 'Forward Button';
forwardBtn.classList.add('historyBtn');
forwardBtn.addEventListener('click', () => {
vscode.postMessage({
commandType: CommandKey.changeHistory,
payload: HistoryAction.Forward,
});
});
historyNav.appendChild(backBtn);
historyNav.appendChild(forwardBtn);
// document.body.prepend(historyNav);
};
|