MCPcopy Index your code
hub / github.com/github/awesome-copilot / updateViewButtons

Function updateViewButtons

website/src/scripts/modal.ts:312–335  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

310}
311
312function updateViewButtons(): void {
313 const renderBtn = document.getElementById("render-btn");
314 const rawBtn = document.getElementById("raw-btn");
315 const markdownFile = currentFilePath
316 ? isMarkdownFile(currentFilePath)
317 : false;
318
319 if (!renderBtn || !rawBtn) return;
320
321 if (!markdownFile) {
322 renderBtn.classList.add("hidden");
323 rawBtn.classList.add("hidden");
324 return;
325 }
326
327 if (currentViewMode === "rendered") {
328 renderBtn.classList.add("hidden");
329 rawBtn.classList.remove("hidden");
330 return;
331 }
332
333 rawBtn.classList.add("hidden");
334 renderBtn.classList.remove("hidden");
335}
336
337async function renderCurrentFileContent(): Promise<void> {
338 if (!currentFilePath) return;

Callers 2

renderCurrentFileContentFunction · 0.85
openFileModalFunction · 0.85

Calls 1

isMarkdownFileFunction · 0.85

Tested by

no test coverage detected