Skip to content

Commit 049635c

Browse files
committed
Update docs button title
1 parent 55988eb commit 049635c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/routes/edit/+page.svelte

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@
5454
};
5555
let docURL = docURLBase;
5656
let activeTabID = 'code';
57+
let docKey = '';
5758
stateStore.subscribe(({ code, editorMode }: ValidatedState) => {
5859
activeTabID = editorMode;
5960
const codeTypeMatch = /([\S]+)[\s\n]/.exec(code);
6061
if (codeTypeMatch && codeTypeMatch.length > 1) {
61-
const docKey = codeTypeMatch[1];
62+
docKey = codeTypeMatch[1];
6263
const docConfig = docMap[docKey] ?? { code: '' };
6364
docURL = docURLBase + (docConfig[editorMode] ?? docConfig.code ?? '');
6465
}
@@ -133,7 +134,9 @@
133134
on:click={syncDiagram}><i class="fas fa-sync" /></button>
134135
{/if}
135136

136-
<button class="btn btn-secondary btn-xs" title="View documentation">
137+
<button
138+
class="btn btn-secondary btn-xs"
139+
title="View documentation for {docKey.replace('Diagram', '')} diagram">
137140
<a target="_blank" rel="noreferrer" href={docURL} data-cy="docs">
138141
<i class="fas fa-book mr-1" />Docs
139142
</a>

0 commit comments

Comments
 (0)